Truth tables, equivalence, and the logical laws
◈ 5 cardsBuild a truth table, prove two formulas equivalent by matching columns (exam Q1: P↔Q ≡ (P→Q)∧(Q→P)), and know De Morgan, contrapositive, and P→Q ≡ ¬P∨Q.
What a truth table is
An interpretation assigns a truth value to each propositional symbol. A formula over symbols has interpretations, and a truth table simply lists all of them, computing the formula's value on each row. For two symbols there are rows. The standard convention is to count down from all-true:
P Q
T T
T F
F T
F F
You fill the table inside-out: evaluate the innermost sub-expressions first, then combine them with the outer connective, using the connective definitions (recall: is false only when is true and false).
Equivalence = identical columns
Two formulas are logically equivalent () when they produce the same truth value on every interpretation — i.e. their final columns are identical, row for row. That is the entire method, and it is the literal task on exam Q1.
Worked example (exam Q1): prove
The biconditional ("P if and only if Q") is defined as both directions holding at once. Let us verify the two formulas have the same column. Recall is false only on the row , and is false only on :
P Q | P->Q | Q->P | (P->Q)&(Q->P) | P<->Q
T T | T | T | T | T
T F | F | T | F | F
F T | T | F | F | F
F F | T | T | T | T
The last two columns are identical (T, F, F, T), so . Read it in words: the biconditional is true exactly when and agree, and the conjunction of the two implications is true exactly when neither one-way arrow fails — which is the same rows. The Python exercise below generates exactly this table and prints the verdict.
The logical laws (memorise these)
Rather than build a table every time, you can transform a formula with known equivalences:
- De Morgan: and . Negation flips the connective and distributes over both operands.
- Implication as disjunction: . This is the rewrite that converts implications into clause form for resolution (Lesson 7, and Module 9).
- Contrapositive: . The contrapositive is equivalent to the original; the converse and the inverse are not.
- Double negation: .
- Distributive: , and the dual with swapped.
A formula true under every interpretation (an all-T column) is a tautology; one false under every interpretation (all-F) is a contradiction.