Truth table

Truth tables are a type of mathematical table used in logic to determine whether an expression is true or valid. (Expressions may be arguments; i.e., a conjunction of expressions, each conjunct of which is a premise with the last being the conclusion.)

Truth tables were invented to work on the propositional calculus developed by Gottlob Frege, Bertrand Russell, and others. They were first invented in 1917, by Ludwig Wittgenstein, and later and independently, in 1921, by  Emil Post. Wittgenstein's Tractatus Logico-Philosophicus uses them to place truth functions in a series. The wide influence of this work led to the spread of the use of truth tables.

Truth tables are used to compute the values of truth-functional expressions (i.e., it is a decision procedure). A truth-functional expression is either atomic (i.e., a propositional variable (or placeholder) or a propositional function &mdash; e.g. Px) or built up from atomic formulas from logical operators (i.e. &and; (AND), &or; (OR), &not; (NOT) &mdash; e.g. Fx & Gx).

The column headings on a truth table show (i) the propositional functions and/or variables, and (ii) the truth-functional expression built up from those propositional functions or variables and operators. The rows show each possible valuation of T or F assignments to (i) and (ii). In other words, each row is a distinct interpretation of (i) and (ii).

Truth tables for classical (i.e., bivalent) logic are limited to Boolean logic systems where only two truth values are possible, true or false, usually denoted simply T and F in the tables (as remarked above).

Logical conjunction
For example, take two propositional variables, $$A$$ and $$B$$, and the logical operator "AND" (&and;), signifying the conjunction "A and B" or $$A$$ &and; $$B$$. In common English, if both A and B are true, then the conjunction "$$A$$ &and; $$B$$" is true; under all other possible assignments of truth values to $$A$$ &and; $$B$$, the conjunction is false. This relationship is defined as follows:

Logical disjunction
The OR (&or;) relationship is defined as follows:

Negation
In a boolean logic system, all the operators can be explicitly defined this way. For example, the NOT (&not;) relationship is defined as follows:

Logical nand
Compound expressions can be constructed, using parenthesis to denote precedence. The negation of conjunction &not; ($$A$$ &and; $$B$$) &equiv; $$A$$ &and; $$B$$, and the disjunction of negations &not; $$A$$ &or; &not; $$B$$ are depicted as follows:

Logical nor
Truth tables can be used to prove logical equivalence. The negation of disjunction &not; ($$A$$ &or; $$B$$) &equiv; $$A$$ &or; $$B$$, and the conjunction of negations &not; $$A$$ &and; &not; $$B$$ are depicted as follows:

Comparing the above two truth tables, since the enumeration of all possible truth-values for $$A$$ and $$B$$ yields the same truth-value under both $$A$$ &and; $$B$$ and &not; $$A$$ &or; &not; $$B$$; and both $$A$$ &or; $$B$$ and &not; $$A$$ &and; &not; $$B$$, the two and two are logically equivalent correspondingly, and may be substituted for each other. This equivalence is one of DeMorgan's Laws.

Truth table for most commonly used logical operators
Here is a truth table giving definitions of the most commonly used 6 of the 16 possible truth functions of 2 binary variables (P,Q are thus boolean variables):

Key:
 * T = true, F = false
 * &and; = AND (logical conjunction)
 * &or; = OR (logical disjunction)
 * &and; = XOR (exclusive or)
 * &or; = XNOR (exclusive nor)
 * &rarr; = conditional "if-then"
 * &larr; = conditional "(then)-if"

<&harr;>: biconditional or "if-and-only-if" is logically equivalent to < &or; >: XNOR (exclusive nor).

Johnston diagrams, similar to Venn diagrams and Euler diagrams, provide a way of visualizing truth tables. An interactive Johnston diagram illustrating truth tables is at LogicTutorial.com

Condensed truth tables for binary operators
For binary operators, a condensed form of truth table is also used, where the row headings and the column headings specify the operands and the table cells specify the result. For example Boolean Logic uses this condensed truth table notation:

This notation is useful especially if the operations are commutative, although one can additionally specify that the rows are the first operand and the columns are the second operand. This condensed notation is particularly useful in discussing multi-valued extensions of logic, as it significantly cuts down on combinatoric explosion of the number of rows otherwise needed. It also provides for quickly recognizable characteristic "shape" of the distribution of the values in the table which can assist the reader in grasping the rules more quickly.