# 2.2.4: 2.2.D More rules of Boolean algebra

It is certainly not true that all possible rules of Boolean algebra are given in Figure 2.2. For one thing, there are many rules that are easy consequences of the rules that are listed there. For example, although the table asserts only that $$\mathbb{F} \vee p$$ ≡ p, it is also true that $$p \vee \mathbb{F}$$ ≡ p. This can be checked directly or by a simple calculation:

$$p \vee \mathbf{F} \equiv \mathbf{F} \vee p \qquad$$ Commutative Law

$$\equiv p \qquad$$ Identity        Law as given in the table

Additional rules can be obtained by applying the Commutative Law to other rules in the table, and we will use such rules freely in the future.

Another sort of easy extension can be applied to the Associative Law, (∨ q) ∨ ∨ (∨ r). The law is stated for the ∨ operator applied to three terms, but it generalizes to four or more terms. For example

((∨ q) ∨ r) ∨ s
≡ (∨ q) ∨ (∨ s)        by the Associative Law for three terms

≡ ∨ (∨ (∨ s))        by the Associative Law for three terms

We will, of course, often write this expression as ∨ ∨ ∨ s, with no parentheses at all, knowing that wherever we put the parentheses the value is the same.

One other thing that you should keep in mind is that rules can be applied in either direction. The Distributive Law, for example, allows you to distribute the in p∨(q∧¬p) to get (pq)∧(p∨¬p). But it can also be used in reverse to ‘factor out’ a term, as when you start with (∨ (→ q)) ∧ (∨(→ p)) and factor out the to get ∨ ((→ q) ∧ (→ p)).

So far in this section, we have been working with the laws of Boolean algebra without saying much about what they mean or why they are reasonable. Of course, you can apply the laws in calculations without understanding them. But if you want to figure out which calculations to do, you need some understanding. Most of the laws are clear enough with a little thought. For example, if we already know that is false, then ∨ will be true when is true and false when is false. That is, ∨ F has the same logical value as p. But that’s just what the Identity Law for ∨ says. A few of the laws need more discussion.

The Law of the Excluded Middle, ∨ ¬≡ T, says that given any proposition p, at least one of or ¬must be true. Since ¬is true exactly when is false, this is the same as saying that must be either true or false. There is no middle ground. The Law of Contradiction, ∧ ¬≡ F, says that it is not possible for both and ¬to be true. Both of these rules are obvious.

There are some who set out to question the law of there being no middle ground. Already in the 1920’s people like Tarski (who we will meet later) talked about other forms of logic where another value representing ‘unknown’ or ‘not proven’ also exists. You can also see this in some pro- gramming languages where they are referred to as ‘tri-state booleans’. These so-called non-standard logics have been de- veloped and have also lead to things like ‘fuzzy logic’, which some consider quite controversial. Lotfi Zadeh is credited as the first person to refer to this type of logic as fuzzy logic in his work on ‘fuzzy sets’ in 1965. Zadeh was later quoted as saying: “Not being afraid to get em- broiled in controversy. ... That’s part of my character, too. I can be very stubborn. That’s probably been beneficial for the development of Fuzzy Logic.”

The Distributive Laws cannot be called obvious, but a few examples can show that they are reasonable. Consider the statement, “This card is the ace of spades or clubs.” Clearly, this is equivalent to “This card is the ace of spaces or this card is the ace of clubs.” But this is just an example of the first distributive law! For, let represent the proposition

“This card is an ace”, let represent “This card is a spade” and let represent “This card is a club”. Then “This card is the ace of spades or clubs” can be translated into logic asa ∧ (∨ c), while “This card is the ace of spades or this card is the ace of clubs” becomes(∧ s) ∨ (∧ c). And the distributive law assures us that ∧ (∨ c) ≡ (∧ s) ∨ (∧ c). The second distributive law tells us, for example, that “This card is either a joker or is the ten of diamonds” is logically equivalent to “This card is either a joker or a ten, and it is eitherajokeroradiamond”. That is, j∨(td) ≡ (jt)∧(jd). The distributive laws are powerful tools and you should keep them in mind whenever you are faced with a mixture of ∧ and ∨ operators.

DeMorgan’s Laws must also be less than obvious, since people often get them wrong. Fortunately you get to practice them both in Reasoning & Logic, as well as in Computer Organisation, so you will soon get them right. More importantly perhaps they do also make sense. When considering ¬(∧ q), you should ask yourself, how can “and q” failto be true. It will fail to be true if either is false or if is false (or both). That is, ¬(∧ q)is equivalent to (¬p) ∨ (¬q). Consider the sentence “A raven is large and black.” If a bird is not large and black, then it is not a raven. But what exactly does it mean to be “not (large and black)”? How can you tell whether the assertion “not (large and black)” is true of something? This will be true if it is either not large or not black. (It doesn’t have to be both—it could be large and white, it could be small and black.) Similarly, for “or q” to fail to be true, both and must be false. That is, ¬(∨ q) is equivalent to (¬p) ∧ (¬q). This is DeMorgan’s second law.

Recalling that → is equivalent to (¬p) ∨ q, we can apply DeMorgan’s law to obtain a formula for the negation an implication:

¬(→ q) ≡ ¬((¬p)∨q)
≡ (¬(¬p)) ∧ (¬q)

≡ ∧ ¬q

That is, → is false exactly when both is true and is false. For example, the negation of “If you have an ace, you win” is “You have an ace, and you don’t win”. Think of it this way: if you had an ace and you didn’t win, then the statement “If you have an ace, you win” was not true.

Exercises

1. Construct truth tables to demonstrate the validity of each of the distributive laws.

2. Construct the following truth tables:
a) Construct truth tables to demonstrate that ¬(∧ q) is not logically equivalent to (¬p) ∧

q).
b) Construct truth tables to demonstrate that ¬(∨ q) is not logically equivalent to (¬p) ∨

q).
c) Construct truth tables to demonstrate the validity of both DeMorgan’s Laws.

3. Construct truth tables to demonstrate that ¬(→ q) is not logically equivalent to any of the following.

a) (¬p) → (¬q)b) (¬p) → q

c) → (¬q)
Refer back to this section for a formula that is logically equivalent to ¬(→ q).

4. Is ¬(↔ q) logically equivalent to (¬p) ↔ (¬q)?

5. In the algebra of numbers, there is a distributive law of multiplication over addition: x(z) =xy xz. What would a distributive law of addition over multiplication look like? Is it a valid law in the algebra of numbers?

6. The distributive laws given in Figure 2.2 are sometimes called the left distributive laws. Theright distributive laws say that (∨ q) ∧ ≡ (∧ r) ∨ (∧ r) and that (∧ q) ∨ ≡ (∨ r) ∧(∨ r). Show that the right distributive laws are also valid laws of Boolean algebra. (Note: In practice, both the left and the right distributive laws are referred to simply as the distributive laws, and both can be used freely in proofs.)

7.Show that p∧(qrs)≡(pq)∨(pr)∨(ps) for any propositions p,q,r, and s. In words, we can say that conjunction distributes over a disjunction of three terms. (Recall that the ∧ operator is called conjunction and ∨ is called disjunction.) Translate into logic and verify the fact that conjunction distributes over a disjunction of four terms. Argue that, in fact, con- junction distributes over a disjunction of any number of terms.

1. There are two additional basic laws of logic, involving the two expression ∧ F and ∨ T. What are the missing laws? Show that your answers are, in fact, laws.

2. For each of the following pairs of propositions, show that the two propositions are logically equivalent by finding a chain of equivalences from one to the other. State which definition or law of logic justifies each equivalence in the chain.

3. For each of the following compound propositions, find a simpler proposition that is logically equivalent. Try to find a proposition that is as simple as possible.

a) (∧ q) ∨ ¬b) ¬(∨ q) ∧ c) → ¬p
d) ¬∧ (∨ q) e) (∧ p) → f) (→ q) ∧ (¬→ q)

4. Express the negation of each of the following sentences in natural English:a) It is sunny and cold.

b) I will have stroopwafel or I will have appeltaart.c) If today is Tuesday, this is Belgium.

d) If you pass the final exam, you pass the course.

5. Apply one of the laws of logic to each of the following sentences, and rewrite it as an equivalent sentence. State which law you are applying.

a) I will have coffee and stroopwafel or appeltaart.b) He has neither talent nor ambition.

c) You can have oliebollen, or you can have oliebollen.

6. Suppose it is simultaneously true that “All lemons are yellow” and “Not all lemons are yellow”. Derive the conclusion “Unicorns exist”. (If you get stuck, check out en.wikipedia.org/wiki/ Principle_of_explosion.)