Mathwords logoReference LibraryMathwords

Truth Table

A truth table is a table that shows every possible combination of truth values (true or false) for the variables in a logical expression, along with the resulting truth value of the expression itself.

A truth table is a systematic method of listing all possible assignments of truth values to the propositional variables in a logical expression, together with the corresponding truth value of the expression under each assignment. For an expression with nn variables, the table contains 2n2^n rows, representing every possible combination of true (T) and false (F). Truth tables are used to determine logical equivalence, validity of arguments, and the behavior of logical connectives.

Key Formula

Number of rows=2n\text{Number of rows} = 2^n
Where:
  • nn = the number of propositional variables in the expression

Worked Example

Problem: Construct a truth table for the expression p(¬q)p \land (\lnot q), where \land means "and" and ¬\lnot means "not."
Step 1: Identify the variables. There are 2 variables (pp and qq), so the table needs 22=42^2 = 4 rows.
Step 2: List all combinations of T and F for pp and qq. A standard approach is to alternate values: for the first variable cycle every 2 rows (TT then FF), and for the second variable alternate every row (TFTF).
Step 3: Evaluate the inner component ¬q\lnot q for each row. This simply flips the value of qq.
¬T=F,¬F=T\lnot T = F, \quad \lnot F = T
Step 4: Evaluate p(¬q)p \land (\lnot q) for each row. The conjunction (\land) is true only when both sides are true.
Step 5: Complete the table: Row 1: p=T,q=T,¬q=F,p(¬q)=Fp=T, q=T, \lnot q=F, p \land (\lnot q) = F. Row 2: p=T,q=F,¬q=T,p(¬q)=Tp=T, q=F, \lnot q=T, p \land (\lnot q) = T. Row 3: p=F,q=T,¬q=F,p(¬q)=Fp=F, q=T, \lnot q=F, p \land (\lnot q) = F. Row 4: p=F,q=F,¬q=T,p(¬q)=Fp=F, q=F, \lnot q=T, p \land (\lnot q) = F.
Answer: The expression p(¬q)p \land (\lnot q) is true only when pp is true and qq is false. In all other cases it is false.

Why It Matters

Truth tables are a foundational tool in logic, computer science, and digital circuit design. Every time a computer processes an if-then condition or a circuit switches on or off, the underlying logic can be represented by a truth table. In geometry courses, truth tables help you verify whether two statements are logically equivalent — for instance, confirming that a conditional and its contrapositive always share the same truth values.

Common Mistakes

Mistake: Forgetting to list all possible combinations of truth values.
Correction: With nn variables you need exactly 2n2^n rows. For 2 variables that's 4 rows, for 3 variables it's 8. A systematic pattern (like binary counting) ensures you don't miss any.
Mistake: Confusing the conditional (pqp \rightarrow q) with the biconditional (pqp \leftrightarrow q).
Correction: The conditional pqp \rightarrow q is false only when pp is true and qq is false. The biconditional is false whenever pp and qq have different truth values. Build a truth table for each to see the difference clearly.

Related Terms

  • ConjunctionThe logical AND operator used in truth tables
  • DisjunctionThe logical OR operator used in truth tables
  • ConditionalThe if-then statement analyzed via truth tables
  • ContrapositiveShown equivalent to conditional using truth tables