Truth tables
A truth table is a systematic tool to show how the truth value of a compound statement depends on the truth values of the individual statements. The table makes it possible to go through all possible situations and see exactly when an expression is true or false.
Number of rows
If a logical expression contains \( \large n \) statements, one must consider all combinations of true and false. Therefore, the table has \( \large 2^n \) rows.
Examples:
- For one statement, \( \large p \), the table has \( \large 2^1 = 2 \) rows.
- For two statements, \( \large p, q \), the table has \( \large 2^2 = 4 \) rows.
- For three statements, \( \large p, q, r \), the table has \( \large 2^3 = 8 \) rows.
Example: Two statements
We can examine the expression \( \large (p \lor q) \land \lnot p \). The table first shows all combinations of \( \large p \) and \( \large q \), and then the result of the entire expression:
$$ \begin{array}{|c|c|c|} \hline p & q & (p \lor q) \land \lnot p \\ \hline T & T & F \\ T & F & F \\ F & T & T \\ F & F & F \\ \hline \end{array} $$
Example: Three statements
If three statements are involved, the table quickly grows. For the expression \( \large (p \lor q) \Rightarrow r \) one must include all eight combinations:
$$ \begin{array}{|c|c|c|c|} \hline p & q & r & (p \lor q) \Rightarrow r \\ \hline T & T & T & T \\ T & T & F & F \\ T & F & T & T \\ T & F & F & F \\ F & T & T & T \\ F & T & F & F \\ F & F & T & T \\ F & F & F & T \\ \hline \end{array} $$
Applications
Truth tables are used for several purposes:
- To define logical connectives precisely.
- To analyze complex logical expressions.
- To investigate whether two expressions are logically equivalent.
- In computer science and electronics, e.g. to describe logic circuits and Boolean algebra.
Summary
A truth table shows all possible combinations of truth values for the statements involved in an expression. It makes it possible to see the rules clearly, check expressions, and prove logical relationships. Truth tables are therefore one of the most fundamental tools in logic.