Which one of the following propositional logic formulas is TRUE when exactly…

2014

Which one of the following propositional logic formulas is TRUE when exactly two of \(p,q \) and \(r\) are TRUE?

  1. A.

    \((( p \leftrightarrow q) \wedge r) \vee (p \wedge q \wedge \sim r)\)

  2. B.

    \(( \sim (p \leftrightarrow q) \wedge r)\vee (p \wedge q \wedge \sim r)\)

  3. C.

    \(( (p \to q) \wedge r) \vee (p \wedge q \wedge \sim r)\)

  4. D.

    \((\sim (p \leftrightarrow q) \wedge r) \wedge (p \wedge q \wedge \sim r)\)

Attempted by 104 students.

Show answer & explanation

Correct answer: B

Correct formula: (¬(p ↔ q) ∧ r) ∨ (p ∧ q ∧ ¬r)

Reasoning: The formula is the disjunction of two cases that together capture all and only the assignments where exactly two variables are true.

  • Case 1: p and q are both true and r is false. Then p ∧ q ∧ ¬r is true, so the whole formula is true. (assignment: p = T, q = T, r = F)

  • Case 2: p and q have different truth values and r is true. Then ¬(p ↔ q) ∧ r is true, so the whole formula is true. (assignments: p = T, q = F, r = T or p = F, q = T, r = T)

These two cases correspond exactly to the three assignments with two true variables: (T,T,F), (T,F,T), and (F,T,T).

Why the other formulas fail:

  • ((p ↔ q) ∧ r) ∨ (p ∧ q ∧ ¬r) is true when p = q = r = true because (p ↔ q) ∧ r holds, so it accepts the case with all three true.

  • ((p → q) ∧ r) ∨ (p ∧ q ∧ ¬r) can be true when only one variable is true (for example p = F, q = F, r = T makes p → q true and r true), so it accepts one-true assignments.

  • (¬(p ↔ q) ∧ r) ∧ (p ∧ q ∧ ¬r) conjuncts contradictory requirements for r (both r and ¬r), so it is always false and cannot represent exactly-two-true.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir