Answer: B
To find the correct propositional logic formula, let us represent the condition "exactly two of p,q, and r are TRUE" using truth values.
The assignments of (p,q,r) that satisfy this condition are:
- p=0,q=1,r=1⟹∼p∧q∧r
- p=1,q=0,r=1⟹p∧∼q∧r
- p=1,q=1,r=0⟹p∧q∧∼r
Taking the disjunction (OR) of these three cases gives the required formula:
Formula=(∼p∧q∧r)∨(p∧∼q∧r)∨(p∧q∧∼r)
We can simplify the first two terms by factoring out r:
(∼p∧q∧r)∨(p∧∼q∧r)≡[(∼p∧q)∨(p∧∼q)]∧r
Recall that (∼p∧q)∨(p∧∼q) represents the Exclusive-OR (XOR) operation, p⊕q, which is the negation of the bi-conditional (XNOR) operation, ∼(p↔q):
p⊕q≡∼(p↔q)
Substituting this back into our simplified expression:
Formula=(∼(p↔q)∧r)∨(p∧q∧∼r)
This matches Option B.