Jump to content
Wikiversity

Truth table

From Wikiversity

This page belongs to resource collections on Logic and Inquiry.

A truth table is a tabular array that illustrates the computation of a logical function, that is, a function of the form f : A k A , {\displaystyle f:\mathbb {A} ^{k}\to \mathbb {A} ,} {\displaystyle f:\mathbb {A} ^{k}\to \mathbb {A} ,} where k {\displaystyle k\!} {\displaystyle k\!} is a non-negative integer and A {\displaystyle \mathbb {A} } {\displaystyle \mathbb {A} } is the domain of logical values { false , true } . {\displaystyle \{\operatorname {false} ,\operatorname {true} \}.} {\displaystyle \{\operatorname {false} ,\operatorname {true} \}.} The names of the logical values, or truth values, are commonly abbreviated in accord with the equations F = false {\displaystyle \operatorname {F} =\operatorname {false} } {\displaystyle \operatorname {F} =\operatorname {false} } and T = true . {\displaystyle \operatorname {T} =\operatorname {true} .} {\displaystyle \operatorname {T} =\operatorname {true} .}

In many applications it is usual to represent a truth function by a boolean function, that is, a function of the form f : B k B , {\displaystyle f:\mathbb {B} ^{k}\to \mathbb {B} ,} {\displaystyle f:\mathbb {B} ^{k}\to \mathbb {B} ,} where k {\displaystyle k\!} {\displaystyle k\!} is a non-negative integer and B {\displaystyle \mathbb {B} } {\displaystyle \mathbb {B} } is the boolean domain { 0 , 1 } . {\displaystyle \{0,1\}.\!} {\displaystyle \{0,1\}.\!} In most applications false {\displaystyle \operatorname {false} } {\displaystyle \operatorname {false} } is represented by 0 {\displaystyle 0\!} {\displaystyle 0\!} and true {\displaystyle \operatorname {true} } {\displaystyle \operatorname {true} } is represented by 1 {\displaystyle 1\!} {\displaystyle 1\!} but the opposite representation is also possible, depending on the overall representation of truth functions as boolean functions. The remainder of this article assumes the usual representation, taking the equations F = 0 {\displaystyle \operatorname {F} =0} {\displaystyle \operatorname {F} =0} and T = 1 {\displaystyle \operatorname {T} =1} {\displaystyle \operatorname {T} =1} for granted.

Logical negation

[edit | edit source ]

Logical negation is an operation on one logical value, typically the value of a proposition, that produces a value of true when its operand is false and a value of false when its operand is true.

The truth table of NOT   p , {\displaystyle \operatorname {NOT} ~p,} {\displaystyle \operatorname {NOT} ~p,} also written ¬ p , {\displaystyle \lnot p,\!} {\displaystyle \lnot p,\!} appears below:


Logical Negation {\displaystyle {\text{Logical Negation}}\!} {\displaystyle {\text{Logical Negation}}\!}
p {\displaystyle p\!} {\displaystyle p\!} ¬ p {\displaystyle \lnot p\!} {\displaystyle \lnot p\!}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }


The negation of a proposition p {\displaystyle p\!} {\displaystyle p\!} may be found notated in various ways in various contexts of application, often merely for typographical convenience. Among these variants are the following:


Variant Notations {\displaystyle {\text{Variant Notations}}\!} {\displaystyle {\text{Variant Notations}}\!}
Notation {\displaystyle {\text{Notation}}\!} {\displaystyle {\text{Notation}}\!} Vocalization {\displaystyle {\text{Vocalization}}\!} {\displaystyle {\text{Vocalization}}\!}
p ¯ {\displaystyle {\bar {p}}\!} {\displaystyle {\bar {p}}\!} p {\displaystyle p\!} {\displaystyle p\!} bar
p ~ {\displaystyle {\tilde {p}}\!} {\displaystyle {\tilde {p}}\!} p {\displaystyle p\!} {\displaystyle p\!} tilde
p {\displaystyle p'\!} {\displaystyle p'\!} p {\displaystyle p\!} {\displaystyle p\!} prime
p {\displaystyle p\!} {\displaystyle p\!} complement
! p {\displaystyle !p\!} {\displaystyle !p\!} bang p {\displaystyle p\!} {\displaystyle p\!}


Logical conjunction

[edit | edit source ]

Logical conjunction is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both of its operands are true.

The truth table of p   AND   q , {\displaystyle p~\operatorname {AND} ~q,} {\displaystyle p~\operatorname {AND} ~q,} also written p q {\displaystyle p\land q\!} {\displaystyle p\land q\!} or p q , {\displaystyle p\cdot q,\!} {\displaystyle p\cdot q,\!} appears below:


Logical Conjunction {\displaystyle {\text{Logical Conjunction}}\!} {\displaystyle {\text{Logical Conjunction}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p q {\displaystyle p\land q} {\displaystyle p\land q}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }


Logical disjunction

[edit | edit source ]

Logical disjunction , also called logical alternation, is an operation on two logical values, typically the values of two propositions, that produces a value of false if and only if both of its operands are false.

The truth table of p   OR   q , {\displaystyle p~\operatorname {OR} ~q,} {\displaystyle p~\operatorname {OR} ~q,} also written p q , {\displaystyle p\lor q,\!} {\displaystyle p\lor q,\!} appears below:


Logical Disjunction {\displaystyle {\text{Logical Disjunction}}\!} {\displaystyle {\text{Logical Disjunction}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p q {\displaystyle p\lor q} {\displaystyle p\lor q}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }


Logical equality

[edit | edit source ]

Logical equality is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both operands are false or both operands are true.

The truth table of p   EQ   q , {\displaystyle p~\operatorname {EQ} ~q,} {\displaystyle p~\operatorname {EQ} ~q,} also written p = q , {\displaystyle p=q,\!} {\displaystyle p=q,\!} p q , {\displaystyle p\Leftrightarrow q,\!} {\displaystyle p\Leftrightarrow q,\!} or p q , {\displaystyle p\equiv q,\!} {\displaystyle p\equiv q,\!} appears below:


Logical Equality {\displaystyle {\text{Logical Equality}}\!} {\displaystyle {\text{Logical Equality}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p = q {\displaystyle p=q\!} {\displaystyle p=q\!}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }


Exclusive disjunction

[edit | edit source ]

Exclusive disjunction , also known as logical inequality or symmetric difference, is an operation on two logical values, typically the values of two propositions, that produces a value of true just in case exactly one of its operands is true.

The truth table of p   XOR   q , {\displaystyle p~\operatorname {XOR} ~q,} {\displaystyle p~\operatorname {XOR} ~q,} also written p + q {\displaystyle p+q\!} {\displaystyle p+q\!} or p q , {\displaystyle p\neq q,\!} {\displaystyle p\neq q,\!} appears below:


Exclusive Disjunction {\displaystyle {\text{Exclusive Disjunction}}\!} {\displaystyle {\text{Exclusive Disjunction}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p   XOR   q {\displaystyle p~\operatorname {XOR} ~q} {\displaystyle p~\operatorname {XOR} ~q}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }


The following equivalents may then be deduced:

p + q = ( p ¬ q ) ( ¬ p q ) = ( p q ) ( ¬ p ¬ q ) = ( p q ) ¬ ( p q ) {\displaystyle {\begin{matrix}p+q&=&(p\land \lnot q)&\lor &(\lnot p\land q)\\[6pt]&=&(p\lor q)&\land &(\lnot p\lor \lnot q)\\[6pt]&=&(p\lor q)&\land &\lnot (p\land q)\end{matrix}}} {\displaystyle {\begin{matrix}p+q&=&(p\land \lnot q)&\lor &(\lnot p\land q)\\[6pt]&=&(p\lor q)&\land &(\lnot p\lor \lnot q)\\[6pt]&=&(p\lor q)&\land &\lnot (p\land q)\end{matrix}}}

Logical implication

[edit | edit source ]

The logical implication relation and the material conditional function are both associated with an operation on two logical values, typically the values of two propositions, that produces a value of false if and only if the first operand is true and the second operand is false.

The truth table associated with the material conditional if   p   then   q , {\displaystyle {\text{if}}~p~{\text{then}}~q,\!} {\displaystyle {\text{if}}~p~{\text{then}}~q,\!} symbolized p q , {\displaystyle p\rightarrow q,\!} {\displaystyle p\rightarrow q,\!} and the logical implication p   implies   q , {\displaystyle p~{\text{implies}}~q,\!} {\displaystyle p~{\text{implies}}~q,\!} symbolized p q , {\displaystyle p\Rightarrow q,\!} {\displaystyle p\Rightarrow q,\!} appears below:


Logical Implication {\displaystyle {\text{Logical Implication}}\!} {\displaystyle {\text{Logical Implication}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p q {\displaystyle p\Rightarrow q\!} {\displaystyle p\Rightarrow q\!}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }


Logical NAND

[edit | edit source ]

The logical NAND is an operation on two logical values, typically the values of two propositions, that produces a value of false if and only if both of its operands are true. In other words, it produces a value of true if and only if at least one of its operands is false.

The truth table of p   NAND   q , {\displaystyle p~\operatorname {NAND} ~q,} {\displaystyle p~\operatorname {NAND} ~q,} also written p q {\displaystyle p{\stackrel {\circ }{\curlywedge }}q\!} {\displaystyle p{\stackrel {\circ }{\curlywedge }}q\!} or p q , {\displaystyle p\barwedge q,\!} {\displaystyle p\barwedge q,\!} appears below:


Logical NAND {\displaystyle {\text{Logical NAND}}\!} {\displaystyle {\text{Logical NAND}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p q {\displaystyle p{\stackrel {\circ }{\curlywedge }}q\!} {\displaystyle p{\stackrel {\circ }{\curlywedge }}q\!}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }


Logical NNOR

[edit | edit source ]

The logical NNOR (“Neither Nor”) is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both of its operands are false. In other words, it produces a value of false if and only if at least one of its operands is true.

The truth table of p   NNOR   q , {\displaystyle p~\operatorname {NNOR} ~q,} {\displaystyle p~\operatorname {NNOR} ~q,} also written p q , {\displaystyle p\curlywedge q,\!} {\displaystyle p\curlywedge q,\!} appears below:


Logical NNOR {\displaystyle {\text{Logical NNOR}}\!} {\displaystyle {\text{Logical NNOR}}\!}
p {\displaystyle p\!} {\displaystyle p\!} q {\displaystyle q\!} {\displaystyle q\!} p q {\displaystyle p\curlywedge q\!} {\displaystyle p\curlywedge q\!}
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} }
F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }
T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } T {\displaystyle \operatorname {T} } {\displaystyle \operatorname {T} } F {\displaystyle \operatorname {F} } {\displaystyle \operatorname {F} }


Translations

[edit | edit source ]

Syllabus

[edit | edit source ]

Focal nodes

[edit | edit source ]

Peer nodes

[edit | edit source ]

Logical operators

[edit | edit source ]
[edit | edit source ]

Relational concepts

[edit | edit source ]

Information, Inquiry

[edit | edit source ]
[edit | edit source ]

Document history

[edit | edit source ]

Portions of the above article were adapted from the following sources under the GNU Free Documentation License, under other applicable licenses, or by permission of the copyright holders.

AltStyle によって変換されたページ (->オリジナル) /