Boolean Logic
Boolean Logic
James T. Smith
San Francisco State University
You often make compound sentences by connecting shorter ones. Sometimes you
can determine the truth or falsehood of the longer sentence just from knowledge of the
truth or falsehood of its components. In that case, the compound is called Boolean. For
example, sentence B below is a Boolean compound, but C is not:
Sentence B is true just when both components are true. But, even when P and Q are
both true, you still can’t verify C without knowing how I was thinking when I put on
my helmet. (I might have donned it for safety or just because my wife said to.) Words
or phrases like and and because that we use to build compound sentences are called
connectives. Those that result in Boolean compounds are called Boolean. Thus, and is
Boolean but because is not. The systematic study of Boolean connectives is called Boolean
logic. Some equivalent terms are also common: propositional, sentential, or truth
functional logic.
Besides and, several more Boolean connectives are common. Here are some
examples:
2003-09-28 14:55
Page 2 BOOLEAN LOGIC
Evidently, you must sometimes vary the wording a little to avoid awkward diction. These
Boolean connectives occur so often that they have symbolic abbreviations and the
corresponding compound sentences have English names:
Sym- Com-
Connective bol pound Name
and & P&Q Conjunction of P,Q
not ¬ ¬P Negation of P
neither/nor 9 P9Q (None is common.)
if and only if ] P]Q Equivalence of P,Q
or w PwQ Disjunction of P,Q
Since there are so many Boolean connectives, you could use a device to help
determine the truth or falsehood of a Boolean compound once you know that of its
components. Pause for a moment: the awkward phrase truth or falsehood will recur
frequently in this discussion unless an abbreviation is adopted, so the term truth value
will be used from now on. Truth tables are commonly used to determine the truth value
of a Boolean compound from that of its components. Here are the tables for most of the
examples considered so far. T and F stand for the truth values.
Using truth tables you can see clearly that a conjunction is true just when both compo-
nents are, negation reverses truth values, and that an equivalence is true just when both
components have the same truth value.
There’s a problem with the truth table for disjunction: which of these should it
be?
PQ PwQ PQ P†Q
TT T TT F
TF T TF T
FT T FT T
FF F FF F
PQ PYQ
TT ?
TF F
FT ?
FF ?
PQ PYQ
TT T
TF F
FT T
FF T
Exercise 1 How many Boolean connectives are there? That is, how many truth tables
are there? How many really depend on both variables P and Q? For those that do, find
corresponding English connective phrases.
You can easily extend the truth table method to handle sentences with more than
two components. Here are two examples:
The sentence on the left, P & (Q w R) ] (P & Q) w (P & R), is called a tautology: it’s
true independently of the truth values of its components. (In fact, they haven’t even been
specified!) The one on the right, P & (Q w R) ] (P & Q) w R, is called a contingency
because it’s sometimes true, sometimes false.
The truth table method shown above on the left for verifying a tautology is called
a full sweep. Sometimes you can short-cut it considerably by a fell swoop. For example,
to verify that the sentence
((P Y R)) & ((Q Y R)) Y ((P w Q) Y R)
is a tautology, attempt to falsify it. The left hand side would have to be true and the right
hand false, so P Y R, Q Y R, and P w Q would be true and R false. But falsehood of
R would entail falsehood of P and Q, contradicting the truth of P w Q.
BOOLEAN LOGIC Page 5
Exercises 3 By one method or another verify the following tautologies. Most have
names and play significant roles in applications of Boolean logic. For each tautology
involving & and w, construct a new one by interchanging those two connectives and
possibly making other systematic changes (try reversing conditionals).
(P & P) ] P Idempotency
(P & Q) ] (Q & P) Commutativity
(P & (Q & R)) ] ((P & Q) & R) Associativity
(P & (Q w R)) ] ((P & Q) w (P & R)) Distributivity
(P & Q) Y P Lower bound
(P Y Q) Y ((P Y R) Y (P Y (Q & R))) Greatest lower bound
PYP Reflexivity
(P Y Q) Y ((Q Y P ) Y (P ] Q)) Weak assymmetry
(P Y Q) Y ((Q Y R) Y (P Y R )) Transitivity
(P Y Q) ] (¬Q Y ¬P) Contraposition
¬(P & Q ) ] (¬P w ¬Q) De Morgan’s law
¬(P & ¬P) Excluded middle
¬¬P ] P Double negation
P Y (Q Y P) (No common name)
(P Y (Q Y R)) Y ((P Y Q) Y (P Y R)) Self distributivity
((P Y Q) Y P) Y P Peirce’s law
Although ancient philosophers studied some aspects of Boolean logic, the subject
really stems from George Boole’s work published in 1847. He noted that if you make
some symbol substitutions in the previous list of formulas, the results often closely
resemble valid algebraic laws. Here are some examples:
Replace by
& @
w +
¬ &
] = (sometimes)
Y # (sometimes)
P@Q=Q@P Commutativity
P @ (Q @ R) = (P @ Q) @ R Associativity
P @ (Q + R) = P @ Q + P @ R Distributivity
P#P Reflexivity
P # Q Y (Q # P Y P = Q) Weak assymmetry
P # Q Y (Q # R Y P # R) Transitivity
P # Q ] &Q # &P Contraposition
Page 6 BOOLEAN LOGIC
Of course, not all tautologies translate this way into valid algebraic laws. Boole’s work
suggested that algebraic methods might yield interesting results in logic, and during the
next hundred years many mathematicians and philosophers contributed to that study.
The exact relationship between truth tables and algebra is now contained in the highly
developed and closely related subjects of Boolean logic and Boolean algebra. The field
of algebraic logic extends these results to more detailed and powerful parts of logic.
Besides helping you verify tautologies, truth tables lead to disjunctive normal
forms of sentences. If you substitute letters P, Q, ÿ for the Boolean components of a
non-contradictory sentence S as earlier, then you can construct a sentence D equivalent
to S, which has a special form: D is a disjunction of conjunctions consisting of one each
of the letters P, Q, ÿ or their negations. Equivalent means that S ] D is a tautology.
For example, reconsider the truth table of the example contingency S considered
earlier:
The T entries in the third column from the right say that S is true just in case
That is, S is equivalent to the following sentence D, because they have the same truth
table:
select electronic components called gates that affect the output like the connectives &,
w, and ¬, then wire them together guided by the normal form D. To economize on
gates, they want a version of D with as few connectives as possible. This leads to a
subject called Boolean minimization. For example, the disjunction of the first four
conjuncts of the normal form D just considered is equivalent to the simple sentence P.
Thus, the original sentence S is equivalent to the shorter form
Exercise 4 Find a sentence equivalent to this example that includes only P, Q, R, the
connectives &, w, ¬, and parentheses, and has as few connectives as possible.
Another way to economize in circuit design is to use gates of one type only. This
is possible because of another normal form result: every sentence S is equivalent to a
sentence N in which no Boolean connective occurs except 9 (neither/nor). To con-
struct N first find a sentence C equivalent to S with no connectives except &, w and
¬. Second, replace all conjunctions T & U in C by equivalent formulas ¬T 9 ¬U.
You get a new sentence C r equivalent to S with no connectives except 9, w, and ¬.
Third, replace all disjunctions T w U in C r by equivalent formulas ¬(T 9 U ), and
delete any double negatives ¬¬. You get a new sentence CO equivalent to S with no
connectives except ¬ and 9. Finally, form the desired sentence N by replacing all
negations ¬T in CO by equivalent formulas T 9 T. To apply this result to circuit
design, convert the output signal sentence S to normal form N, select nor gates that
affect the output signal like the connective 9, and wire them together according to N.