Chapter 23 - Logic Applications (With Answers)
Chapter 23 - Logic Applications (With Answers)
Chapter 23
Logic and algebra
Objectives
To understand the Boolean operations ∨, ∧, and the axioms of Boolean algebra.
To understand and apply the concepts of proposition and truth value.
To construct truth tables for compound statements and to recognise tautologies.
To represent circuits using logic gates.
To use Karnaugh maps to simplify Boolean expressions.
The words ‘or’, ‘and’, ‘not’, ‘true’ and ‘false’ are central to this chapter. You may have
already met these words in your studies of sets, probability and proofs. In this chapter, these
ideas are brought together in a formal way as Boolean algebra.
In Chapter 2, we looked at sets and operations on sets, including union ∪, intersection ∩ and
complementation . This chapter begins by studying these operations on the set of all subsets
of a given set. We have seen in Chapter 5 that, if a finite set has n elements, then there are
2n subsets. Such structures are examples of Boolean algebras.
We will see that the ideas of Boolean algebra flow through into a formal study of logic.
Some of the concepts introduced in Chapter 6 will reappear in this chapter, including
negation, De Morgan’s laws, implication, converse and contrapositive.
Early work in logic was carried out by George Boole (1815–1864) in his book An
Investigation of the Laws of Thought, published in 1854. His aims in the book were to
. . . investigate the fundamental laws of those operations of the mind by which
reasoning is performed; to give expression to them in the symbolical language
of a Calculus, and upon this foundation to establish the science of Logic and
construct its method.
The ideas of Boolean algebra were first applied to electronic circuits in the 1930s, by Claude
Shannon (1916–2001). Today, Boolean algebra forms the foundation of computer science,
and is central to electronics and programming. You can use Boolean logic when you submit a
query to a search engine, such as Google or Yahoo.
In this chapter, you will see how these ideas can be extended and applied in analogous
situations. We begin by looking at the ‘structure’ of the set of all subsets of a set.
Algebra of sets
For A, B, C ⊆ ξ, the following are true:
Primary A∪A= A A∩A= A
A∪∅= A A∩ξ= A
A∪ξ=ξ A∩∅=∅
Associativity (A ∪ B) ∪ C = A ∪ (B ∪ C) (A ∩ B) ∩ C = A ∩ (B ∩ C)
Distributivity A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Absorption A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A
Complements A ∪ A = ξ A ∩ A = ∅
∅ = ξ ξ = ∅
(A ∪ B) = A ∩ B (A ∩ B) = A ∪ B
(A ) = A
You may notice that some of these laws are similar to laws of arithmetic involving +, ×,
0 and 1. For example, the laws A ∪ ∅ = A and A ∩ ξ = A are analogous to the arithmetic
statements a + 0 = a and a × 1 = a.
You may also notice that all but one of these laws occurs as a member of a pair. The two laws
in each pair are called dual statements.
Dual statements
For a given statement about sets, the dual statement is obtained by interchanging:
∪ with ∩, ∅ with ξ, ⊆ with ⊇
In the following example, we show a method for proving a result about sets. We also show
how to illustrate the result with a Venn diagram. But note that drawing a Venn diagram is not
a proof, just as in geometry drawing a diagram is not a proof.
Example 1
a Illustrate (A ∪ B) = A ∩ B with Venn diagrams.
b Prove that (A ∪ B) = A ∩ B .
Solution
a Note: Required regions are shaded.
We first draw the diagram for (A ∪ B) .
(A ∪ B)
A B
A B A ∩ B
A B A B A B
Example 2
Write the dual of (A ∩ B ) ∩ B = ∅.
Solution
(A ∪ B ) ∪ B = ξ
Light switches
Claude Shannon was first to realise that the ideas of logic could be applied to electronic
circuits. ‘On’ and ‘off’ can be used in a way analogous to ‘true’ and ‘false’. In this chapter,
we follow the opposite path. We first introduce switching circuits, and then see in the next
section how they can be interpreted using Boolean algebra.
Switches in parallel
The following diagram shows two switches x and y in parallel. If at least one of the switches
is closed, then current flows and the light is on. In this case, we say that the system is closed.
The four possible situations for two switches in parallel are summarised in the table.
Switches in series
The following diagram shows two switches x and y in series. If both switches are closed,
then current flows and the light is on. In this case, we say that the system is closed.
The four possible situations for two switches in series are summarised in the table.
Complementary switches x x
The complement switch x is always in the opposite state to x. open closed
closed open
New notation
We now introduce a new notation that will be used throughout this chapter in several different
contexts.
Use 0 for open.
Use 1 for closed.
Use the notation x ∨ y, read as ‘x or y’, for two switches x and y connected in parallel.
Use the notation x ∧ y, read as ‘x and y’, for two switches x and y connected in series.
Use x for the complement of x.
We repeat the three tables above with the new notation.
We now have three operations ∨, ∧ and acting on the set {0, 1}.
Note: The operations ∨ and ∧ are analogous to union ∪ and intersection ∩. For this reason,
the symbols ∨ and ∧ are also read as ‘join’ and ‘meet’.
This new notation allows us to represent more complicated switching circuits. You will see
the notation used again in the next section in a more general context.
Example 3
Consider the expression
(x ∧ y) ∨ (z ∧ x )
a Draw the switching circuit that is represented by this expression.
b Give the table with entries 0s and 1s describing the operation of this circuit.
Solution
a x y
z x′
b For three variables x, y and z, there are 23 = 8 possible combinations of 0s and 1s.
This gives the first three columns of the table. To find the value of (x ∧ y) ∨ (z ∧ x ) in
each case, we start by finding the values of the simpler expressions x ∧ y and z ∧ x .
x y z x x∧y z ∧ x (x ∧ y) ∨ (z ∧ x )
0 0 0 1 0 0 0
0 0 1 1 0 1 1
0 1 0 1 0 0 0
0 1 1 1 0 1 1
1 0 0 0 0 0 0
1 0 1 0 0 0 0
1 1 0 0 1 0 1
1 1 1 0 1 0 1
Exercise 23A
Axiom 2 (x ∨ y) ∨ z = x ∨ (y ∨ z) (∨ is associative)
(x ∧ y) ∧ z = x ∧ (y ∧ z) (∧ is associative)
Axiom 5 x ∨ x = 1 ( is complementation)
x ∧ x = 0
Given these rules, we can prove new results, as shown in the following example.
Example 4
Prove that, for each Boolean algebra B and all x, y, z ∈ B:
a x∨1=1
b x∧0=0
c If x ∨ z = 1 and x ∧ z = 0, then z = x .
d (x ∨ y) = x ∧ y
Solution
a x ∨ 1 = (x ∨ 1) ∧ 1 (axiom 4)
= (x ∨ 1) ∧ (x ∨ x ) (axiom 5)
= x ∨ (1 ∧ x ) (axiom 3)
= x ∨ (x ∧ 1) (axiom 1)
= x∨x (axiom 4)
=1 (axiom 5)
b x ∧ 0 = (x ∧ 0) ∨ 0 (axiom 4)
= (x ∧ 0) ∨ (x ∧ x ) (axiom 5)
= x ∧ (0 ∨ x ) (axiom 3)
= x ∧ (x ∨ 0) (axiom 1)
= x ∧ x (axiom 4)
=0 (axiom 5)
Note: Part b is the dual of part a.
The set of all subsets of a set is a Boolean algebra with the operations ∪, ∩, and the identity
elements ∅, ξ. All the laws for sets given in Section 23A have parallel results for Boolean
algebras in general. Some are axioms, and the others can be proved from the axioms (see
Example 4 and Exercise 23B).
Associativity (A2) (x ∨ y) ∨ z = x ∨ (y ∨ z) (x ∧ y) ∧ z = x ∧ (y ∧ z)
Distributivity (A3) x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z)
Absorption x ∨ (x ∧ y) = x x ∧ (x ∨ y) = x
Note: The properties (x ∨ y) = x ∧ y and (x ∧ y) = x ∨ y are called De Morgan’s laws.
You have seen them used in the context of logic in Section 6B.
Example 5
Give the table of values for the Boolean function f (x, y) = (x ∧ y) ∨ y .
Solution
x y y x∧y f (x, y) = (x ∧ y) ∨ y
0 0 1 0 1
0 1 0 0 0
1 0 1 0 1
1 1 0 1 1
The next example shows how to find a Boolean expression for a Boolean function given in
table form. We don’t give a formal proof, but you can easily verify the result by forming the
table of values. In Section 23D, we will see the importance of this process in electronics.
Example 6
Find a Boolean expression for the Boolean function given by the following table.
x y z f (x, y, z)
1 0 0 0 0
2 0 0 1 0
3 0 1 0 1
4 0 1 1 0
5 1 0 0 1
6 1 0 1 0
7 1 1 0 1
8 1 1 1 1
Solution
We look at the rows where a 1 occurs in the rightmost column: rows 3, 5, 7 and 8.
Each row corresponds to some combination using ∧ of either x or x , either y or y , and
either z or z .
For example, row 3 corresponds to x ∧ y ∧ z . We use x for a 1-entry in the x-column and
use x for a 0-entry. The same rule is followed for the y- and z-columns.
Row 3 x ∧ y ∧ z
Row 5 x ∧ y ∧ z
Row 7 x ∧ y ∧ z
Row 8 x ∧ y ∧ z
Now combine these terms using ∨. We obtain the Boolean expression
(x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z)
We can write the Boolean function as
f (x, y, z) = (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z)
Notes:
We will see in Example 20 that this expression simplifies to (x ∧ y) ∨ (x ∧ z ) ∨ (y ∧ z ).
It follows from the associativity of ∨ and ∧ that we can write expressions such as x ∧ y ∧ z
and a ∨ b ∨ c ∨ d unambiguously without using brackets.
Two Boolean expressions are equivalent if they represent the same Boolean function.
If two Boolean expressions represent the same Boolean function, then it is possible to derive
one expression from the other using the axioms of Boolean algebras.
Example 7
Consider the two Boolean expressions
(x ∨ y) ∧ (x ∨ y) ∨ x and x ∨ y
Show that these two expressions are equivalent by:
a showing that they represent the same Boolean function
b using the axioms and properties of Boolean algebras.
Solution
a x y x∨y x x ∨ y (x ∨ y) ∧ (x ∨ y) ((x ∨ y) ∧ (x ∨ y)) ∨ x
0 0 0 1 1 0 0
0 1 1 1 1 1 1
1 0 1 0 0 0 1
1 1 1 0 1 1 1
Columns 3 and 7 of the table are the same, and therefore the two expressions determine
the same Boolean function.
b (x ∨ y) ∧ (x ∨ y) ∨ x = (y ∨ x) ∧ (y ∨ x ) ∨ x (axiom 1)
= y ∨ (x ∧ x ) ∨ x (axiom 3)
= (y ∨ 0) ∨ x (axiom 5)
=y∨x (axiom 4)
= x∨y (axiom 1)
Exercise 23B
Example 4 1 Prove each of the following, where x and y are elements of a Boolean algebra B:
a x∧x= x b x∨x= x c (x ) = x
d x = (x ∧ y) ∨ (x ∧ y ) e x ∨ (x ∧ y) = x
Example 5 3 For each of the following Boolean functions, produce a table of values:
a f (x, y) = (x ∧ y ) ∧ (x ∧ y )
b f (x, y, z) = (x ∨ y) ∧ (y ∨ z) ∧ (z ∨ x)
4 Draw a switching circuit for each of the following expressions. Try to simplify your
circuit by first simplifying the expression using the properties of Boolean algebras.
a (x ∧ y ) ∨ (x ∧ y )
b (x ∧ y) ∨ (x ∧ y ) ∨ (x ∧ y) ∨ (x ∧ y )
Example 6 5 For each of the following, find a Boolean expression for the given Boolean function:
a x y f (x, y) b x y z f (x, y, z)
0 0 1 0 0 0 1
0 1 1 0 0 1 1
1 0 0 0 1 0 0
1 1 1 0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 0
Example 7 6 Show that the expressions (x ∨ y) ∧ (x ∨ y ) and (x ∧ y) ∨ (x ∧ y ) are equivalent by:
a showing that they represent the same Boolean function
b using the axioms and properties of Boolean algebras.
And
Truth table for ‘and’
The symbol ∧ is used for ‘and’. G H G∧H
The statement G ∧ H is ‘n is odd and n > 10’.
T T T
The statement G ∧ H is known as the conjunction of G and H. T F F
If both statements are true, then the compound statement is true.
F T F
If either or both are false, then the compound statement is false.
This can be shown conveniently in a truth table. F F F
Not
Truth table for ‘not’
The symbol ¬ is used for ‘not’.
A ¬A
The statement ¬G is ‘n is even’.
T F
The statement ¬H is ‘n ≤ 10’.
F T
In general, the statement ¬A is called the negation of A and
has the opposite truth value to A.
Note: The negation operation ¬ corresponds to complementation in Boolean algebra. But in
propositional logic, it is common to use the notation ¬A instead of A .
G H ¬G ¬H ¬G ∧ ¬H
T T F F F
T F F T F
F T T F F
F F T T T
Example 8
Write the truth table for ¬(A ∨ B).
Solution
The truth values for the simpler statement A ∨ B are found first.
A B A∨B ¬(A ∨ B)
T T T F
T F T F
F T T F
F F F T
Example 9
Write the truth table for A ∧ B ∧ (¬A).
Solution
A B A∧B ¬A A ∧ B ∧ (¬A)
T T T F F
T F F F F
F T F T F
F F F T F
Two statements that have the same truth values are logically equivalent.
Example 10
Show that ¬(A ∧ B) is logically equivalent to ¬A ∨ ¬B.
Solution
A B ¬A ¬B A∧B ¬(A ∧ B) ¬A ∨ ¬B
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T
The truth values for ¬(A ∧ B) and ¬A ∨ ¬B are the same, so the statements are equivalent.
Example 11
Show that (¬A) ∨ (A ∨ B) is a tautology.
Solution
A B ¬A A∨B (¬A) ∨ (A ∨ B)
T T F T T
T F F T T
F T T T T
F F T F T
Example 12
Show that (A ∨ B) ∧ (¬A ∧ ¬B) is a contradiction.
Solution
Implication
We now consider another logical connective, called implication.
For statements A and B, we can form the compound statement Truth table for ‘implies’
A ⇒ B, which is read as ‘A implies B’ or as ‘If A, then B’.
A B A⇒B
The truth table for ⇒ is shown on the right. T T T
It is useful to consider whether this truth table is consistent with a T F F
‘common sense’ view of implication. F T T
Let A be the statement ‘I am elected’. F F T
Let B be the statement ‘I will make public transport free’.
Therefore A ⇒ B is the statement ‘If I am elected, then I will make public transport free’.
Now consider each row of the truth table:
Row 1 I am elected (A is true) and public transport is made free (B is true). I have kept
my election promise. The statement A ⇒ B is true.
Row 2 I am elected (A is true) but public transport is not made free (B is false). I have
broken my election promise. The statement A ⇒ B is false.
Rows 3 & 4 I am not elected (A is false). Whether or not public transport is made free, I have
not broken my promise, as I was not elected. The statement A ⇒ B is true.
Note that the only possible way that A ⇒ B could be false is if I am elected but do not make
public transport free. Otherwise, the statement is not false, and therefore must be true.
Example 13
Give the truth table for B ⇒ (A ∧ ¬B).
Solution
A B ¬B A ∧ ¬B B ⇒ (A ∧ ¬B)
T T F F F
T F T T T
F T F F F
F F T F T
Example 14
Give the truth table for [(A ∨ B) ∧ ¬B] ⇒ A.
Solution
Equivalence
Truth table for equivalence
Another logical connective is equivalence, which is
A B A⇔B
represented by the symbol ⇔. It has the truth table shown.
T T T
You can check using truth tables that the statement A ⇔ B
T F F
is logically equivalent to (A ⇒ B) ∧ (B ⇒ A) and also to
(A ∧ B) ∨ (¬A ∧ ¬B). F T F
F F T
Example 15
Give the truth table for (¬A ∨ ¬B) ⇔ ¬(A ∧ B).
Solution
Note: It can be seen that this is a tautology. The two statements ¬A ∨ ¬B and ¬(A ∧ B) are
logically equivalent.
Note: Using truth tables, you can check that a statement A ⇒ B is equivalent to its
contrapositive ¬B ⇒ ¬A, but is not equivalent to its converse B ⇒ A.
Deductions
We can use truth tables to check the validity of logical deductions.
Example 16
Use truth tables to investigate the validity of each of the following deductions:
a All kangaroos jump. Jumping needs strength. So kangaroos need strength.
b In March, there are strong winds every day. The wind is not strong today. Therefore it
is not March.
c On Mondays I go swimming. Today is not Monday. Therefore I do not swim today.
Solution
a Let A be the statement ‘It is a kangaroo’.
Let B be the statement ‘It jumps’.
Let C be the statement ‘It needs strength’.
The compound statement to be considered is
(A ⇒ B) ∧ (B ⇒ C) ⇒ (A ⇒ C)
A B C A ⇒ B B ⇒ C A ⇒ C (A ⇒ B) ∧ (B ⇒ C) [(A ⇒ B) ∧ (B ⇒ C)] ⇒ (A ⇒ C)
T T T T T T T T
T T F T F F F T
T F T F T T F T
T F F F T F F T
F T T T T T T T
F T F T F T F T
F F T T T T T T
F F F T T T T T
The deduction is not valid. It fails to be true when M is false and S is true.
Here is a list of some useful tautologies that can be used to form valid deductions:
1 [(A ⇒ B) ∧ (B ⇒ C)] ⇒ (A ⇒ C)
2 [(A ⇒ B) ∧ A] ⇒ B
3 [(A ⇒ B) ∧ (¬B)] ⇒ ¬A
4 [(A ∨ B) ∧ (¬A)] ⇒ B
5 (A ⇒ B) ⇔ (¬B ⇒ ¬A) (contrapositive)
6 ¬(A ∨ B) ⇔ (¬A ∧ ¬B) (De Morgan’s law)
7 ¬(A ∧ B) ⇔ (¬A ∨ ¬B) (De Morgan’s law)
We have seen the first and third of these tautologies used in Example 16. Others will be
considered in Exercise 23C. Here is an example for the second tautology:
If it is Tuesday, then the flight arrives at 10 a.m. It is Tuesday. Therefore the
flight arrives at 10 a.m.
Exercise 23C
1 For each statement (P), write down its negation (¬P):
a Your eyes are blue. b The sky is grey. c This integer is odd.
d I live in Switzerland. e x>2 f This number is less than 100.
Example 10 6 Show that each of the following pairs of statements are equivalent:
a ¬(A ∨ B) ¬A ∧ ¬B b ¬(¬A) A
c A∨A A d A∨B ¬(¬A ∧ ¬B)
e A∧B ¬(¬A ∨ ¬B) f A ∧ ¬B ¬(¬A ∨ B)
Example 12 7 Show that (A ∧ B) ∧ (¬B) is a contradiction.
Example 13, 14 10 Give a truth table for each of the following statements:
a (A ∧ B) ⇒ A b (A ∨ B) ⇒ A c (¬B ∨ ¬A) ⇒ A
d (¬B ∧ A) ⇒ A e (B ∨ ¬A) ⇒ ¬A f (¬B ∨ ¬A) ⇒ (¬B ∧ A)
g (¬B ∨ A) ⇒ ¬(B ∧ A) h ¬B ∧ (¬B ⇒ A)
Example 15 13 Show that ¬(P ∨ Q) ⇔ (¬P ∧ ¬Q) is a tautology. Give the corresponding result for
sets A and B, and illustrate with a Venn diagram.
A B A∨B A B A∧B A ¬A
0 0 0 0 0 0 0 1
0 1 1 0 1 0 1 0
1 0 1 1 0 0
1 1 1 1 1 1
These correspond to the logical operations ‘or’, ‘and’ and ‘not’ if we interpret 0 as ‘false’ and
1 as ‘true’. In a circuit, we interpret 0 as ‘low voltage’ and 1 as ‘high voltage’.
Logic gates
We will create circuits using the following three logic gates, which carry out the operations
of ‘or’ (∨), ‘and’ (∧) and ‘not’ (¬).
Each gate is shown with the inputs on the left and the output on the right. For example, if an
‘or’ gate has inputs 0 and 1, then the output will be 1.
We can build a logic circuit to represent any Boolean expression.
Example 17
Give the gate representation of the Boolean expression (A ∧ B) ∨ C.
Solution
Note: The inputs to this circuit are labelled A, B and C. The output of the circuit will
reflect the state of these inputs according to the logic statement (A ∧ B) ∨ C.
Example 18
a Give the gate representation of the Boolean expression A ∨ (¬A ∧ B).
b Describe the operation of this circuit through a truth table.
Solution
a A
A
¬A ∧ B
A ¬A
B
B
b A B ¬A ¬A ∧ B A ∨ (¬A ∧ B)
0 0 1 0 0
0 1 1 1 1
1 0 0 0 1
1 1 0 0 1
Given any truth table that specifies the required operation of a circuit, it is possible to
build an appropriate circuit using ‘or’, ‘and’ and ‘not’ gates.
Exercise 23D
Example 17, 18 1 Draw a circuit using logic gates for each of the following:
a A ∧ (¬B) b ¬(A ∨ B) c ¬(¬P ∧ Q) ∨ R
d A ∧ (¬B ∨ A) e (¬A ∨ B) ∧ (¬B ∨ A) f (¬A ∧ B) ∨ (B ∧ ¬C) ∨ A
2 For each of the following, give a Boolean expression that represents the circuit and give
a truth table describing the operation of the circuit:
a b
X A
Y B
c A
Minimal representation
We start by formalising what it means for a Boolean expression to be ‘simplified’.
A minimal representation of a Boolean function f is a Boolean expression E which
represents f and satisfies the following:
The expression E has the form E1 ∨ E2 ∨ · · · ∨ En , where each Ei is an expression such as
x ∧ y or x ∧ y ∧ z or y ∧ z .
If F is any other expression of this form which also represents f , then the number of
terms Fi is greater than or equal to the number of terms Ei .
If F and E have the same number of terms, then the number of variables in F is greater
than or equal to the number of variables in E.
x y f (x, y)
0 0 1 x ∧ y
0 1 1 x ∧ y
1 0 0 x ∧ y
1 1 1 x∧y
As in Example 6, each row of the truth table corresponds to some combination using ∧ of
either x or x , and either y or y . This is shown to the right of the truth table above. Using this
correspondence, we fill the values of f (x, y) into the following 2 × 2 table.
y y′
x 1 0
x′ 1 1
y y′
x 1 0
x′ 1 1
We could have used the original expression (x ∧ y ) ∨ (x ∧ y) ∨ (x ∧ y) to fill in the Karnaugh
map directly, by putting a 1 for each of the terms x ∧ y , x ∧ y and x ∧ y in the expression. A
Boolean expression must be of a form like this to enter directly into a Karnaugh map.
Example 19
Simplify (x ∧ y) ∨ (x ∧ y ) ∨ (x ∧ y).
Solution Explanation
Step 1 We can fill the 1s into the Karnaugh map directly from
y y′
the expression. It is not necessary to add the 0s.
x 1 1
x′ 1
x 1 1
x′ 1
Step 3 Block labels: Now read off the labels of the coloured blocks:
Red x The common label for the 1s in the red block is x.
Green y The common label for the 1s in the green block is y.
Together x ∨ y Combine the block labels using ∨.
The simplified expression
is x ∨ y.
x′
Notes:
The order of the labels yz, y z, y z , yz along the top is important. There is only one
change from one label to the next.
You need to imagine that this Karnaugh map is wrapped around into a cylinder so that the
xyz and xyz cells are adjacent and the x yz and x yz cells are adjacent.
The technique for three variables is similar to that for two variables. We use the truth table or
the expression to fill the 1s into the Karnaugh map. Then we cover the 1s using blocks.
x 1 1 x 1 1 1 x 1 1
x′ 1 1 x′ 1 1 1 x′ 1 1
x 1 1 x 1 1 1 x 1 1
x′ 1 1 x′ 1 1 1 x′ 1 1
Example 20
Simplify (x ∧ y ∧ z) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z ).
Solution Explanation
In this example, the blue shading shows a
yz y′z y′z′ yz′
1 × 2 block that wraps around the back of
x 1 1 1 the ‘cylinder’.
x′ 1
Labels of the coloured blocks: The common labels for the 1s in the red
Red x ∧ z block are x and z . So the label of the red
Green y ∧ z block is x ∧ z .
Blue x ∧ y We find the other labels similarly, and
The simplified expression is combine the block labels using ∨.
(x ∧ y) ∨ (x ∧ z ) ∨ (y ∧ z )
Example 21
Write a minimal Boolean expression for the following truth table.
x y z f (x, y, z)
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 0
Solution Explanation
We first fill the 1s from the rightmost column of the
yz y′z y′z′ yz′
truth table into the Karnaugh map.
x 1 1
For example, row 1 of the truth table corresponds to
x′ 1 1 1 x ∧ y ∧ z and thus to the x y z cell.
Note: A Boolean function can have more than one minimal expression. There can be
different correct ways to choose the blocks on a Karnaugh map.
Exercise 23E
Review
Chapter summary
Boolean algebra
Basic examples of Boolean algebras:
• the set of all subsets of a set with the operations ∪, ∩ and
• the set {0, 1} with the operations ∨, ∧ and .
x y x∨y x y x∧y x x
0 0 0 0 0 0 0 1
0 1 1 0 1 0 1 0
1 0 1 1 0 0
1 1 1 1 1 1
Logical connectives
Or And Not
A B A∨B A B A∧B A ¬A
T T T T T T T F
T F T T F F F T
F T T F T F
F F F F F F
Implies Equivalence
A B A⇒B A B A⇔B
T T T T T T
T F F T F F
F T T F T F
F F T F F T
Two statements are logically equivalent if they have the same truth values.
A tautology is a statement which is true under all circumstances.
A contradiction is a statement which is false under all circumstances.
The converse of A ⇒ B is the statement B ⇒ A.
The contrapositive of A ⇒ B is the statement ¬B ⇒ ¬A.
Logic circuits
‘Or’ gate (∨) ‘And’ gate (∧) ‘Not’ gate (¬)
Short-answer questions
1 Which of the following statements are true?
√
a 2 is rational. b π is not irrational.
√ √
c 2 is rational and π is irrational. d 2 is rational or π is irrational.
√ √
e If 2 is rational, then π is irrational. f If π is irrational, then 2 is rational.
3 The logical connective ‘exclusive or’ is denoted by ⊕. Truth table for ‘exclusive or’
The statement A ⊕ B is true when either A or B is true,
A B A⊕B
but not both. The truth table for ⊕ is shown on the right.
T T F
Construct a truth table for each of the following
T F T
compound statements:
F T T
a A ⊕ (A ⊕ B)
b A ⊕ (A ∨ B) F F F
5 For each pair of Boolean expressions, prove that the two expressions are equivalent by:
i showing that they represent the same Boolean function on {0, 1}
ii using the axioms and properties of Boolean algebras.
a x ∨ (x ∧ y) and x ∨ y b (x ∨ y) ∧ (x ∨ y) and y
Multiple-choice questions
1 The blue region of the Venn diagram is
A B B A ∪ B C A ∩ B
D A ∩ B E A ∪ B
A B
Review
2
A B ∩ (B ∪ A) = ∅ B A ∪ (A ∩ B) = ∅ C A ∪ (A ∩ B) = ξ
D A ∩ (A ∪ B ) = ξ E A ∩ (A ∪ B) = ξ
For Questions 6 and 7, let P be the statement ‘I will pass Specialist Mathematics’ and
let S be the statement ‘I study hard’.
6 Which of the following corresponds to the statement ‘If I study hard, then I will pass
Specialist Mathematics’?
A S ⇔P B S ∨P C P⇒S D S ⇒P E S ∧P
7 Which of the following is not equivalent to the statement ‘I will not pass Specialist
Mathematics unless I study hard’?
A P⇒S B ¬P ∨ S C ¬S ⇒ ¬P D S ∨ ¬P E P∧S
Extended-response questions
1 A light in a stairwell is controlled by two switches: one at the bottom of the stairs and
one at the top. If both switches are off, then the light should be off. If either of the
switches changes state, then the light should change state. In this question, we will
create a switching circuit to represent such a two-way switch.
a Use x and y to denote the two switches. Use 0 for ‘off’ x y Light
and 1 for ‘on’. Complete the table on the right so that it
0 0 0
describes the operation of the circuit.
0 1
b Based on your table for part a, write down a Boolean
expression that represents the circuit. 1 0
c Draw the switching circuit that is represented by your 1 1
Boolean expression from part b.
x 1 2 3 5 6 10 15 30
x
LCM(x, x )
HCF(x, x )
Note: Can you see what is special about the number 30 here? Consider its prime
factorisation. What goes wrong if you try using the number 12 instead?
Review
3 A committee with three members reaches its decisions by using a voting machine.
The machine has three switches (x, y, z); one for each member of the committee. If
at least two of the three members vote ‘yes’ (1), then the machine’s light goes on (1).
Otherwise, the light is off (0).
a Construct a table with entries 0s and 1s that describes the operation of the voting
machine.
b Give a Boolean expression for the voting machine, based on your table for part a.
c Use a Karnaugh map to simplify the Boolean expression obtained in part b.
d Draw a circuit for the voting machine using logic gates, based on your simplified
Boolean expression from part c.
4 Ternary logic In Boolean logic, there are two truth values: true (1) and false (0).
In ternary logic, there are three truth values: true (1), false (0) and don’t know (d).
The basic example of a ternary algebra is the set {0, d, 1} with the operations ∨, ∧ and
given by the following tables.
Or (∨) And (∧) Not ( )
∨ 0 d 1 ∧ 0 d 1 x x
0 0 d 1 0 0 0 0 0 1
d d d 1 d 0 d d d d
1 1 1 1 1 0 d 1 1 0
Note that d = d, since if we don’t know whether a statement is true, then we don’t
know whether its negation is true. Ternary logic has applications in electronic
engineering and database query languages.
a Evaluate each of the following:
i d∨0 ii (d ∧ 0) iii (d ∨ 0) ∧ (d ∨ 1)
b Give counterexamples to show that the laws x ∨ x = 1 and x ∧ x = 0 for Boolean
algebras do not hold for the ternary algebra {0, d, 1}.
c Prove that the De Morgan law (x ∨ y) = x ∧ y holds for the ternary algebra {0, d, 1}.
Hint: Construct a truth table to show that (x ∨ y) and x ∧ y represent the same
function on {0, d, 1}. Since there are two variables, each with three possible
values, the truth table will have 3 × 3 = 9 rows.
Answers
Extended-response questions ii x y z y ∨ z x ∧ (y ∨ z)
1 a p a b 0 0 0 0 0
0.1 0.03 0.17 0 0 1 1 0
0.2 0.11 0.29 0 1 0 1 0
0.3 0.19 0.41 0 1 1 1 0
0.4 0.29 0.51 1 0 0 0 0
0.5 0.38 0.62 1 0 1 1 1
0.6 0.49 0.71 1 1 0 1 1
b i p̂ = 0.34 ii p = 0.3 or p = 0.4 1 1 1 1 1
23A → 23B
2 a iii mean ≈ 50, s.d. ≈ 1.12
b iii mean ≈ 50, s.d. ≈ 0.71 d i x y
c iii mean ≈ 50, s.d. ≈ 0.50
Chapter 23 y′ z
ii x y z a= x∨y
b=y∨z a∧b
Exercise 23A 0 0 0 1 0 0
3 a (A ∩ ∅) ∪ (A ∪ ξ) = ξ 0 0 1 1 1 1
b If A ∪ B = ξ, then A ∩ B = A . 0 1 0 0 1 0
c A∪B⊇ A∩B 0 1 1 0 1 0
4 a i x y 1 0 0 1 0 0
1 0 1 1 1 1
1 1 0 1 1 1
z 1 1 1 1 1 1
ii x y z x ∧ y (x ∧ y) ∨ z 5 a x y
0 0 0 0 0
0 0 1 0 1 z
0 1 0 0 0
0 1 1 0 1
y′
1 0 0 0 0
1 0 1 0 1 x
1 1 0 1 1 b x y z a = x ∧ y b = (z ∨ x) ∧ y a ∨ b
1 1 1 1 1
0 0 0 0 0 0
b i 0 0 1 0 1 1
y
0 1 0 0 0 0
0 1 1 0 0 0
x y
1 0 0 0 1 1
x 1 0 1 0 1 1
ii x 1 1 0 1 0 1
y x ∨ y x ∧ y (x ∨ y) ∧ (x ∧ y)
1 1 1 1 0 1
0 0 0 0 0
0 1 1 0 0
Exercise 23B
1 0 1 0 0
1 1 1 1 1 3 a x y y x ∧ y f (x, y)
0 0 1 0 0
c i z 0 1 0 0 0
1 0 1 1 1
x 1 1 0 0 0
Cambridge Senior Maths AC ISBN 978-1-316-63608-4 © Evans et al. 2017 Cambridge University Press
Specialist Mathematics Year 11 Photocopying is restricted under law and this material must not be transferred to another party.
718 Answers
23C
b x y z x ∨ y y ∨ z z ∨ x f (x, y, z) 6 a A B ¬(A ∨ B) ¬A ∧ ¬B
0 0 0 0 0 0 0 T T F F
0 0 1 0 1 1 0 T F F F
0 1 0 1 1 0 0 F T F F
Answers
0 1 1 1 1 1 1 F F T T
1 0 0 1 0 1 0 b A ¬(¬A)
1 0 1 1 1 1 1
T T
1 1 0 1 1 1 1
F F
1 1 1 1 1 1 1
c A A∨A
4 a (x ∧ y ) ∨ (x ∧ y ) = y ∧ (x ∨ x )
T T
= y ∧ 1
F F
= y
d A B A ∨ B ¬(¬A ∧ ¬B)
The circuit can be simplified to a y switch
T T T T
b (x ∧ y) ∨ (x ∧ y ) ∨ (x ∧ y) ∨ (x ∧ y ) T F T T
= (x ∧ (y ∨ y )) ∨ (x ∧ (y ∨ y )) F T T T
= (x ∧ 1) ∨ (x ∧ 1) F F F F
= x ∨ x e A B A ∧ B ¬(¬A ∨ ¬B)
=1 T T T T
The globe is always on; the circuit can be a T F F F
single wire with no switches F T F F
5 a (x ∧ y ) ∨ (x ∧ y) ∨ (x ∧ y) F F F F
b (x ∧ y ∧ z ) ∨ (x ∧ y ∧ z) ∨ (x ∧ y ∧ z) ∨ f A B A ∧ ¬B ¬(¬A ∨ B)
(x ∧ y ∧ z )
T T F F
Exercise 23C T F T T
F T F F
1 a Your eyes are not blue.
F F F F
b The sky is not grey.
c This integer is even. 10 a A B A ∧ B (A ∧ B) ⇒ A
d I do not live in Switzerland. T T T T
e x≤2
T F F T
f This number is greater than or equal to 100.
F T F T
2 a It is dark or it is cold.
F F F T
b It is dark and cold. c It is light and cold.
d It is light or hot. e It is good or light. b A B A ∨ B (A ∨ B) ⇒ A
f It is light and hard. g It is dark or hard. T T T T
3 a B∧A b D∨C T F T T
c ¬C ∧ D d ¬A ∧ ¬B F T T F
e ¬D ∧ ¬C f B∨A F F F T
4 a It is wet or rough. b It is wet and rough.
c A B ¬A ¬B C: ¬B ∨ ¬A C ⇒ A
c It is dry and rough. d It is dry or smooth.
e It is difficult or dry. T T F F F T
f It is dry and inexpensive. T F F T T T
g It is wet or inexpensive. F T T F T F
5 a x is a prime number or an even number. F F T T T F
b x is divisible by 6. d A B ¬B ¬B ∧ A (¬B ∧ A) ⇒ A
c x is 2.
T T F F T
d x is an even number greater than 2.
e x is not 2. T F T T T
f x is not prime. F T F F T
g x is neither prime nor divisible by 6. F F T F T
h x is not divisible by 6.
Cambridge Senior Maths AC ISBN 978-1-316-63608-4 © Evans et al. 2017 Cambridge University Press
Specialist Mathematics Year 11 Photocopying is restricted under law and this material must not be transferred to another party.
Answers 719
Answers
e A B ¬A B ∨ ¬A (B ∨ ¬A) ⇒ ¬A b i If public transport improves, then I was
T T F T F elected.
ii If public transport does not improve,
T F F F T
then I was not elected.
F T T T T
c i If I qualify as an actuary, then I passed
F F T T T the exam.
f A B C: ¬B ∨ ¬A D: ¬B ∧ A C ⇒ D ii If I do not qualify as an actuary, then I
T T F F T failed the exam.
T F T T T Exercise 23D
23D
F T T F F
1 a A
F F T F F
B
g A B C: ¬B ∨ A D: ¬(B ∧ A) C ⇒ D
T T T F F b A
T F T T T
B
F T F T T
F F T T T c P
h A B ¬B ¬B ⇒ A ¬B ∧ (¬B ⇒ A) Q
T T F T F
R
T F T T T
F T F T F d A
F F T F F
B
13 (A ∪ B) = A ∩ B
Note: Equivalent to A
e A
A B
14 a A B A↓B B↓A B
T T F F
T F F F
F T F F f A
F F T T
b A A ↓ A ¬A B
T F F
F T T
C
c Note: A ↓ A is equivalent to ¬A by part b
Note: Equivalent to A ∨ B
A B ¬A ↓ ¬B A ∧ B
T T T T 2 a ¬X ∨ (X ∧ Y) ≡ ¬X ∨ Y
T F F F X Y ¬X X ∧ Y ¬X ∨ (X ∧ Y)
F T F F 0 0 1 0 1
F F F F 0 1 1 0 1
d A 1 0 0 0 0
B ¬(A ↓ B) A ∨ B
1 1 0 1 1
T T T T
T F T T b ¬A ∧ (A ∨ B) ≡ ¬A ∧ B
F T T T A B ¬A A ∨ B ¬A ∧ (A ∨ B)
F F F F 0 0 1 0 0
15 a i If x is an even integer, then x = 6. 0 1 1 1 1
ii If x is not an even integer, then x 6. 1 0 0 1 0
1 1 0 1 0
Cambridge Senior Maths AC ISBN 978-1-316-63608-4 © Evans et al. 2017 Cambridge University Press
Specialist Mathematics Year 11 Photocopying is restricted under law and this material must not be transferred to another party.
720 Answers
23E → 23 review
b (x ∧ y) ∨ (x ∧ y )
or (x ∧ z) ∨ (x ∧ y) ∨ (y ∧ z )
c x¢ y
Chapter 23 review
Short-answer questions
x y¢
1 True: d, e
2 a It is not raining. b It is raining. 2 a i = 1 ii h = 30
c 2+3≤4 d x 5 or y 5 b LCM(x, x ) = 30 = h, for all x ∈ B;
e x 3 and x 5 (i.e. x {3, 5}) HCF(x, x ) = 1 = , for all x ∈ B
f It is raining and windy. 3 a x y z Light
3 a A B A ⊕ B A ⊕ (A ⊕ B) 0 0 0 0
T T F T 0 0 1 0
T F T F 0 1 0 0
F T T T 0 1 1 1
F F F F 1 0 0 0
Note: A ⊕ (A ⊕ B) ≡ B 1 0 1 1
b A B A ∨ B A ⊕ (A ∨ B) 1 1 0 1
T T T F 1 1 1 1
T F T F b (x ∧ y ∧ z) ∨ (x ∧ y ∧ z) ∨ (x ∧ y ∧ z ) ∨
F T T T (x ∧ y ∧ z)
c (x ∧ y) ∨ (y ∧ z) ∨ (z ∧ x)
F F F F
d x
6 a A
y
B
b A
z
B
4 a i d ii 1 iii 0
C
b d ∨ d = d 1 and d ∧ d = d 0
c A
Cambridge Senior Maths AC ISBN 978-1-316-63608-4 © Evans et al. 2017 Cambridge University Press
Specialist Mathematics Year 11 Photocopying is restricted under law and this material must not be transferred to another party.