Truth Tables
π― Learning Objectives
- Construct truth tables systematically for any propositional formula
- Know the truth tables for all five connectives by heart
- Evaluate compound formulas with multiple variables
- Understand that n variables require 2n rows
1. What is a Truth Table?
A truth table is a tabular method for listing all possible truth value combinations of the variables in a formula and computing the resulting truth value of the formula under each combination.
For a propositional formula with n distinct propositional variables, the truth table has 2n rows, each corresponding to a unique truth assignment. The columns include each variable, sub-formulas, and the final formula.
2. Truth Tables for All Five Connectives
2.1 Negation (Β¬P)
| P | Β¬P |
|---|---|
| T | F |
| F | T |
2.2 Conjunction (P β§ Q)
| P | Q | P β§ Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
2.3 Disjunction (P β¨ Q)
| P | Q | P β¨ Q |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
2.4 Implication (P β Q)
| P | Q | P β Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
π Remember
Implication is false only when the antecedent (P) is true and the consequent (Q) is false. Mnemonic: "A true promise broken only when you promised (T) but didn't deliver (F)."
2.5 Biconditional (P β Q)
| P | Q | P β Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
3. Systematic Truth Table Construction Method
- Identify all distinct propositional variables in the formula.
- Create 2n rows for n variables.
- Fill variable columns using alternating pattern:
- First variable: T for first half, F for second half
- Second variable: alternate T/F in blocks of 2n-2
- Last variable: alternate T, F, T, F, ...
- Add columns for each sub-formula, from innermost to outermost.
- Compute each column using the connective definitions.
4. Worked Examples
Example 1: (P β Q) β§ (Q β R)
Three variables: P, Q, R β 2Β³ = 8 rows
| P | Q | R | P β Q | Q β R | (P β Q) β§ (Q β R) |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | T | F | T | F | F |
| T | F | T | F | T | F |
| T | F | F | F | T | F |
| F | T | T | T | T | T |
| F | T | F | T | F | F |
| F | F | T | T | T | T |
| F | F | F | T | T | T |
The formula is true in 4 out of 8 rows, so it is a contingency.
Example 2: Β¬P β¨ (Q β§ R) β (P β (Q β§ R))
Three variables: P, Q, R β 8 rows. We show that this is a tautology.
| P | Q | R | Q β§ R | Β¬P | Β¬P β¨ (Qβ§R) | P β (Qβ§R) | LHS β RHS |
|---|---|---|---|---|---|---|---|
| T | T | T | T | F | T | T | T |
| T | T | F | F | F | F | F | T |
| T | F | T | F | F | F | F | T |
| T | F | F | F | F | F | F | T |
| F | T | T | T | T | T | T | T |
| F | T | F | F | T | T | T | T |
| F | F | T | F | T | T | T | T |
| F | F | F | F | T | T | T | T |
All rows are T β this confirms that Β¬P β¨ Ξ± β‘ P β Ξ± (material implication equivalence) is a tautology.
Example 3: (P β¨ Q) β§ (Β¬P β¨ R) β§ (Β¬Q β¨ R)
This is a CNF formula. Let us evaluate it:
| P | Q | R | P β¨ Q | Β¬P β¨ R | Β¬Q β¨ R | Result |
|---|---|---|---|---|---|---|
| T | T | T | T | T | T | T |
| T | T | F | T | F | F | F |
| T | F | T | T | T | T | T |
| T | F | F | T | F | T | F |
| F | T | T | T | T | T | T |
| F | T | F | T | T | F | F |
| F | F | T | F | T | T | F |
| F | F | F | F | T | T | F |
The formula is satisfiable (true in rows 1, 3, 5) but not a tautology. The satisfying assignments are: {P=T, Q=T, R=T}, {P=T, Q=F, R=T}, {P=F, Q=T, R=T}. Notice that R must be true whenever the formula is satisfied.
5. Counting Truth Functions
Theorem: Number of Distinct Boolean Functions
For n propositional variables, the truth table has 2n rows. Each row can independently be T or F, so the total number of distinct Boolean functions of n variables is:
2(2n)
For n = 1: 22 = 4 functions. For n = 2: 24 = 16 functions. For n = 3: 28 = 256 functions.
π GATE Fact
The 16 binary truth functions for two variables include all possible connectives: AND, OR, NAND, NOR, XOR, XNOR, implication, converse implication, and others. NAND and NOR are each functionally completeβevery Boolean function can be expressed using only NAND (or only NOR).
6. GATE Exam Tips
π― Tips for GATE Questions
- Shortcut for implication: P β Q β‘ Β¬P β¨ Q. Use this to quickly evaluate implications without building the full table.
- Shortcut for biconditional: P β Q gives T when both have same value, F otherwise (like XNOR).
- Count satisfying assignments: GATE NAT questions may ask "How many truth assignments satisfy formula X?" β just count the T rows.
- For 4 variables: 2β΄ = 16 rows. Be systematic to avoid errors.