Question

Which one of the following propositional logic formulas is TRUE when exactly two of pp, qq, and rr are TRUE?

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2014 answer key

Solution

Construct the truth condition for 'exactly two of p, q, and r are true' and verify against the logical formula.

There are 3 truth assignments where exactly two of {p,q,r}\{p, q, r\} are TRUE:

  1. p=T,q=T,r=Fp = T, q = T, r = F
  2. p=T,q=F,r=Tp = T, q = F, r = T
  3. p=F,q=T,r=Tp = F, q = T, r = T

Consider the formula in Option B:

(∼(p↔q)∧r)∨(p∧q∧∼r)(\sim(p \leftrightarrow q) \land r) \lor (p \land q \land \sim r)

Let us analyze both terms:

  • The term (p∧q∧∼r)(p \land q \land \sim r) is TRUE if and only if p=T,q=T,r=Fp = T, q = T, r = F (Case 1).
  • The term (∼(p↔q)∧r)(\sim(p \leftrightarrow q) \land r) requires r=Tr = T and ∼(p↔q)=T\sim(p \leftrightarrow q) = T.
    The condition ∼(p↔q)\sim(p \leftrightarrow q) is equivalent to p≠qp \neq q (one is true, one is false).
    Along with r=Tr = T, this holds if and only if:
    (p=T,q=F,r=T)(p = T, q = F, r = T) or (p=F,q=T,r=T)(p = F, q = T, r = T) (Cases 2 and 3).

The disjunction of the two terms is therefore TRUE in exactly Cases 1, 2, and 3, and FALSE in all other five truth assignments.

Thus, formula B is TRUE when exactly two of p,q,rp, q, r are TRUE.

Final answer

B

Common trap

Selecting option A where (p↔q)∧r(p \leftrightarrow q) \land r is satisfied when p=q=r=Tp=q=r=T, meaning all three are true rather than exactly two.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
63 of 65, printed as CS Q.53
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.