Which one of the following propositional logic formulas is TRUE when exactly two of p, q, and r are TRUE?
(A) ((p ↔ q) ∧ r) ∨ (p ∧ q ∧ ~r) (B) (~(p ↔ q) ∧ r) ∨ (p ∧ q ∧ ~r) (C) ((p → q) ∧ r) ∨ (p ∧ q ∧ ~r) (D) (~(p ↔ q) ∧ r) ∧ (p ∧ q ∧ ~r)
- A((p ↔ q) ∧ r) ∨ (p ∧ q ∧ ~r)
- (~(p ↔ q) ∧ r) ∨ (p ∧ q ∧ ~r)
- C((p → q) ∧ r) ∨ (p ∧ q ∧ ~r)
- D(~(p ↔ q) ∧ r) ∧ (p ∧ q ∧ ~r)
Explanation
There are exactly 3 ways for two of p,q,r to be TRUE: (T,T,F), (T,F,T), (F,T,T). Option B's second disjunct p∧q∧¬r directly captures (T,T,F). For (T,F,T): p↔q is FALSE (T vs F), so ¬(p↔q) is TRUE, and with r=T, the first disjunct (¬(p↔q)∧r) is TRUE. Symmetrically for (F,T,T). Checking B is FALSE everywhere else: all-true (T,T,T) makes both disjuncts FALSE (p↔q is TRUE so ¬(p↔q)=F; and ¬r=F kills the second term); any single-true or all-false case also makes both disjuncts FALSE. So B is TRUE exactly when two of p,q,r are TRUE.
Source: GATE CS 2014 (Session 1) (2014)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.