0% found this document useful (0 votes)
45 views

Boolean Logic

- Boolean logic studies how the truth values of compound sentences are determined from the truth values of their component sentences. - Compound sentences formed using connectives like "and", "or", and "not" are called Boolean compounds, as their truth can be determined from a truth table. - Other connectives like "because" are not Boolean, as determining their truth requires more information than just the truth values of the components. - Truth tables define the truth values of Boolean compounds based on the truth values of their components. They allow determining if a compound is a tautology, contradiction, or contingency.

Uploaded by

zodaken
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Boolean Logic

- Boolean logic studies how the truth values of compound sentences are determined from the truth values of their component sentences. - Compound sentences formed using connectives like "and", "or", and "not" are called Boolean compounds, as their truth can be determined from a truth table. - Other connectives like "because" are not Boolean, as determining their truth requires more information than just the truth values of the components. - Truth tables define the truth values of Boolean compounds based on the truth values of their components. They allow determining if a compound is a tautology, contradiction, or contingency.

Uploaded by

zodaken
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

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:

Component P: I’m wearing my helmet.


Component Q: Biking is dangerous.
B = “P and Q ”: I’m wearing my helmet
and biking is dangerous.
C = “P because Q ”: I’m wearing my helmet be-
cause biking is dangerous.

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:

Component P: I’m wearing my helmet.


Component Q : Biking is dangerous.
B = “not P”: I’m not wearing my helmet.
B = “neither P nor Q ”: I’m not wearing my helmet nor is
biking dangerous.
B = “P if and only if Q ”: I wear my helmet if and only if
biking is dangerous.
B = “P or Q ”: I’m wearing my helmet or biking
is dangerous.

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

(Various other symbols are commonly used, too.)

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.

PQ P&Q P ¬P PQ P9Q PQ P]Q


TT T T F TT F TT T
TF F F T TF F TF F
FT F FT F FT F
FF F FF T FF T

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

The first alternative is normally selected: a disjunction “P or Q ” is false just when


both components are. The second alternative is usually rendered differently in
BOOLEAN LOGIC Page 3

English: “either P or Q ”. It’s given a different symbol † and a different name,


exclusive disjunction.

An equivalence “P if and only if Q ” is often regarded as the conjunction of two


conditional sentences “if P then Q ” and “if Q then P”. Is ifÿ thenÿ a Boolean
connective? That is, does everyone agree on the truth value of “if P then Q ”
—abbreviated P Y Q —once they concur about P and Q? In fact, there’s general
agreement on only one line in the corresponding truth table:

PQ PYQ
TT ?
TF F
FT ?
FF ?

The other cases are problematic. Suppose

P: I’m wearing my helmet


Q: Biking is dangerous
are both true. Is the conditional
PYQ: If I’m wearing my helmet then biking is dangerous
true? You probably hesitate to answer, and you’d probably hesitate, too, if P were false.
In each of these cases in everyday life, to determine the truth value of P Y Q, you seem
to need more information about P and Q than just their truth values. Conditional
sentences, as used in everyday life, are not Boolean compounds.

However, conditional sentences play an important role in mathematics, and there


they usually don’t cause the same perplexity they do in everyday life. Therefore, in
mathematical practice, conditional sentences are frequently used as though Y were a
Boolean connective with the following truth table:

PQ PYQ
TT T
TF F
FT T
FF T

Thus, mathematicians generously regard conditionals as true except when inarguably


refuted by the case in the second line.
Page 4 BOOLEAN LOGIC

There’s an important sense in mathematics where Y is used in a non-Boolean


manner. Often P Y Q is read, “P implies Q ”, and indicates that you can find a proof
of Q from hypothesis P. If you can, then P Y Q must certainly be true according to
the truth table, else P would be false and Q true, and that situation would invalidate
the proof. But the mere fact that P Y Q is true according to the table (i.e. P is false
or Q true) doesn’t have anything directly to do with your ability to construct a proof.
Thus, truth tables are sometimes inappropriate for analyzing conditional sentences.

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:

P Q R P & (Q w R) ] (P & Q) w (P & R) P Q R P & (Q w R) ] (P & Q) w R


TTT T T T T T T TTT T T T T T
TTF T T T T T F TTF T T T T T
TFT T T T F T T TFT T T T F T
TFF F F T F F F TFF F F T F F
FTT F T T F F F FTT F T F F T
FTF F T T F F F FTF F T T F F
FFT F T T F F F FFT F T F F T
FFF F F T F F F FFF F F T F F

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.

Exercise 2 Invent some sentences involving three (unspecified) components P, Q, R


that are false independently of the truth values of P, Q, and R. Such sentences are
called contradictions.

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

&&P = P Double negation

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:

PQR S: P & (Q w R) ] (P & Q) w R


TTT T T T T T
TTF T T T T T
TFT T T T F T
TFF F F T F F
FTT F T F F T
FTF F T T F F
FFT F T F F T
FFF F F T F F

The T entries in the third column from the right say that S is true just in case

P is true, Q is true, and R is true, or


P is true, Q is true, and R is false, or
P is true, Q is false, and R is true, or
P is true, Q is false, and R is false, or
P is false, Q is true, and R is false, or
P is false, Q is false, and R is false.

That is, S is equivalent to the following sentence D, because they have the same truth
table:

(P & Q & R) w (P & Q & ¬R) w (P & ¬Q & R) w


(P & ¬Q & ¬R) w (¬P & Q & ¬R) w (¬P & ¬Q & ¬R).

To design an electrical circuit with input signals represented by P, Q, ÿ whose


output signal behaves like a given Boolean combination S of P, Q, ÿ engineers can
BOOLEAN LOGIC Page 7

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

P w (¬P & Q & ¬R) w (¬P & ¬Q & ¬R).

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.

Exercise 5 Show that every non-tautological sentence with Boolean components P, Q,


ÿ is equivalent to a conjunction C of disjunctions that contain one each of the compo-
nents and their negations. (Hint: use De Morgan’s law.) Find this conjunctive normal
form C for the example sentence S just considered.

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.

Exercise 6 Construct a normal form of type N equivalent to the example sentence S


considered earlier. Try to make N as short as possible.

Exercise 7 Show that every sentence S is equivalent to a sentence M in which no


Boolean connective occurs except the one (called Sheffer’s stroke, or nand) with truth
table
PQ P8Q
TT F
TF T
FT T
FF T
Page 8 BOOLEAN LOGIC

Construct such a normal form M equivalent to the example sentence S considered


earlier. Try to make M as short as possible.

You might also like