Boolean Algebra


Boolean algebra is the branch of algebra in which the values of the variables are the truth values true and false

Expressions

Operators

Exclusive Or

P or Q, but not both: P+Q=(P∧¬Q)∨(¬P∧Q)P + Q = (P \land \lnot Q) \lor (\lnot P \land Q).

PP QQ P+QP + Q P∧¬QP \land \lnot Q ¬P∧Q\lnot P \land Q
F F F F F
F T T F T
T F T T F
T T F F F

Nor

Neither P nor Q: P↓Q=¬P∧¬QP \downarrow Q = \lnot P \land \lnot Q.

PP QQ P↓QP \downarrow Q ¬P\lnot P ¬Q\lnot Q
F F T T T
F T F T F
T F F F T
T T F F F

Negative And (NAND)

P and Q are not both true: P∣Q=¬P∨¬QP \mid Q = \lnot P \lor \lnot Q.

PP QQ P∣QP \mid Q ¬P\lnot P ¬Q\lnot Q
F F T T T
F T T T F
T F T F T
T T F F F

Conditional

If P, then Q: P→Q=¬P∨QP \rightarrow Q = \lnot P \lor Q. It is sometimes described like this:

PP QQ P→QP \rightarrow Q ¬P\lnot P
F F T T
F T T T
T F F F
T T T F

A conditional can also be expressed in the following form, called contrapositive: P→Q=¬Q→¬PP \rightarrow Q = \lnot Q \rightarrow \lnot P.

PP QQ ¬Q→¬P\lnot Q \rightarrow \lnot P ¬Q\lnot Q ¬P\lnot P
F F T T T
F T T F T
T F F T F
T T T F F

Proof:

P→Q=¬Q→¬P=Q∨¬P=¬P∨Q=P→Q\begin{align} P \rightarrow Q &= \lnot Q \rightarrow \lnot P \ &= Q \lor \lnot P \ &= \lnot P \lor Q \ &= P \rightarrow Q \end{align}

Biconditional (iff)

P if and only Q: P⇔Q=(P→Q)∧(Q→P)P \iff Q = (P \rightarrow Q) \land (Q \rightarrow P).

PP QQ P⇔QP \iff Q P→QP \rightarrow Q Q→PQ \rightarrow P
F F T T T
F T F T F
T F F F T
T T T T T

Laws

DeMorgan’s Laws

¬(P∧Q)=¬P∨¬Q¬(P∨Q)=¬P∧¬Q \lnot (P \land Q) = \lnot P \lor \lnot Q \ \lnot (P \lor Q) = \lnot P \land \lnot Q

Commutative Laws

P∧Q=Q∧PP∨Q=Q∨P P \land Q = Q \land P \ P \lor Q = Q \lor P

Associative Laws

P∧(Q∧R)=(P∧Q)∧RP∨(Q∨R)=(P∨Q)∨R P \land (Q \land R) = (P \land Q) \land R \ P \lor (Q \lor R) = (P \lor Q) \lor R

Idempotence Laws

P∧P⇔PP∨P⇔P P \land P \iff P \ P \lor P \iff P

Unit Element Laws

P∧true⇔PP∨true⇔true P \land true \iff P \ P \lor true \iff true

Zero Element Laws

P∧false⇔falseP∨false⇔P P \land false \iff false \ P \lor false \iff P

Complement Laws

P∧¬P⇔falseP∨¬P⇔true P \land \lnot P \iff false \ P \lor \lnot P \iff true

Distributive Laws

P∧(Q∨R)=(P∧Q)∨(P∧R)P∨(Q∧R)=(P∨Q)∧(P∨R) P \land (Q \lor R) = (P \land Q) \lor (P \land R) \ P \lor (Q \land R) = (P \lor Q) \land (P \lor R)

Absorption Laws

P∨(P∧Q)=PP∧(P∨Q)=P P \lor (P \land Q) = P \ P \land (P \lor Q) = P

Double Negation Law

¬¬P=P\lnot \lnot P = P

Truth Sets

The truth set of a statement P(x)P(x) is the set of all values of xx that make the statement P(x)P(x) true.