User:Jon Awbrey/TABLE

=Logical Tables=

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 NOT p (also written as ~p or &not;p) is as follows:

The logical negation of a proposition p is notated in different ways in various contexts of discussion and fields of application. Among these variants are the following:

No matter how it is notated or symbolized, the logical negation &not;p is read as "it is not the case that p", or usually more simply as "not p".


 * Within a system of classical logic, double negation, that is, the negation of the negation of a proposition p, is logically equivalent to the initial proposition p. Expressed in symbolic terms, &not;(&not;p) &hArr; p.


 * Within a system of intuitionistic logic, however, &not;&not;p is a weaker statement than p. On the other hand, the logical equivalence &not;&not;&not;p &hArr; &not;p remains valid.

Logical negation can be defined in terms of other logical operations. For example, ~p can be defined as p &rarr; F, where &rarr; is material implication and F is absolute falsehood. Conversely, one can define F as p &amp; ~p for any proposition p, where &amp; is logical conjunction. The idea here is that any contradiction is false. While these ideas work in both classical and intuitionistic logic, they don't work in Brazilian logic, where contradictions are not necessarily false. But in classical logic, we get a further identity: p &rarr; q can be defined as ~p &or; q, where &or; is logical disjunction.

Algebraically, logical negation corresponds to the complement in a Boolean algebra (for classical logic) or a Heyting algebra (for intuitionistic logic).

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 AND q (also written as p &and; q, p & q, or p$$\cdot$$q) is as follows:

Logical disjunction
Logical disjunction 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 (also written as p &or; q) is as follows:

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 EQ q (also written as p = q, p &harr; q, or p &equiv; q) is as follows:

Exclusive disjunction
Exclusive disjunction 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 &oplus; q, or p &ne; q) is as follows:

The following equivalents can then be deduced:


 * $$\begin{matrix}

p + q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\ \\     & = & (p \lor q) & \land & (\lnot p \lor \lnot q) \\ \\     & = & (p \lor q) & \land & \lnot (p \land q) \end{matrix}$$

Generalized or n-ary XOR is true when the number of 1-bits is odd.

Logical implication
The material conditional and logical implication 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 &rarr; q) and the logical implication p implies q (symbolized as p &rArr; q) is as follows:

Logical NAND
The NAND operation 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 &uarr; q) is as follows:

Logical NOR
The NOR operation 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 NOR q (also written as p &perp; q or p &darr; q) is as follows:

Exclusive Disjunction
A + B = (A ∧ !B) ∨ (!A ∧ B)      = {(A ∧ !B) ∨ !A} ∧ {(A ∧ !B) ∨ B}       = {(A ∨ !A) ∧ (!B ∨ !A)} ∧ {(A ∨ B) ∧ (!B ∨ B)} = (!A ∨ !B) ∧ (A ∨ B)      = !(A ∧ B) ∧ (A ∨ B)

p + q = (p ∧ !q) ∨ (!p ∧ B)       = {(p ∧ !q) ∨ !p} ∧ {(p ∧ !q) ∨ q}       = {(p ∨ !q) ∧ (!q ∨ !p)} ∧ {(p ∨ q) ∧ (!q ∨ q)} = (!p ∨ !q) ∧ (p ∨ q)      = !(p ∧ q)  ∧ (p ∨ q)

p + q = (p ∧ ~q) ∨ (~p ∧ q)       = ((p ∧ ~q) ∨ ~p) ∧ ((p ∧ ~q) ∨ q)       = ((p ∨ ~q) ∧ (~q ∨ ~p)) ∧ ((p ∨ q) ∧ (~q ∨ q)) = (~p ∨ ~q) ∧ (p ∨ q)      = ~(p ∧ q)  ∧ (p ∨ q)


 * $$\begin{matrix}

p + q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\ & = & ((p \land \lnot q) \lor \lnot p) & \land & ((p \land \lnot q) \lor q) \\ & = & ((p \lor \lnot q) \land (\lnot q \lor \lnot p)) & \land & ((p \lor q) \land (\lnot q \lor q)) \\ & = & (\lnot p \lor \lnot q) & \land & (p \lor q) \\ & = & \lnot (p \land q) & \land & (p \lor q) \end{matrix}$$

Column displays

 * Applications
 * xor swap algorithm
 * xor linked list
 * Parity bit


 * In logic
 * Disjunctive syllogism
 * Affirming a disjunct
 * In mathematics
 * Boolean algebra
 * Symmetric difference


 * Other gates
 * CNOT
 * AND
 * OR
 * NAND
 * NOR
 * XNOR

=Mathematical Symbols=

=Work Area=


 * {| border="1" cellspacing="0" cellpadding="0" style="text-align:center"

! style="width:2em" | x0 ! style="width:2em" | x1
 * + Binary Operations
 * style="width:2em" | 2f0
 * style="width:2em" | 2f1
 * style="width:2em" | 2f2
 * style="width:2em" | 2f3
 * style="width:2em" | 2f4
 * style="width:2em" | 2f5
 * style="width:2em" | 2f6
 * style="width:2em" | 2f7
 * style="width:2em" | 2f8
 * style="width:2em" | 2f9
 * style="width:2em" | 2f10
 * style="width:2em" | 2f11
 * style="width:2em" | 2f12
 * style="width:2em" | 2f13
 * style="width:2em" | 2f14
 * style="width:2em" | 2f15
 * 0 || 0 || 0 || 1 || 0 || 1 || 0 || 1 || 0 || 1 || 0 || 1 || 0 || 1 || 0 || 1 || 0 || 1
 * 1 || 0 || 0 || 0 || 1 || 1 || 0 || 0 || 1 || 1 || 0 || 0 || 1 || 1 || 0 || 0 || 1 || 1
 * 0 || 1 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1
 * 1 || 1 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 1 || 1
 * }
 * 0 || 1 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1
 * 1 || 1 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 || 1 || 1
 * }
 * }