Truth Tables

GATE DA β€” Very High Importance

🎯 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.

Definition: Truth Table

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
TF
FT

2.2 Conjunction (P ∧ Q)

PQP ∧ Q
TTT
TFF
FTF
FFF

2.3 Disjunction (P ∨ Q)

PQP ∨ Q
TTT
TFT
FTT
FFF

2.4 Implication (P β†’ Q)

PQP β†’ Q
TTT
TFF
FTT
FFT

πŸ“ 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)

PQP ↔ Q
TTT
TFF
FTF
FFT

3. Systematic Truth Table Construction Method

Algorithm: Truth Table Construction
  1. Identify all distinct propositional variables in the formula.
  2. Create 2n rows for n variables.
  3. 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, ...
  4. Add columns for each sub-formula, from innermost to outermost.
  5. Compute each column using the connective definitions.

4. Worked Examples

Example 1: (P β†’ Q) ∧ (Q β†’ R)

Three variables: P, Q, R β†’ 2Β³ = 8 rows

PQRP β†’ QQ β†’ R(P β†’ Q) ∧ (Q β†’ R)
TTTTTT
TTFTFF
TFTFTF
TFFFTF
FTTTTT
FTFTFF
FFTTTT
FFFTTT

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.

PQRQ ∧ RΒ¬PΒ¬P ∨ (Q∧R)P β†’ (Q∧R)LHS ↔ RHS
TTTTFTTT
TTFFFFFT
TFTFFFFT
TFFFFFFT
FTTTTTTT
FTFFTTTT
FFTFTTTT
FFFFTTTT

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:

PQRP ∨ Q¬P ∨ R¬Q ∨ RResult
TTTTTTT
TTFTFFF
TFTTTTT
TFFTFTF
FTTTTTT
FTFTTFF
FFTFTTF
FFFFTTF

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.