01 / 21
\(p\)
\(q\)

Truth Tables &
Logical Expressions

Master the systematic method for evaluating logical connectives by constructing and reading truth tables for any compound proposition.

Discrete Math

What Is a Proposition?

A proposition is a declarative statement that is either true (T) or false (F), but never both. Propositions are the atoms of logic: we combine them with logical connectives to build compound expressions.

✓ Proposition
"7 is a prime number." This is always true.
✕ Not a Proposition
"What time is it?" Questions have no truth value.

The Five Core Connectives

\( \neg \) Negation
NOT \( p \): flips the truth value.
\( \land \) Conjunction
\( p \) AND \( q \): true only when both are true.
\( \lor \) Disjunction
\( p \) OR \( q \): true when at least one is true.
\( \to \) Conditional
If \( p \) then \( q \): false only when \( p \) is T and \( q \) is F.
\( \leftrightarrow \) Biconditional
\( p \) if and only if \( q \): true when both match.

Why Truth Tables Matter

A truth table systematically lists every possible combination of truth values for the variables in an expression, then evaluates the result for each row. This gives us a complete picture of when a statement is true or false.

✓ Verify Equivalences
Prove two expressions always produce the same outputs.
✓ Find Tautologies
Identify statements that are always true regardless of inputs.
✓ Debug Circuits
Digital logic gates follow the exact same rules.

Negation: \( \neg p \)

Negation is the simplest connective: it takes one input and flips it. If \( p \) is true, then \( \neg p \) is false, and vice versa.

\( p \) \( \neg p \)
T F
F T

AND vs. OR

\( p \) \( q \) \( p \land q \) \( p \lor q \)
TT TT
TF FT
FT FT
FF FF
\( \land \) Conjunction
Only one row is true: both inputs must be T.
\( \lor \) Disjunction
Only one row is false: both inputs must be F.

The Conditional: \( p \to q \)

The conditional "if \( p \), then \( q \)" is only false in one case: when the hypothesis \( p \) is true but the conclusion \( q \) is false. A false hypothesis makes the entire conditional vacuously true.

\( p \) \( q \) \( p \to q \)
TTT
TFF
FTT
FFT

The Biconditional: \( p \leftrightarrow q \)

The biconditional "\( p \) if and only if \( q \)" is true when both sides have the same truth value: both true or both false.

\( p \) \( q \) \( p \leftrightarrow q \)
TTT
TFF
FTF
FFT

\( \to \) vs. \( \leftrightarrow \): Key Difference

Conditional \( p \to q \) Biconditional \( p \leftrightarrow q \)
Read as "If \( p \), then \( q \)" "\( p \) if and only if \( q \)"
False when \( p \) is T and \( q \) is F \( p \) and \( q \) differ
Row (T, T) T T
Row (T, F) F F
Row (F, T) T F
Row (F, F) T T
Equivalent to \( \neg p \lor q \) \( (p \to q) \land (q \to p) \)

How to Build a Truth Table

1
Identify all variables. List every distinct propositional variable (\( p, q, r, \ldots \)).
2
Create \( 2^n \) rows. For \( n \) variables, you need \( 2^n \) rows to cover every combination.
3
Add columns for sub-expressions. Break the compound expression into parts, working from the innermost connectives outward.
4
Evaluate each column. Fill in truth values row by row using the definitions of each connective.
5
Read the final column. The last column gives the truth value of the full expression for every input combination.

Example 1: \( \neg p \land q \)

Evaluate \( \neg p \land q \). First negate \( p \), then combine with \( q \) using conjunction.

\( p \) \( q \) \( \neg p \) \( \neg p \land q \)
TTFF
TFFF
FTTT
FFTF

Example 2: \( p \lor (q \land \neg r) \)

With three variables, we need \( 2^3 = 8 \) rows. Work inside out: first \( \neg r \), then \( q \land \neg r \), then the full disjunction.

\( p \) \( q \) \( r \) \( \neg r \) \( q \land \neg r \) \( p \lor (q \land \neg r) \)
TTTFFT
TTFTTT
TFTFFT
TFFTFT
FTTFFF
FTFTTT
FFTFFF
FFFTFF

Example 3: Proving Equivalence

Show that \( p \to q \equiv \neg p \lor q \) by comparing their truth table columns.

\( p \) \( q \) \( \neg p \) \( p \to q \) \( \neg p \lor q \)
TTFTT
TFFFF
FTTTT
FFTTT

Tautology, Contradiction, Contingency

Tautology
Always true in every row. Example: \( p \lor \neg p \).
Contradiction
Always false in every row. Example: \( p \land \neg p \).
Contingency
Sometimes true, sometimes false. Example: \( p \land q \).

Common Mistakes

✕ Forgetting Rows
With \( n \) variables, you need exactly \( 2^n \) rows. Missing even one row can hide a crucial counterexample.
✕ Conditional Confusion
Students often think \( p \to q \) is false when \( p \) is F. Remember: a false hypothesis makes the conditional vacuously true.
✕ Ignoring Precedence
\( \neg \) binds tightest, then \( \land \), then \( \lor \), then \( \to \), then \( \leftrightarrow \). Use parentheses when unsure.

Connective Summary

Connective Symbol True when False when
Negation \( \neg p \) \( p \) is F \( p \) is T
Conjunction \( p \land q \) Both T Any F
Disjunction \( p \lor q \) Any T Both F
Conditional \( p \to q \) \( p \) F or \( q \) T \( p \) T and \( q \) F
Biconditional \( p \leftrightarrow q \) Same values Different values

Question 1 of 5

What is the truth value of \( p \land q \) when \( p = T \) and \( q = F \)?

Question 2 of 5

Which expression is a tautology?

Question 3 of 5

What is the truth value of \( p \to q \) when \( p = F \) and \( q = F \)?

Question 4 of 5

How many rows does a truth table need for the expression \( (p \land q) \to (r \lor s) \)?

Question 5 of 5

Which of the following is logically equivalent to \( p \to q \)?