Safekipedia
Boolean algebraConceptual modelsMathematical tablesPropositional calculus

Truth table

Adapted from Wikipedia · Adventurer experience

A classical bust of the ancient Greek philosopher Socrates.

A truth table is a mathematical table used in logic. It helps us understand how different logical ideas work together. Think of it like a chart that shows what happens when we combine yes-or-no questions in different ways. For example, if we ask "Is it raining AND is it cold?" the truth table can tell us when this whole statement would be true.

Truth tables have columns for each question or input, like A and B, and one final column that shows the answer to the whole logical operation, like whether A XOR B is true. Each row shows one possible set of answers to the questions, such as "A is yes and B is no," and what the final result would be for that case.

The idea of a truth table was developed by Ludwig Wittgenstein in his book Tractatus Logico-Philosophicus, finished in 1918 and published in 1921. Around the same time, in 1921, another person named Emil Leon Post came up with a similar system on his own. Truth tables are important because they help mathematicians, computer scientists, and logicians see patterns and solve problems in a clear and organized way.

History

Truth tables have an interesting history in logic. Researchers think C.S. Peirce might have been the first to create a truth table in 1883. Later, in 1997, John Shosky found old notes from a lecture by Bertrand Russell from 1912. These notes showed that ideas about truth tables were developing earlier than many people thought.

Applications

Truth tables are useful tools in logic. They show that different logical expressions mean the same thing by listing all possible combinations of true and false values.

Truth tables are also important in digital electronics. They help explain how basic operations, like adding binary numbers, work. For example, adding two binary digits (0 or 1) can be shown in a truth table with four rows, representing all possible combinations of the two digits.

Main article: logical equivalences

( p → q ) ≡ ( ¬ p ∨ q ) {\displaystyle (p\rightarrow q)\equiv (\neg p\vee q)}
p {\displaystyle p} q {\displaystyle q} ¬ p {\displaystyle \neg p} ¬ p ∨ q {\displaystyle \neg p\vee q} p → q {\displaystyle p\rightarrow q}
TTFTT
TFFFF
FTTTT
FFTTT
Binary addition
ABCR
TTTF
TFFT
FTFT
FFFF

Methods of writing truth tables

People have different ways to fill in the columns on the left side of a truth table, but the logic stays the same. One common way, suggested by Lee Archie from Lander University, is to list the variables in alphabetical order. The number of rows needed is 2n, where n is the number of variables. You start from the right column and switch between T (for true) and F (for false). Then you move left, doubling the number of T’s and F’s each time until all rows are filled.

Another method, suggested by Colin Howson, starts with all T’s. Then it lists all the ways to mix T’s and F’s step by step, ending with all F’s. Both methods help make tables that show how logical expressions change with different combinations of true and false values for their variables. These tables can show if expressions are always true or sometimes false, which helps in understanding logic better. Main articles: Truth function, Logical equivalence.

P {\displaystyle P} Q {\displaystyle Q} R {\displaystyle R} P → ( Q ∨ R → ( R → ¬ P ) ) {\displaystyle P\rightarrow (Q\vee R\rightarrow (R\rightarrow \neg P))}
TTTF
TTFT
TFTF
TFFT
FTTT
FTFT
FFTT
FFFT
A {\displaystyle A} B {\displaystyle B} C {\displaystyle C} ( A → C ) ∧ ( B → C ) {\displaystyle (A\rightarrow C)\land (B\rightarrow C)} ( A ∨ B ) → C {\displaystyle (A\vee B)\rightarrow C}
TTTTT
TTFFF
TFTTT
FTTTT
FFTTT
FTFFF
TFFFF
FFFTT

Size of truth tables

If there are n input variables, there are 2n possible ways to combine their values. For each combination, a function can result in either true or false. This means the number of different functions for n variables is the double exponential 22n.

Truth tables for functions with three or more variables are rarely shown because they become very large and hard to manage.

n2n22n
012
124
2416
38256
41665,536
5324,294,967,296≈ 4.3×109
66418,446,744,073,709,551,616≈ 1.8×1019
7128340,282,366,920,938,463,463,374,607,431,768,211,456≈ 3.4×1038
8256115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936≈ 1.2×1077

Function Tables

Function tables are like truth tables. They show how outputs change with different values of variables. For example, in an XOR gate, a value G can decide to use another value X as it is, or to flip it to its opposite. This helps in making decisions in logic circuits.

A 4-to-1 multiplexer uses two select inputs, S0 and S1, to choose from four data inputs (A, B, C, and D) and produce an output Z. Function tables help show clearly how the output changes with different combinations of these inputs.

G {\displaystyle G} G ↮ X {\displaystyle G\nleftrightarrow X}
FX {\displaystyle X}
T¬ X {\displaystyle \neg X}
S 1 {\displaystyle S_{1}} S 0 {\displaystyle S_{0}} Z
FFA
FTB
TFC
TTD

Sentential operator truth tables

Truth tables are special tables used in logic. They show how different logical statements work. They help us know if a statement is true or false, based on its parts.

For example, if we have two statements, A and B, a truth table shows what happens when we connect them with words like "and," "or," or "if...then."

Each column in a truth table shows a different mix of true (T) and false (F) for the inputs. The last column shows the result of the logical test. This helps us see patterns and understand how logical ideas fit together.

p {\displaystyle p} q {\displaystyle q} ⊥ {\displaystyle \bot } p ↓ q {\displaystyle p\downarrow q} p ↚ q {\displaystyle p\nleftarrow q} ¬ p {\displaystyle \neg p} p ↛ q {\displaystyle p\nrightarrow q} ¬ q {\displaystyle \neg q} p ↮ q {\displaystyle p\nleftrightarrow q} p ↑ q {\displaystyle p\uparrow q} p ∧ q {\displaystyle p\land q} p ↔ q {\displaystyle p\leftrightarrow q} q {\displaystyle q} p → q {\displaystyle p\rightarrow q} p {\displaystyle p} p ← q {\displaystyle p\leftarrow q} p ∨ q {\displaystyle p\vee q} ⊤ {\displaystyle \top }
TTFFFFFFFFTTTTTTTT
TFFFFFTTTTFFFFTTTT
FTFFTTFFTTFFTTFFTT
FFFTFTFTFTFTFTFTFT
ComYesYesYesYesYesYesYesYes
AssocYesYesYesYesYesYesYesYes
Adj⊥ {\displaystyle \bot } p ↓ q {\displaystyle p\downarrow q} p ↛ q {\displaystyle p\nrightarrow q} ¬ q {\displaystyle \neg q} p ↚ q {\displaystyle p\nleftarrow q} ¬ p {\displaystyle \neg p} p ↮ q {\displaystyle p\nleftrightarrow q} p ↑ q {\displaystyle p\uparrow q} p ∧ q {\displaystyle p\land q} p ↔ q {\displaystyle p\leftrightarrow q} p {\displaystyle p} p ← q {\displaystyle p\leftarrow q} q {\displaystyle q} p → q {\displaystyle p\rightarrow q} p ∨ q {\displaystyle p\vee q} ⊤ {\displaystyle \top }
Neg⊤ {\displaystyle \top } p ∨ q {\displaystyle p\vee q} p ← q {\displaystyle p\leftarrow q} p {\displaystyle p} p → q {\displaystyle p\rightarrow q} q {\displaystyle q} p ↔ q {\displaystyle p\leftrightarrow q} p ∧ q {\displaystyle p\land q} p ↑ q {\displaystyle p\uparrow q} p ↮ q {\displaystyle p\nleftrightarrow q} ¬ q {\displaystyle \neg q} p ↛ q {\displaystyle p\nrightarrow q} ¬ p {\displaystyle \neg p} p ↚ q {\displaystyle p\nleftarrow q} p ↓ q {\displaystyle p\downarrow q} ⊥ {\displaystyle \bot }
Dual⊤ {\displaystyle \top } p ↑ q {\displaystyle p\uparrow q} p → q {\displaystyle p\rightarrow q} ¬ p {\displaystyle \neg p} p ← q {\displaystyle p\leftarrow q} ¬ q {\displaystyle \neg q} p ↔ q {\displaystyle p\leftrightarrow q} p ↓ q {\displaystyle p\downarrow q} p ∨ q {\displaystyle p\vee q} p ↮ q {\displaystyle p\nleftrightarrow q} q {\displaystyle q} p ↚ q {\displaystyle p\nleftarrow q} p {\displaystyle p} p ↛ q {\displaystyle p\nrightarrow q} p ∧ q {\displaystyle p\land q} ⊥ {\displaystyle \bot }
L idFFTTT, FTF
R idFFTTT, FTF
TruthvaluesOperatorOperation nameTractatus
0(F F F F)(p, q)falseOpqContradictionp and not p; and q and not q
1(F F F T)(p, q)NORpqXpqLogical NORneither p nor q
2(F F T F)(p, q)pqMpqConverse nonimplicationq and not p
3(F F T T)(p, q)¬p, ~p¬pNp, FpqNegationnot p
4(F T F F)(p, q)pqLpqMaterial nonimplicationp and not q
5(F T F T)(p, q)¬q, ~q¬qNq, GpqNegationnot q
6(F T T F)(p, q)XORpqJpqExclusive disjunctionp or q, but not both
7(F T T T)(p, q)NANDpqDpqLogical NANDnot both p and q
8(T F F F)(p, q)ANDpqKpqLogical conjunctionp and q
9(T F F T)(p, q)XNORp iff qEpqLogical biconditionalif p then q; and if q then p
10(T F T F)(p, q)qqHpqProjection functionq
11(T F T T)(p, q)pqif p then qCpqMaterial implicationif p then q
12(T T F F)(p, q)ppIpqProjection functionp
13(T T F T)(p, q)pqif q then pBpqConverse implicationif q then p
14(T T T F)(p, q)ORpqApqLogical disjunctionp or q
15(T T T T)(p, q)trueVpqTautologyif p then p; and if q then q
pTTFF
qTFTF
pTTFF
qTFTF
11TFTT
pT
TT
FT
pF
TF
FF
pp
TT
FF
p¬p
TF
FT
pqpq
TTT
TFF
FTF
FFF
pqpq
TTT
TFT
FTT
FFF
pqpq
TTT
TFF
FTT
FFT
pqpq
TTT
TFF
FTT
FFT
pqpq
TTT
TFF
FTF
FFT
pqpq
TTF
TFT
FTT
FFF
pqpq
TTF
TFT
FTT
FFT
pqp ∧ q¬(p ∧ q)¬p¬qp) ∨ (¬q)
TTTFFFF
TFFTFTT
FTFTTFT
FFFTTTT
pqpq
TTF
TFF
FTF
FFT
pqp ∨ q¬(p ∨ q)¬p¬qp) ∧ (¬q)
TTTFFFF
TFTFFTF
FTTFTFF
FFFTTTT

This article is a child-friendly adaptation of the Wikipedia article on Truth table, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.