Why is this logical expression using $P$, $Q$, $R$ logically equivalent to one using only $P$ and $Q$

logicpropositional-calculus

Formula 1:

$$(¬P ∧ ¬Q ∧ ¬R) ∨ (¬P ∧ ¬Q ∧ R) ∨ (P ∧ Q ∧ ¬R) ∨ (P ∧ Q ∧ R)$$

P   Q   R   F
0   0   0   1
0   0   1   1
0   1   0   0
0   1   1   0
1   0   0   0
1   0   1   0
1   1   0   1
1   1   1   1

Formula 2:
$$(¬P ∧ ¬Q) ∨ (P ∧ Q)$$

P   Q   ((¬P ∧ ¬Q) ∨ (P ∧ Q))
0   0              1
0   1              0
1   0              0
1   1              1

How are these two formulas logically equivalent? To my understanding when two formulas are logically equivalent, they have identical truth values under all interpretations, these 2 formulas produce completely different truth tables- formula 1 has 3 variables and formula 2 has 2 variables to start off with. I don't understand how they are logically equivalent?

Best Answer

Actually, they both have the same truth table. They only look different because you omitted $R$ from the second one, presumably due to the fact that it does not appear in the second formula. If we include $R$ in the second truth table, it becomes

P   Q   R   ((¬P ∧ ¬Q) ∨ (P ∧ Q))
0   0   0              1
0   0   1              1
0   1   0              0
0   1   1              0
1   0   0              0
1   0   1              0
1   1   0              1
1   1   1              1

As you can see, this is the same as the first one.