Difference between revisions of "Truth table"

MyWikiBiz, Author Your Legacy — Monday November 18, 2024
Jump to navigationJump to search
Line 131: Line 131:
 
==Exclusive disjunction==
 
==Exclusive disjunction==
  
''[[Exclusive disjunction]]'', also known as ''logical inequality'' or ''symmetric difference'', is an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''true'' just in case exactly one of its operands is true.
+
'''[[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''' (also written as '''p + q''', '''p ⊕ q''', or '''p ≠ q''') is as follows:
+
The truth table of <math>p ~\operatorname{XOR}~ q,</math> also written <math>p + q\!</math> or <math>p \ne q,\!</math> appears below:
  
 
<br>
 
<br>
  
{| align="center" border="1" cellpadding="8" cellspacing="0" style="background:#f8f8ff; font-weight:bold; text-align:center; width:45%"
+
{| align="center" border="1" cellpadding="8" cellspacing="0" style="text-align:center; width:45%"
|+ '''Exclusive Disjunction'''
+
|+ style="height:30px" | <math>\text{Exclusive Disjunction}\!</math>
|- style="background:#e6e6ff"
+
|- style="height:40px; background:#f0f0ff"
! style="width:15%" | p
+
| style="width:33%" | <math>p\!</math>
! style="width:15%" | q
+
| style="width:33%" | <math>q\!</math>
! style="width:15%" | p XOR q
+
| style="width:33%" | <math>p ~\operatorname{XOR}~ q</math>
 
|-
 
|-
| F || F || F
+
| <math>\operatorname{F}</math> || <math>\operatorname{F}</math> || <math>\operatorname{F}</math>
 
|-
 
|-
| F || T || T
+
| <math>\operatorname{F}</math> || <math>\operatorname{T}</math> || <math>\operatorname{T}</math>
 
|-
 
|-
| T || F || T
+
| <math>\operatorname{T}</math> || <math>\operatorname{F}</math> || <math>\operatorname{T}</math>
 
|-
 
|-
| T || T || F
+
| <math>\operatorname{T}</math> || <math>\operatorname{T}</math> || <math>\operatorname{F}</math>
 
|}
 
|}
  
 
<br>
 
<br>
  
The following equivalents can then be deduced:
+
The following equivalents may then be deduced:
  
: <math>\begin{matrix}
+
{| align="center" cellspacing="10" width="90%"
p + q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\
+
|
\\
+
<math>\begin{matrix}
       & = & (p \lor q) & \land & (\lnot p \lor \lnot q) \\
+
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)
 
       & = & (p \lor q) & \land & \lnot (p \land q)
 
\end{matrix}</math>
 
\end{matrix}</math>
 +
|}
  
 
==Logical implication==
 
==Logical implication==

Revision as of 13:58, 16 May 2012

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 : \mathbb{A}^k \to \mathbb{A},\) where \(k\!\) is a non-negative integer and \(\mathbb{A}\) is the domain of logical values \(\{ \operatorname{false}, \operatorname{true} \}.\) The names of the logical values, or truth values, are commonly abbreviated in accord with the equations \(\operatorname{F} = \operatorname{false}\) and \(\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 : \mathbb{B}^k \to \mathbb{B},\) where \(k\!\) is a non-negative integer and \(\mathbb{B}\) is the boolean domain \(\{ 0, 1 \}.\!\) In most applications the lo\(\operatorname{false}\) is represented by \(0\!\) and \(\operatorname{true}\) is represented by \(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 \(\operatorname{F} = 0\) and \(\operatorname{T} = 1\) for granted.

Logical negation

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 \(\operatorname{NOT}~ p,\) also written \(\lnot p,\!\) appears below:


\(\text{Logical Negation}\!\)
\(p\!\) \(\lnot p\!\)
\(\operatorname{F}\) \(\operatorname{T}\)
\(\operatorname{T}\) \(\operatorname{F}\)


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


\(\text{Variant Notations}\!\)
\(\text{Notation}\!\) \(\text{Vocalization}\!\)
\(\bar{p}\!\) \(p\!\) bar
\(\tilde{p}\!\) \(p\!\) tilde
\(p'\!\) \(p\!\) prime
\(p\!\) complement
\(!p\!\) bang \(p\!\)


Logical conjunction

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 ~\operatorname{AND}~ q,\) also written \(p \land q\!\) or \(p \cdot q,\!\) appears below:


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


Logical disjunction

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 ~\operatorname{OR}~ q,\) also written \(p \lor q,\!\) appears below:


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


Logical equality

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 ~\operatorname{EQ}~ q,\) also written \(p = q,\!\) \(p \Leftrightarrow q,\!\) or \(p \equiv q,\!\) appears below:


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


Exclusive disjunction

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 ~\operatorname{XOR}~ q,\) also written \(p + q\!\) or \(p \ne q,\!\) appears below:


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


The following equivalents may then be deduced:

\(\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

The logical implication and the material conditional 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 (symbolized as p → q) and the logical implication p implies q (symbolized as p ⇒ q) is as follows:


Logical Implication
p q p ⇒ q
F F T
F T T
T F F
T T T


Logical NAND

The logical NAND is a logical 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 (also written as p | q or p ↑ q) is as follows:


Logical NAND
p q p ↑ q
F F T
F T T
T F T
T T F


Logical NNOR

The logical NNOR is a logical 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 (also written as p ⊥ q or p ↓ q) is as follows:


Logical NNOR
p q p ↓ q
F F T
F T F
T F F
T T F


Translations

Syllabus

Focal nodes

Template:Col-breakTemplate:Col-breakTemplate:Col-end

Peer nodes

Template:Col-breakTemplate:Col-breakTemplate:Col-end

Logical operators

Template:Col-breakTemplate:Col-breakTemplate:Col-end

Related topics

Template:Col-breakTemplate:Col-breakTemplate:Col-breakTemplate:Col-end

Relational concepts

Template:Col-breakTemplate:Col-breakTemplate:Col-breakTemplate:Col-end

Information, Inquiry

Template:Col-breakTemplate:Col-breakTemplate:Col-breakTemplate:Col-breakTemplate:Col-end

Related articles

Document history

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.

Template:Col-breakTemplate:Col-breakTemplate:Col-breakTemplate:Col-end
<sharethis />