Problems On Discrete Mathematics 1 PDF
Problems On Discrete Mathematics 1 PDF
Mathematics1
Chung-Chih Li2
Kishan Mehrotra3
Syracuse University, New York
LATEX at January 11, 2007
(Part I)
No part of this book can be reproduced without permission from the authors.
[email protected]
3
[email protected]
2
Preface
Acknowledgment
Our most sincere thanks to Elaine Weinman for her her help in typing several
parts of these notes and, more importantly, for many editorial corrections.
Contents
Preface
Acknowledgment
iii
Basic Concepts
0 Preliminary
0.1
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
0.2
1 Sets
1.1
7
Definitions and Basic Theorems . . . . . . . . . . . . . . . . . . .
1.1.1
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.2
Basic Theorems . . . . . . . . . . . . . . . . . . . . . . . .
11
1.2
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
1.3
Solutions
17
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Logic
37
2.1
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
39
2.1.1
Propositional Logic . . . . . . . . . . . . . . . . . . . . . .
39
2.1.2
Predicate Logic . . . . . . . . . . . . . . . . . . . . . . . .
43
2.1.3
. . . . . . . . . . . . . . . . . . . . .
44
Logical Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
44
2.2.1
Laws of Logic . . . . . . . . . . . . . . . . . . . . . . . . .
45
2.2.2
Rules of Inference . . . . . . . . . . . . . . . . . . . . . .
47
2.2.3
48
2.2
2.3
48
2.3.1
49
2.3.2
51
2.3.3
53
2.4
Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
55
2.5
Solutions
65
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Mathematical Induction
3.1
3.2
3.3
Concepts
101
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.1.1
3.1.2
3.1.3
3.1.4
3.2.2
3.4
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.5
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4 Relations
4.1
155
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.1.2
Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.2
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
4.3
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5 Functions
5.1
183
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5.1.2
Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
5.2
5.3
II
5.4
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.5
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Specific Topics
207
6 Integers
209
6.1
6.2
Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
6.3
6.4
Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
6.5
6.6
6.7
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
6.7.1
6.7.2
6.7.3
6.8
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
6.9
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
269
7.1
. . . . . . . . . . . . . . . . . . . . . . . 271
7.2
7.2.2
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
7.3
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
7.4
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
8.2
329
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.2.2
8.2.3
8.2.4
An Example
. . . . . . . . . . . . . . . . . . . . . . . . . 342
8.3
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
8.4
Solutions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
9 Discrete Probability
9.1
369
. . . . . . . . . . . . . . . . . . . 371
9.2
9.3
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
9.4
Solutions
III
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Appendices
397
A Loop Invariance
399
B Sample Quizzes
405
viii
Part I
Basic Concepts
Chapter 0
Preliminary
Perspicuity is part of proof
Ludwig Wittgenstein
0.2. Conventions
0.1
Conventions
N : The set of natural numbers, i.e., {1, 2, 3, . . .}.
N0 : N {0}.
Z : The set of integers.
Q : The set of rational numbers.
R : The set of real numbers.
0.2
1. Implication:
Let X and Y be two mathematical statements.
If X then Y.
(1)
In logic1 we denote (1) as X Y. The meaning of (1) is: if the mathematical statement X is true, or the mathematical condition X holds, then
the mathematical statement Y is true.
To prove this kind of theorem, we first assume that the statement X is true.
Then, we have to prove that the statement Y is a logical (informally,
we say reasonable) consequence of X . If we are able to do so, then we
can claim that the theorem (statement) (1) is correct.
2. Equivalence:
Let X and Y be two mathematical statements.
X if and only if Y
(2)
0. Preliminary
3. Disproving:
Given a mathematical theorem as (1), if we can find an example for X
and Y such that this example makes X to be true but Y to be false, then
we can claim that the theorem is incorrect. For example,
if x2 > 0 then x > 0
is incorrect. Because we can find 1 such that (1)2 > 0 is true but
1 < 0. Such examples are called counter examples.
4. Proving by contradiction:
This is an important technique for proving mathematical results. Suppose
a theorem is given as (1). The idea of proving by contradiction is: we first
assume that the theorem is wrong, i.e., we can have instances that make
X true and Y false. Then we argue that, if this is the case, we can lead to
a result showing that X is false. But the result contradicts our assumption
that X is true. Therefore, the assumption will never happen, and hence
the theorem is correct.
For example, consider
if x + 1 > 2 then x > 1.
To prove it by contradiction, we assume that there is an x such that,
x + 1 > 2 and x 1. From the assumption x 1, we have
x1x+11+1
x + 1 2.
The result x + 1 2 contradicts the assumption x + 1 > 2. Therefore, the
assumption will never happen, and hence the theorem is correct.
5. Proving by cases:
Suppose we are given a theorem with respect to the domain D. If possible,
we exhaust all of the examples in the domain to see if the theorem is
correct. But, in general, we are not able to do so because the domain is
usually an infinite set, and even worse, the domain can be uncountable,
e.g., real numbers. To overcome this problem, we divide the domain into
several categories and make sure that those categories cover the domain.
Then we exam each case to see if the theorem is valid. If the theorem holds
in every case, then the theorem is correct in the entire domain. Note that
we must use the idea of universal generalization2 in the proof of each case.
2 See
Chapter 1
Sets
One can always make a theory, many theories,
to account known facts,
occasionally to predict new ones.
The test is aesthetic.
Gorge Thomson
1.1
Set theory is one of the most rigorous study in mathematics. In fact, the desire
to advance the modern set theory had been the desire of mathematicians who
wanted to pursue ultimate rigorousness in mathematics. Although the results
of securing our mathematical foundations turn out to be rather negative and we
are unfortunately in a loosing battle, the concept of sets and the notations used
in this battle are proven to be a indispensable tool in the study of mathematics
at any level.
Of course, we will not step into the dark side of the road in this book. In
stead, we will study some naive concepts of sets; most of them are intuitively
understandable from our daily-life experiences. For example, all students of
Syracuse University is a set; all students in the United State of America is a
superset of the set of students at Syracuse University. Since Dennis is a student
at Syracuse University, he is a member of the set of the students of Syracuse
university. Some students of Syracuse University are also students of Cornell
University, but none of them are students of Stanford University...., and so on.
Some of the sentences above are a bit awkward, but we live with them without
too many complains. However, when mathematicians come along, they have
to deal with mathematical objects that very often have to carry some relations
that are much more complicate than the descriptions we used in the sentences
above. Fortunately, the concepts and some immediate properties in the set
theory provide us a simple yet precise notation to simplify our works.
In addition to letting the reader be familiar with the basic terminologies and
properties of sets, another purpose of this chapter is to let the reader be used to
rigorous mathematical arguments by getting through the proofs step by step.
1.1.1
Definitions
10
1. Sets
AB
Venn Diagram
1 This
naive definition is sufficient for our purpose set up in this book. And, it is intuitively
understandable for finite sets. A more serious mathematical setup is needed to understand
the cardinality of an infinite set, but that is far beyond the scope of this book.
11
Definition 1.15: Let A be any set. The power set of A, denoted as Pr(A), is
the set of all possible subsets of A. In symbols,
Pr(A) = {S|S A}.
1.1.2
Basic Theorems
The following list contains the most important theorems that are used in many
mathematical proofs. We do not prove them here, but ask them as problems in
the problem section and prove them in the solution section.
Theorem 1.1: Let A be a set.
A = A;
A = .
B A B,
A B B.
12
1. Sets
2 For
1.2. Problems
1.2
13
Problems
Problem 1: Determine
if each of the following objects is a member of Z;
{5}, {3, 1}, 7.12, 5, a = the 2,00th decimal digit in the base-10 expression for .
Problem 2: Let A be the set of digits in the base-10 expression of the
41
44
rational number 333
. Let B be the same for 333
. Prove that A = B.
Problem 3:
of
Define sets
A = {1, {4}, {2}, 3, 4, 5},
B = {{{1, 4, 5, 3, 1}}},
C = {1, {3}, 2, 1},
D = {1, 1, 3},
E = {1, 4, {5}, {3}},
F = {1, 8, {1, 2, 3, 4}},
and,
a1 = 1, a2 = {2}, a3 = {2, 1}, a4 = {2, 1, 3, 4}, a5 = {3, 1, 5}.
For each of a1 , . . . , a5 , determine if it is a member of the sets A, . . . , F
respectively. Present your answer in the following table:
A
a1
a2
a3
a4
a5
Use an to stand for membership and a blank to stand for nonmembership.
Problem 5: Define A, B, C, D, E, and F as in Problem 4. Calculate the
following sets.
AC
BF
DC
C E
C (DF )
AE.
14
1. Sets
Problem 6:
Define
U = {3, 1, 3, 2},
V = {1, 3, {1, 3}, {1, 2, 3}}.
Is U V ? Is U V ?
Problem 7: Let A and B be sets. If A B, what does that tell you about
A B and A B?
Problem 8: Let A, B and S be sets. If A S and B S, what can you
say about A B?
Problem 9:
Problem 10:
Problem 11:
Problem 12:
Problem 16:
1. A (B C) = (A B) (A C).
2. A (B C) = (A B) (A C).
Problem 17:
1. A B = A B.
c Chung-Chih Li, Kishan Mehrotra
1.2. Problems
15
2. A B = A B.
Problem 18:
Problem 19:
Problem 20:
Problem 21:
if and only if
A B.
Problem 22:
Problem 24:
1. Venn diagrams,
2. set algebra, and
3. epsilon-argument,
respectively, to prove that
B C A if and only if A B C.
Problem 25:
Problem 26:
Problem 27:
16
1. Sets
Problem 33:
Problem 34:
1.
2.
3.
4.
5.
6.
P()
P({})
P(P())
{} P()
P()
P() P()
Problem 35:
Problem 36:
Problem 37:
Problem 38: Let A be the set of nonnegative integers and B the set of
nonnegative odd integers. Prove that the cardinality of A is equal to the
cardinality of B. [See Theorem 1.10 on page 12]
Problem 39:
1.3. Solutions
1.3
17
Solutions
Solution 1:
1. {5} 6 Z; {5} is a set, although the set happens to contain an integer.
2. {3, 1} 6 Z; {3, 1} is a set not an integer.
3. 7.12 6 Z.
Note: One should not say that 7.12 is a real number, thus 7.12 6 Z. A
number that is real does not mean it cannot be an integer. Dont forget
that Z R. That means all integers are also real numbers.
4.
5 6 Z.
Note: One should not havea problem in pointing out that 5 6 Z. The
reason is that the value of 5 is not an integer, and that is. We cannot
Solution 2:
41
44
= 0.123, and
= 0.132,
333
333
where a bar means the integers are repeated in that order forever. Thus,
A = {0, 1, 2, 3}, and B = {0, 1, 2, 3}.
Therefore, A = B.
2
c Chung-Chih Li, Kishan Mehrotra
18
1. Sets
Solution 3:
Solution 4:
a1
a2
a3
a4
a5
The set A has six members: 1, {4}, {2}, 3, 4, and 5. Only a1 and a2 are
elements of A.
The set B has only one member, that is {{1, 3, 4, 5}}.
Lets take another example. F contains 3 elements: 1, 8 and {1, 2, 3, 4}.
Thus, a1 and a4 are elements in F . Note that 2 6 F although 2 {1, 2, 3, 4}
and {1, 2, 3, 4} F . This example shows that is not transitive3 .
2
Solution 5:
1. A C = {1}.
2. B F = .
3. D C = {1, 2, 3{3}}.
4. C E = {1, {3}}.
5. C (D F ) = {1, 2, {3}}.
6. A E = {1, 4}.
2
3 See
1.3. Solutions
Solution 6:
19
Define
U = {3, 1, 3, 2}
V = {1, 3, {1, 3}, {1, 2, 3}}.
Solution 7:
Solution 8:
We can answer this problem by using Venn diagrams, but we
have to draw Venn diagrams that cover all possible cases of A and B to make
the proof complete.
Let us use another kind of argument for this problem. Two conditions are
given, i.e.,
A S,
B S.
(1.1)
(1.2)
20
1. Sets
Solution 9:
S = {p/q | p, q N + , p, q, 10}.
The cardinality of a finite set is simply the number of distinct elements of the set;
we do not consider multisets. In other words, all identical elements are counted
as one. For example, 1/2, 2/4, 3/6, 4/8, and 5/10 are the same element.
In this example, we can list all p/q, remove extra identical elements, and
count the remaining. The cardinality of S is 63.
2
Solution 10:
, {1}, {2}, {{b}}, {1, 2}, {1, {b}}, {2, {b}}, {1, 2, {b}}.
Remember that the empty set and {1, 2, {b}} itself are both subsets of the given
set.
2
1.3. Solutions
21
Solution 11:
{b, c, d} {e, o} = {(b, e), (c, e), (d, e), (b, o), (c, o), (d, o)} .
Solution 12:
The empty set is the only set that has no proper subset.
Solution 13:
The statement is wrong. The following Venn diagram disproves the statement.
AB
CB
A 6 C
Solution 14:
22
1. Sets
Solution 15:
(1.3)
(A B) (A B).
(1.4)
We assume that
Then ask: Is A equal to B?
To prove A = B, we may prove that A B and B A.
1. To prove A B, assume x A.
xA xAB
xAB
xB
def. of union;
(1.4) and the def. of subset;
def. of intersection.
Therefore, A B.
2. Similarly, to prove B A, let x B.
xB xAB
xAB
xA
def. of union;
(1.4) and the def. of subset;
def. of intersection.
Therefore, B A.
From 1 and 2 above, we conclude that A = B.
Method 2:
We can use another way to prove A = B under the same condition given in
(1.4). Let us recall the following basic theorems: For any sets A, B and C,
1. A B A.
2. A A B.
3. A B C A C.
Thus,
(A B) A (A B).
And, since (A B) (A B) is given, we have
(A B) A (A B) (A B) A.
Therefore, A (AB) and (AB) A, hence A = AB. Similarly, B = AB.
Therefore, A = B.
2
c Chung-Chih Li, Kishan Mehrotra
1.3. Solutions
23
Method 3:
We can also prove (1.3) by way of contradiction, a very important technique
for mathematical reasoning. Mathematicians use this technique very often.
Suppose that
(A B) (A B), and A 6= B.
Without loss of generality, we assume that A 6 B 4 . That is, there is an element
a in A but not in B. We know that a A B and a 6 A B. From the
definition of subset, we have
A B 6 A B,
which contradicts the assumption that (A B) (A B). Hence, A B must
be true.
2
Solution 16:
Let A, B, C be sets.
1. A (B C) = (A B) (A C).
(a) To show that A(B C) (AB)(AC), suppose x A(B C).
We have two cases:
Case 1: x A. If x A, then x (A B) and x (A C). Thus,
x (A B) (A C).
Case 2: x (B C). If x (B C), then x B and x C. Thus,
x (A B) (A C).
Therefore, in either case we have A (B C) (A B) (A C).
(b) To show that A (B C) (A B) (A C), suppose x (A
B) (A C). Then x A B and x A C. We have two cases:
Case 1: x A. If x A, then x A (B C).
Case 2: x 6 A. If x 6 A, then x must be in B and C, because from
the assumption x A B and x A C. Thus, x B C, and
hence x A (B C).
In either case we have A (B C) (A B) (A C).
Therefore,
A (B C) = (A B) (A C).
2. A (B C) = (A B) (A C).
4 The other case is: A 6 B. For this case, the argument is symmetric to the one we
give, and there is no need to repeat it again. This is the reason we can say without loss of
generality
24
1. Sets
(a) To show that A(B C) (AB)(AC), suppose x A(B C).
x A (B C) x A and x (B C).
From the definition of union, x (B C) gives two cases:
Case 1: x B. If x B, then x (A B).
Case 2: x C. If x C, then x (A C).
Thus, x (A B) (A C). .
(b) To show that A (B C) (A B) (A C), suppose x (A
B) (A C). We have two cases.
Case 1: x A B. If x A B, then x A and x B. Because
x B, x must be in B C. Therefore, x A (B C).
Case 2: x A C. If x A C, then x A and x C. Because
x C, x must be in B C.
In either case, x A (B C).
Therefore, by putting (a) and (b) together, we have
A (B C) = (A B) (A C).
Solution 17:
1. A B = A B.
(a) Let x A B.
x A B x 6 A B,
x 6 A and x 6 B,
x A and x B,
x A B.
(b) Let x 6 A B.
x 6 A B x A B,
x A or x B,
x 6 A or x 6 B,
x 6 A B.
Therefore, A B = A B.
2. A B = A B.
c Chung-Chih Li, Kishan Mehrotra
1.3. Solutions
25
(a) Let x A B.
x A B x 6 A B,
x 6 A or x 6 B,
x A or x B,
x A B.
(b) Let x 6 A B.
x 6 A B x A B,
x A and x B,
x 6 A and x
6 B,
x 6 A B.
Therefore, A B = A B.
Solution 18:
From the definition, A B is the set of all elements in A but not in B. Thus,
if x A B, then x A and x 6 B, namely, x A and x B. From the
definition of intersection, x A B. Therefore,
A B A B.
(1.5)
(1.6)
(1.7)
Solution 19:
26
1. Sets
from (1.7)
from (1.7)
De Morgan law
distributive law
Solution 20:
Let A, B, and C be sets. To prove that A B = if and only
if A B, we split our task into two subtasks.
1. The first subtask is to prove that A B = A B.
By way of contradiction, suppose
A B = and A 6 B.
If A 6 B, we can find an x, such that x A and x 6 B. But,
x A, x 6 B
x A & x B,
x A B,
A B 6= .
x A & x B,
xA&x
6 B,
A 6 B.
1.3. Solutions
27
Solution 21:
x 6 B
xB
x (A B)
A (A B)
because A B =
def. of subset.
Solution 22:
Define
A4B := (A B) (B A).
(1.8)
from (1.9),
De Morgan laws,
De Morgan laws,
distributive law,
distributive law,
commutative law.
28
1. Sets
Solution 23:
A B if and only if A B = A.
AB
Solution 24:
1. Using Venn diagrams:
(a) B C A A B C.
By way of contradiction, suppose B C A and A B 6 C. If
c Chung-Chih Li, Kishan Mehrotra
1.3. Solutions
29
A
A
C
B
(b) B C A A B C.
Again, by way of contradiction, suppose A B C and B C 6 A.
We can use the same Venn diagram. If B C 6 A, we can find the
shaded area contradicts our assumption that A B C.
2. Using set algebra;
B C A
(B C) A =
(B C) A =
(B C) A =
A (B C) =
(A B) C =
(A B) C =
(A B) C
definition of ,
problem 18,
problem 18,
commutative law,
associative law,
problem 18,
definition of .
3. Using epsilon-arguments:
(a) B C A A B C.
By way of contradiction, suppose B C A and A B 6 C. If
A B 6 C, then there exists an x such that x A B and x 6 C.
Because x A B, we know x B and x 6 A. And, because x B
and x 6 C, we know x B C. Therefore, B C 6 A.
(b) B C A A B C.
By way of contradiction, suppose A B C and B C 6 A. If
B C 6 A, there exists an x such that x B C and x 6 A. If so,
x B and x 6 C because x B C, and x A because x 6 A.
Therefore, A B 6 C because x A B and x 6 C.
30
1. Sets
Solution 25:
A B = {(, a), (, 3), (4, a), (4, 3)}.
Solution 26:
Let X and Y be two sets. There are two approaches to show
that X = Y . One approach is to show X Y and X Y , i.e, to show if a X
then a Y , and if a Y then a X. The other approach is to show if a X
then a Y , and if a 6 X then a 6 Y . Let us solve this problem by the second
approach.
1. Let a = (x, y), and suppose a A (B C).
(x, y) A (B C)
x A and y (B C)
x A and (y B or y C)
(x A and y B) or (x A and y C)
(x, y) A B or (x, y) A C
(x, y) (A B) (A C).
Therefore, a (A B) (A C).
2. Let a = (x, y), and suppose a 6 A (B C).
(x, y) 6 A (B C)
x 6 A or y 6 (B C)
x 6 A or (y 6 B and y 6 C)
(x 6 A or y 6 B) and (x 6 A or y 6 C)
(x, y) 6 A B and (x, y) 6 A C
(x, y) 6 (A B) (A C).
Therefore, a 6 (A B) (A C).
From (1) and (2), we have proved that
A (B C) = (A B) (A C).
Solution 27:
1. x A.
1.3. Solutions
31
Therefore, A B.
2. x B.
x B (x, x) (B B)
(x, x) (A A)
x A.
Therefore, B A.
Solution 28:
Then we have
Solution 29:
Let A, B, C be sets.
(a, b) A (B C)
a A and b (B C),
a A and (b B or b C ),
(a, b) (A B) or (a, b) (A C),
(a, b) (A B) (A C).
Therefore,
A (B C) = (A B) (A C).
Since we can use in every step of the proof above, we dont have to prove
the two directions of inclusion explicitly.
2
32
1. Sets
Solution 30:
i.e.,
(1.10)
(1.11)
because C = (A B),
(1.10).
because C = (A B),
(1.11).
Solution 31:
We can give a counter example to disproves (1) and (2) of this problem. Let
A be the empty set and B be any non-empty set. Therefore, A B, B A, and
A A are empty sets, while B B is not.
2
Solution 32:
P(X) =
, {1}, {2}, {3}, {a}, {1, 2}, {1, 3}, {1, a}, {2, 3},
{2, a}, {3, a}, {1, 2, 3}, {1, 2, a}, {1, 3, a}, {2, 3, a}, {1, 2, 3, a}
}.
Note: Dont forget to include the empty set and the set X in P(X).
Solution 33:
We will prove the following equality first, so we do not have
to enumerate all elements in P(X). For any set X,
X = [X (X P(X))].
c Chung-Chih Li, Kishan Mehrotra
1.3. Solutions
33
(1.12)
(1.13)
(1.14)
Solution 34:
1. P() = {}
2. P({}) = {, {}}
3. P(P()) = {, {}, {{}}, {, {}}}
4. {} P() = {(, )}
5. P() =
6. P() P() = {(, )}
Solution 35:
A = {a, 1},
P(A) = {, {a}, {1}, {a, 1}},
34
1. Sets
Solution 36:
x Pr(A B)
x (A B),
x A and x B,
x Pr(A) and x Pr(B),
x Pr(A) Pr(B).
Solution 37:
of power set,
A Pr(B) A B,
B Pr(A) B A.
Therefore, A = B.
Solution 38:
Let A be the set of natural integers and B the set of odd
natural integers. Define function f : A B as
f (n) = 2n 1.
We want to prove that f is a bijective function from A to B.
b1
2
1.3. Solutions
Solution 39:
35
We consider the following axiom:
Let A and B be any sets. |A| |B| if and only if there exists an injection g
from A to B.
To prove that |A| |Pr(A)|, we define g : A Pr(A) as
g(x) = {x}, for all x A.
g is injective because for all x, y A, if x 6= y, then {x} 6= {y}. Thus, by the
axiom, |A| |Pr(A)|.
Now, we have to prove that |A| 6= |Pr(A)|. By way of contradiction, suppose
|A| = |Pr(A)|. Then there is a bijective function f : A Pr(A). Thus, for any
a A, f (a) is a subset of A. Define the set S as
S = {x|x 6 f (x)}.
It is clear that S is a subset of A. Since f is surjective, there exists s A such
that f (s) = S. We have two cases: s S and s 6 S.
1. If s S, that means s f (s), then s 6 S.
2. If s 6 S, that means s 6 f (s), then s S.
Either case gives a contradiction. Therefore, there is no bijective function from
A to Pr(A), and hence |A| 6= |Pr(A)|.
From |A| |Pr(A)| and |A| 6= |Pr(A)|, we conclude that |A| < |Pr(A)|.
Chapter 2
Logic
It presupposes nothing but logic; that is,
logic is the only preceding theory.
Alfred Tarski
2.1. Definitions
2.1
2.1.1
39
Definitions
Propositional Logic
Definition 2.1: Propositions are mathematical statements such that their truth
or falsity can be told without ambiguity. A proposition is also called a primitive statement.
We use letters p, q, r, . . . to denote propositions. Thus, the values of p, q, r, . . .
are either T rue or F alse.
Example 2.1
p:
q:
r:
s:
2 + 2 = 5,
x2 2x + 1 has two identical roots,
{1, 2, },
there exists a 100-digit prime number,
are propositions. The value of p is F alse, and the values of q and r are
T rue. We will use T to denote T rue and F to denote F alse for the rest of
this book.
Comment: The statement s in the above example is a proposition, even
though we do not know for sure that there exists a 100-digit prime
number, but we are sure that s is either T or F . However, not every
mathematical statement has a truth value. The following two statements are not propositions.
u : This statement is false.
v : a S, where S is a set defined as S = {x|x 6 S}.
Definition 2.2: Suppose p, q, r, . . . are variables with values either T or F . We
call such variables propositional variables. We can assign T or F to any
propositional variable as we wish. propositional variables are also known as
atoms.
Definition 2.3: Let p, q be two propositions. We use the symbols:
, , , ,
to construct new propositions such as
p, p q, p q, p q, p q..
These symbols are called logical connectives; is read as not or negation,
as and or conjunction, as or or disjunction, p q is read as
if p then q or p implies q, and p q is read as p if and only if q.
Recall that all propositions have truth values either T or F . We decide the
values of the new propositions constructed above based on the values of p
and q and the rules of logical connectives defined below.
c Chung-Chih Li, Kishan Mehrotra
40
2. Logic
Definition 2.4:
1. The negation of p: p.
p
T
F
p
F
T
q
T
F
T
F
pq
T
F
F
F
q
T
F
T
F
pq
T
T
T
F
q
T
F
T
F
pq
T
F
T
T
4. Implication, if p then q: p q.
p
T
T
F
F
q
T
F
T
F
pq
T
F
F
T
2.1. Definitions
41
Only the formulas generated by the rules above are propositional formulas.
Propositional formulas are also known as well-formed-formulas, or wffs in
short.
Example 2.2
pq, pq,
p q, p q,
(p q) r
(p q) r
q
T
T
F
F
T
T
F
F
r
T
F
T
F
T
F
T
F
pq
T
T
F
F
F
F
F
F
(p q) r
T
F
T
T
T
T
T
T
We have added a column to present the truth values of p q. The 3rd row,
for example, indicates that if p = T, q = F, and r = T , then f is T .
c Chung-Chih Li, Kishan Mehrotra
42
2. Logic
(2.1)
Because, (a) both f and the proposition (2.1) have the same truth values for
all possible values of p and q, and (b) the proposition (2.1) is a disjunction
of distinct formulas using the connective between literals.
Definition 2.15: Let f be a wff in n variables. The Conjunctive Normal Form,
CNF in short, of f is a logical equivalence of f , which is a conjunction of
one or more distinct (x1 x2 xn ), where xi , 1 i n, is a literal.
Example 2.5
2.1. Definitions
2.1.2
43
Predicate Logic
44
2. Logic
If the domain Dx is clear from the context, we usually drop the domain
set and rewrite x Dx P (x) as xP (x) and x Dx P (x) as xP (x).
A predicate preceded with one or more quantifiers is called a quantified
predicate.
2.1.3
Let P (x) and Q(x) be two predicates in one variable, and let Dx be the universe
of x. Then the associated truth and falsity sets satisfy the following properties.
1. TP FP = Dx .
2. TP FP = .
3. TP Q = TP TQ .
4. TP Q = TP TQ .
5. x[P (x) Q(x)] TP TQ .
6. x[P (x) Q(x)] (TP TQ ) 6= .
2.2
Logical Proof
Logical proof is a formal way of convincing that some statements are correct
based on given facts.
Let P and Q be two wffs, predicates, or quantified predicates. Starting from
P , if we can find a sequence of applications of laws of logic, rules of inference, or
tautologies to arrive at Q, step by step, we say there is a proof for the theorem
P = Q.
In theorem P Q, P is called the premise, and Q is called a logical conclusion
of P . The sequence of these steps is called a logical proof of P Q. A logical
proof is usually represented in a table like the following one.
c Chung-Chih Li, Kishan Mehrotra
45
Premises:
Conclusion:
P
Q
1.
2.
3.
..
.
steps
P
q2
q3
..
.
reasons
Premises
..
.
i.
..
.
qi
..
.
..
.
n.
(2.2)
2.2.1
Laws of Logic
46
2. Logic
1. Law of double negation:
p p.
2. Absorption Laws:
p (p q) p,
p (p q) p.
3. Idempotent Laws:
p p p,
p p p.
4. Inverse Laws:
p p F,
p p T.
5. Identity Laws:
p T p,
p F p.
6. Domination Laws:
p F F,
p T T.
7. Commutative Laws:
(p q) (q p),
(p q) (q p).
8. Associative Laws:
(p (q r)) ((p q) r),
(p (q r)) ((p q) r).
9. Distributive Laws:
(p (q r)) ((p q) (p r)),
(p (q r)) ((p q) (p r)).
10. Contrapositive Law:
(p q) (q p)
11. De Morgans Laws:
(p q) (p q),
(p q) (p q).
12. No specific name is given, but this law is one of the most frequently used
laws in logical proof.
(p q) (p q).
c Chung-Chih Li, Kishan Mehrotra
2.2.2
47
Rules of Inference
48
2. Logic
2.2.3
Let P (x) and Q(x, y) be two predicates in one and two variables respectively.
Following are some basic inference rules for quantified predicates.
1. Negation:
xP (x) xP (x),
xP (x) xp(x).
2. -Conversion (changing the name of the bounded variable):
xP (x) yP (y),
xP (x) yP (y).
3. Reordering quantifiers of the same kind:
xyQ(x, y) yxQ(x, y),
xyQ(x, y) yxQ(x, y).
4. Universal Specification:
xP (x) = P (a), any a Dx .
5. Existential Specification:
xP (x) = P (a), some a Dx .
6. Universal Generalization:
(any a Dx , P (a) = T ) = xP (x).
7. Existential Generalization:
(some a Dx , P (a) = T ) = xP (x).
Comment: We do not have a standard notation to distinguish a between any
a in 6 and some a in 7. One should find a way to make them clear in
the proof without confusion. See problem 50 of this chapter.
2.3
In this section we introduce a systematic way to find the DNF and CNF of any
given wff. The DNF and CNF are perhaps not mathematically dignified for
presenting any wff, but they are essentially the underlying presentation inside
c Chung-Chih Li, Kishan Mehrotra
49
modern digital computers. The DNF and CNF provide a convenient apparatus
in applications of Artificial Intelligence, Logical Programming, and many other
areas of research. Therefore, it behooves us to pay more attention to the DNF
and CNF.
We will pedagogically discuss wffs in three variables. One can easily extend
the method to a more general case.
Definition 2.24: Let f be a wff in variables x1 , x2 and x3 , and let i {1, 2, 3}.
1. Each term xi or its complement xi is called a literal.
2. A term of the form y1 y2 y3 , where yi = xi or yi = xi is called a
fundamental conjunction.
3. A term of the form y1 y2 y3 , where yi = xi or yi = xi is called a
fundamental disjunction.
4. A representation of f in a disjunction of fundamental conjunctions is
called a disjunctive normal form (DNF) or sum-of-product from.
5. A representation of f in a conjunction of fundamental disjunctions is
called a conjunctive normal form (CNF) or product-of-sum from.
2.3.1
D1 D2 Dn .
(2.3)
Let f be a wff in three variables a, b, and c. There are eight possible fundamental conjunctions for a D in (2.3). These fundamental conjunctions are also
known as the building blocks for f in DNF. Let di be the ith building block
defined in the follows.
d1 : a b c
d2 : a b c
d3 : a b c
d4 : a b c
Building Blocks for DNF in three variables.
d5 : a b c
d6 : a b c
d7 : a b c
d8 : a b c
We use x to denote x due to space consideration.
Step 1: Evaluate the truth value of each building block. It is convenient to use
a truth table as shown below, where the truth value associated with each
building block is evaluated and followed by the truth value of f .
c Chung-Chih Li, Kishan Mehrotra
50
2. Logic
a
T
T
T
..
.
..
.
b
T
T
F
..
.
..
.
c
T
F
T
..
.
..
.
T
F
F
F
T
F
F
F
T
..
..
..
.
.
.
..
..
..
.
.
.
..
.
..
f (a, b, c)
T
F
T
..
.
..
.
Step 2: We check the last column and mark the rows in which f s value is T .
For each marked row, we find and mark the building block with value T in
the row. Note that for each row, there is exactly one building block with
value T , and for each column of a building block, there is exactly one row
with value T .
Step 3: Finally, the DNF is the disjunction of the building blocks marked in
step 2. In the above partial example, a part of the DNF is
f (a, b, c) = (a b c) (a b c)
2
Example 2.8
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
d1
T
F
F
F
F
F
F
F
d2
F
T
F
F
F
F
F
F
d3
F
F
T
F
F
F
F
F
d4
F
F
F
T
F
F
F
F
d5
F
F
F
F
T
F
F
F
d6
F
F
F
F
F
T
F
F
d7
F
F
F
F
F
F
T
F
d8
F
F
F
F
F
F
F
T
f
T
T
T
F
T
T
T
T
(a b c) (a b c) (a b c) (a b c)
(a b c) (a b c) (a b c).
2
c Chung-Chih Li, Kishan Mehrotra
2.3.2
51
c1
c2
c3
c4
c5
c6
c7
c8
:
:
:
:
:
:
:
:
a
a
a
a
a
a
a
a
b
b
b
b
b
b
b
b
c
c
c
c
c
c
c
c
Step 1: We construct the following truth table. As we did for finding DNF,
each building block must occupy one column, and the last column contains
the truth values of f .
a
T
T
T
..
.
..
.
F
b
T
T
F
..
.
..
.
F
c
T
F
T
..
.
..
.
F
abc abc
T
T
T
T
T
T
..
..
.
.
..
..
.
.
F
T
..
.
..
abc
T
F
T
..
.
..
.
T
..
.
..
.
f (a, b, c)
T
F
T
..
.
..
.
Step 2: Check the last column and mark the rows in which f s value is F . For
each marked row, we find and mark the building block with value F in
the row. Note that for each row, there is exactly one building block with
value F , and there is exactly one row with value F in each building blocks
column.
Step 3: Finally, the CNF is the conjunction of the building blocks marked in
step 2. In the above partial example, a part of the CNF is
f (a, b, c) = (a b c) (a b c)
2
c Chung-Chih Li, Kishan Mehrotra
52
2. Logic
Example 2.9
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
c1
T
T
T
T
T
T
T
F
c2
T
T
T
T
T
T
F
T
c3
T
T
T
T
T
F
T
T
c4
T
T
T
T
F
T
T
T
c5
T
T
T
F
T
T
T
T
c6
T
T
F
T
T
T
T
T
c7
T
F
T
T
T
T
T
T
c8
F
T
T
T
T
T
T
T
f
T
T
T
F
T
T
T
T
Therefore,
(a b) c = (a b c).
2
Example 2.10
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
d1
T
F
F
F
F
F
F
F
d2
F
T
F
F
F
F
F
F
d3
F
F
T
F
F
F
F
F
d4
F
F
F
T
F
F
F
F
d5
F
F
F
F
T
F
F
F
d6
F
F
F
F
F
T
F
F
d7
F
F
F
F
F
F
T
F
d8
F
F
F
F
F
F
F
T
f
T
F
F
T
F
F
F
F
53
For CNF:
a
T
T
T
T
F
F
F
F
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
c1
T
T
T
T
T
T
T
F
c2
T
T
T
T
T
T
F
T
c3
T
T
T
T
T
F
T
T
c4
T
T
T
T
F
T
T
T
c5
T
T
T
F
T
T
T
T
c6
T
T
F
T
T
T
T
T
c7
T
F
T
T
T
T
T
T
c8
F
T
T
T
T
T
T
T
f
T
F
F
T
F
F
F
F
2
2.3.3
Given any wff f , we can find the DNF and CNF directly from its truth set and
falsity set. Let us assume that f has three variables a, b, and c, and let the
format of the truth set Tf and the falsity set Ff be Da Db Dc .
Step 1: Find out the truth set Tf and the falsity set Ff of f .
Step 2: For DNF, we will use the truth set Tf . The building blocks that should
appear in the DNF of f are those having truth value T if we apply some
elements in Tf to them. In other words, for each (ta , tb , tc ) Tf , we choose
(xa xb xc ) according to the following rules.
1. xa = a if ta = T .
2. xa = a if ta = F .
3. xb and xc are decided by the same principle above.
For CNF, we will use the falsity set Ff . The building blocks that should
appear in the CNF of f are those having truth value F if we apply some
elements in Ff to them. In other words, for each (ta , tb , tc ) Ff , we
choose (xa xb xc ) according to the following rules.
1. xa = a if ta = T .
2. xa = a if ta = F .
3. xb and xc are decided by the same principle above.
c Chung-Chih Li, Kishan Mehrotra
54
2. Logic
Basically, the shortcut method and the truth table addressed with building
blocks are essentially the same. Lets consider the following example.
Example 2.11
Find the DNF and CNF of (a b) c from its truth set
and falsity set directly.
Let f = (a b) c.
table.
a
T
T
T
T
F
F
F
F
c
T
F
T
F
T
F
T
F
ab
T
T
F
F
F
F
T
T
(a b) c
T
F
F
T
F
T
T
F
We have
Tf = {(T, T, T ), (T, F, F ), (F, T, F ), (F, F, T )},
Ff = {(T, T, F ), (T, F, T ), (F, T, T ), (F, F, F )}.
For DNF of f , consider Tf . We apply the rule described on all four elements of
Tf to get the associated blocks.
(T, T, T )
(T, F, F )
(F, T, F )
(F, F, T )
= (a b c),
= (a b c),
= (a b c),
= (a b c).
2
c Chung-Chih Li, Kishan Mehrotra
2.4. Problem
2.4
55
Problem
Problem 1:
Define sets
A = {1, . . . , 10}, B = {3, 7, 11, 12}, C = {0, 1, . . . , 20}.
Problem 3:
1+1=3
(A B) C
AB
(8 + 22)3 /102
7A
(B C) 9
C is an infinite set
b
T
F
T
F
f
F
T
T
T
g
T
T
F
T
Problem 4:
1. (a T ) (F b)
2. (F a) (b F )
3. (a b) (a b)
Problem 5:
1. (a b) (a b),
2. (a b) (a b) (a b)
Problem 6:
Show that
(a b c) = (a b c),
56
2. Logic
2. p q
4. p q
Show that
((a b) c) ((a c) (b c)).
Problem 12: Work out the truth tables for modus ponens to show that it
is a logical implication but not an equivalence.
Problem 13:
Consider
Premises: If there was a ball game, then traveling was difficult. If they
arrived on time, then traveling was not difficult. They arrived on
time.
Conclusion: There was no ball game.
Determine whether the conclusion follows logically from the premises.
Explain by representing the statements symbolically and using rules of
inference.
c Chung-Chih Li, Kishan Mehrotra
2.4. Problem
Problem 14:
57
Consider
Premises: If Claghorn has wide support, then hell be asked to run for
the senate. If Claghorn yells Eureka in Iowa, he will not be asked
to run for the senate. Claghorn yells Eureka in Iowa.
Conclusion: Claghorn does not have wide support.
Determine whether the conclusion follows logically from the premises.
Explain by representing the statements symbolically and using rules of
inference.
Problem 15: Write the converse, inverse, contrapositive, and negation of
the following statement.
If Sandra finishes her work, she will go to the basketball game.
Problem 16:
Simplify
(p (r q q)) ((r t r) q).
Problem 17:
Simplify
(p (p q) (p q r)) ((p r t) t).
Problem 18:
Refer to the laws of logic and inference rule, and give reasons to justify
each step of the proof.
steps
1. p
2. p q
3. q
4. r q
5. q r
6. r
7. s r
8. s
9. s t
Problem 19:
reasons
Conclusion :
(p q) r
r (s t)
s u
u t
p
c Chung-Chih Li, Kishan Mehrotra
58
2. Logic
Give a reason to justify each step of the proof.
steps
1. s u
2. u
3. u t
4. t
5. s
6. s t
7. r (s t)
8. (s t) r
9. (s t) r
10. t
11. (p q) r
12. r (p q)
13. r (p q)
14. p q
15. p
Problem 20:
reasons
reasons
Conclusion :
c Chung-Chih Li, Kishan Mehrotra
p q
qr
r
p
2.4. Problem
Problem 22:
59
Show that the following premises are inconsistent.
1. If Jack misses many classes through illness, then he fails high school.
2. If Jack fails high school, then he is uneducated.
3. If Jack reads a lot of books, then he is not uneducated.
4. Jack misses many classes through illness and reads a lot of books.
Problem 23:
Problem 24:
x2 + 1 < 0
x is odd
(x2 1)/(x + 1)
1+2=3
xN
sin2 x + cos2 x
Define
A = {x|x N, x 10};
B = {y; y N, y 15, y is even}.
60
2. Logic
Problem 28:
1. Prove that the truth set of x Dx P (x, y) is the set of all second
coordinates of ordered pairs in V .
2. Prove that the truth set of x Dx P (x, y) is
{b; b Dy , Dx {b} V }.
Problem 30:
Let sets
Dx = {t; t R, 1 t 1} and
Dy = {r; r R, 0 r 1}
(1)
(2)
(3)
(4)
2.4. Problem
Problem 32:
61
Let P (x, y) be a predicate defined as
P (x, y) : (x y) z.
Consider
Premises:
All soldiers can march.
Some babies are not soldiers.
Conclusion:
Some babies cannot march.
Determine whether the conclusion follows logically from the premises.
Explain.
Problem 37: Let Dx = N and Dy = N0 . Define P (x, y) as x divides y.
Find the truth values of the following quantified predicates.
1. yP (1, y)
2. xP (x, 0)
3. xP (x, x)
4. yxP (x, y)
5. yxP (x, y)
c Chung-Chih Li, Kishan Mehrotra
62
2. Logic
6. xy[(P (x, y) P (y, x)) (x = y)]
7. xyx[(P (x, y) P (y, x)) P (x, z)]
Problem 40:
Problem 41:
1. a b.
2. (a b) c.
Problem 42:
1. Use the shortcut method (use the falsity set) to find the CNF of f .
2. Use the propositional calculus to find the DNF of f .
Problem 43:
theory:
2.4. Problem
Problem 45:
63
Are the following arguments logically correct?
Premises:
All who are anxious to learn work hard.
Some of these boys work hard.
Conclusion:
Therefore some of these boys are anxious to learn.
Problem 46:
Premises:
There are men who are soldiers.
All soldiers are strong.
All soldiers are brave.
Conclusion:
Therefore some strong men are brave.
Problem 47: Let the universe be a social club, and let x and y range over
the members of the club. Define the predicate P (x, y) as
P (x, y) := x loves y.
Translate the following quantified predicates into English sentences
1. xy P (x, y)
2. xy P (x, y)
3. xy P (x, y)
4. xy P (x, y)
Problem 48: Let the domain range over all real numbers. Find a possible
conclusion from the given premises.
Premises:
All integers are rational numbers.
The real number is not a rational number.
Problem 49: Let the domain range over all people in the USA. Find a
possible premise for the following inference.
Premises:
All librarians know the Library of Congress Classification System.
(unknown premise)
Conclusion:
Margaret knows the Library of Congress Classification System.
Problem 50:
64
2. Logic
Problem 51:
Problem 52:
Problem 53:
Problem 54:
[Hint: Use the fact that 2 is irrational; a and b dont have to be distinct.]
2.5. Solutions
2.5
65
Solutions
Solution 1:
Solution 2:
There are infinitely many wffs that satisfy the given truth
table. The simplest two we can think of are
f = (a b), and
g = b a.
Solution 3:
Let p q be false. The only case in which p q is false is
when p = T and q = F . We can replace the occurrences of p and q by their
values and find the result step by step as the following:
((p) q) (p q)
= ((T ) F ) (T F )
= (F F ) T
= F T
= F
66
2. Logic
Solution 4:
1. Let f (a, b) = (a T ) (F b)
a
T
T
F
F
b
T
F
T
F
T
T
T
T
T
F
F
F
F
F
aT
T
T
T
T
F b
T
T
T
T
F a
T
T
F
F
bF
F
F
F
F
f (a, b)
T
T
T
T
2. Let f (a, b) = (F a) (b F )
a
T
T
F
F
b
T
F
T
F
T
T
T
T
T
F
F
F
F
F
f (a, b)
F
F
T
T
b
T
F
T
F
b a b
F
T
T
T
F
T
T
F
a b
T
T
F
T
f (a, b)
T
T
F
F
Solution 5:
We will check the truth tables to tell whether the statements
are tautologies or not.
1. Let f = (a b) (a b).
a
T
T
F
F
b
T
F
T
F
ab ab
T
T
F
F
F
F
T
F
f
T
T
T
F
The last column of the truth table contains an F in the last row. Thus, f
is not a tautology.
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
67
2. Let g = (a b) (a b) (a b).
Note: g should be read as (a b) ((a b) (a b)), but not as
((a b) (a b)) (a b), because the precedence priority of
is higher than the precedence priority of .
s = (a b) (a b).
a
T
T
F
F
b
T
F
T
F
a b a b a b s
T
T
F
T
F
F
F
F
F
F
F
F
T
F
T
T
g
T
T
T
T
Solution 6:
Let
p
q
r
s
a
T
T
T
T
F
F
F
F
=
=
=
=
b
T
T
F
F
T
T
F
F
a b c
a b c
(a b c) (a b c)
(a b c) (a b c)
c
T
F
T
F
T
F
T
F
ab
T
T
F
F
F
F
F
F
ab p
T
T
T
F
T
T
T
F
T
T
T
F
F
T
F
T
q
T
F
T
T
T
T
T
T
r
T
T
T
T
T
T
T
T
s
T
T
T
F
T
F
T
T
68
2. Logic
Solution 7:
Let
Solution 8:
1. To prove that p (q r) (p q) (p r), let
s = p (q r),
t = (p q) (p r),
u = (p (q r)) ((p q) (p r)).
p
T
T
T
T
F
F
F
F
q
T
T
F
F
T
T
F
F
r
T
F
T
F
T
F
T
F
qr
T
F
F
F
T
F
F
F
pq
T
T
F
F
T
T
T
T
pr
T
F
T
F
T
T
T
T
s
T
F
F
F
T
T
T
T
t
T
F
F
F
T
T
T
T
u
T
T
T
T
T
T
T
T
Since the last column contains truth value T for all possible values of p.q,
and r, therefore, p (q r) and (p q)(p r) are logically equivalent.
2.5. Solutions
69
q
T
T
F
F
T
T
F
F
r
T
F
T
F
T
F
T
F
pq
T
T
T
T
T
T
F
F
pr
T
F
T
F
T
T
T
T
qr
T
F
T
T
T
F
T
T
s
T
F
T
F
T
F
T
T
t
T
F
T
F
T
F
T
T
u
T
T
T
T
T
T
T
T
Solution 9:
Logical equivalence
Associative law
Double negation law
De Morgans law
Double negation law
Logical equivalence
Solution 10:
From the definition of duality it is not possible to give the
dual of a logical statement that contains or . We have to find its
logical equivalent statements that contain no logical connectives other than
and .
1. Since q p q p, hence the dual of q p is q p.
2. Since p (q r) p (q r) its dual is p (q r).
3. Reduction of p q to a formula that contains connectives only , , and
c Chung-Chih Li, Kishan Mehrotra
70
2. Logic
is given below.
pq
(p q) (q p)
(p q) (q p)
[(p q) q] [(p q) p]
(p q) (q q) (p p) (q p)
(p q) F F (q p)
(p q) (q p).
Solution 11:
Our goal is to show that the values in the last column of the
truth table are all true. Let,
s = (a b) c,
t = (a c) (b c),
u = ((a b) c) ((a c) (b c)).
a
T
T
T
T
F
F
F
F
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
ab ac bc s
T
T
T
T
T
F
F
F
F
T
T
T
F
F
T
T
F
T
T
T
F
T
F
T
F
T
T
T
F
T
T
T
t
T
F
T
T
T
T
T
T
Therefore, u is a tautology.
Solution 12:
u
T
T
T
T
T
T
T
T
b
T
F
T
F
a b a (a b)
T
T
F
F
T
F
T
F
s
T
T
T
T
t
T
T
F
T
2.5. Solutions
71
Solution 13:
Let
BG:
T D:
AO:
Premises: BG T D,
AO.
Conclusion: BG.
steps
1. BG T D
2. AO T D
3. AO
4. T D
5. T D BG
6. BG
reasons
Premises
Premises
Premises
2,3, Modus Ponens
1, Contrapositive
4,5, Modus Ponens
Therefore, the conclusion that there was no ball game is logically correct
based on the given premises.
2
Solution 14:
Let
CS:
RS:
CY :
Premises: CS RS,
CY.
Conclusion: CS.
steps
1. CS RS
2. CY RS
3. CY
4. CY (CY RS)
5. RS
6. RS CS
7. RS (RS CS)
8. CS
reasons
Premises
Premises
premises
23
4, Modus Ponens
1, Contrapositive
56
7, Modus Ponens
c Chung-Chih Li, Kishan Mehrotra
72
2. Logic
Solution 15:
Let p :
q:
Implication: (p q)
If Sandra finishes her work, she will go to the basketball game.
Converse: (q p)
If Sandra goes to the basketball game, she will finish her work.
Inverse: (p q)
If Sandra does not finish her work, she will not go to the basketball game.
Contrapositive: (q p)
If Sandra does not go to the basketball game, she does not finish her work.
Negation: (p q)
Sandra finishes her work, and she does not go to the basketball game.
Solution 16:
(p (r q q)) ((r t r) q)
(p (r T )) ((t T ) q)
(p T ) (T q)
p q.
2
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
73
Solution 17:
(p (p q) (p q r)) ((p r t) t)
(p (p q T ) (p q r)) ((p r t) (T t)
(p (((p q) T ) ((p q) r))) (((p r) t) (T t)
(p ((p q) (T r)) (((p r) T ) t)
(p ((p q) T ) (T t)
(p (p q)) t)
((p T ) (p q)) t
(p (T q)) t
(p T ) t
pt
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
Solution 18:
To prove (p (p q) (s r) (r q)) (s t), we will
take p, p q, s r, and r q as the given assumptions.
steps
1. p
2. p q
3. q
4. r q
5. q r
6. r
7. s r
8. s
9. s t
reasons
Assumption
Assumption
1,2, Modus Ponens
Assumption
4, Contrapositive
3,5, Modus Ponens
Assumption
6,7, Disjunctive Syllogism
8, Disjunctive Amplification
Solution 19:
Premises :
(p q) r, r (s t), s u, u t
Conclusion : p
c Chung-Chih Li, Kishan Mehrotra
74
2. Logic
steps
1. s u
2. u
3. u t
4. t
5. s
6. s t
7. r (s t)
8. (s t) r
9. (s t) r
10. r
11. (p q) r
12. r (p q)
13. r (p q)
14. p q
15. p
reasons
Premises
1, Conjunctive Simplification
Premises
2,3, Modus Ponens
1, Conjunctive Simplification
4,5, Conjunction
Premises
7, Contrapositive
8, De Morgans law
6,9, Modus Ponens
Premises
11, Contrapositive
12, De Morgans law
10,13, Modus Ponens
14, Conjunctive Simplification
Solution 20:
((p q) (r s) (p r)) (q s)
(2.4)
1. The following proof for (2.4) is a contradiction argument. By contradiction, we assume that the premises and the negation of the consequence
are both true, i.e., we have
Assumptions:
p q, r s, p r, (q s).
steps
reasons
1. (q s)
Assumption, by Contradiction)
2. q s
Negation of implication
3. s
2, Conjunctive Simplification
4. r s
Assumption
5. r
3,4, Disjunctive syllogism
6. p q
Assumption
7. q
2, Conjunctive Simplification
8. p
6,7, Modus Tollens
9. p r
Assumption
10. r
8,9, Disjunctive syllogism
11. r r
5,10, Conjunction
12. q s
Since 11 is a contradiction, 1 cant be true
2
2. A direct proof for (2.4).
Assumptions:
c Chung-Chih Li, Kishan Mehrotra
p q, r s, p r.
2.5. Solutions
75
steps
1. p q
2. q p
3. p r
4. p r
5. q r
6. r s
7. r s
8. q s
reasons
Assumption
Equivalence of 1
Assumption
Equivalence of 3
2,4, Syllogism
Assumption
Equivalence of 6
5,7, Syllogism
Solution 21:
Premises :
Conclusion :
steps
1. p q
2. p q
3. q p
4. q r
5. r q
6. r
7. q
8. q p
9. p
p q, q r, r
p
4,
5,6
2
7,8
reasons
Premises
From 1
From 1
Premises
Contrapositive
Premises
Modus Ponens
Contrapositive
Modus Ponens
Solution 22:
We say a system (a set of premises) is inconsistent if and only
if we can obtain some results from the system that contradict each other.
Let
M C:
F S:
U E:
RB:
Premises :
Jack
Jack
Jack
Jack
M C F S, F S U E, RB EU, M C RB.
c Chung-Chih Li, Kishan Mehrotra
76
2. Logic
steps
1. M C RB
2. M C
3. M C F S
4. F S
5. F S U E
6. U E
7. RB U E
8. RB
9. U E
10. U E U E
reasons
Premises
1, Conjunctive Simplification
Premises
2,3, Modus Ponens
Premises
4,5, Modus Ponens
Premises
1, Conjunctive Simplification
7,8, Modus Ponens
6,9, Conjunction
Solution 23:
Recall the definition of predicates: A statement is a predicate
if we can replace every variable in the statement by any instance in its domain
to form a proposition.
(1), (2), (4) and (5) are predicates. (3) and (6) are not predicates.
Note: A predicate may not have any variable. Therefore, all propositions are
also predicates, and hence (4) is a predicate.
Solution 24:
as
2
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
77
Solution 25:
1. TP TQ = TP Q
x TP TQ
x TP and x TQ
P (x) = T and Q(x) = T
(P Q)(x) = T
x TP Q .
2. TP TQ = TP Q
x TP TQ
x TP or x TQ
P (x) = T or Q(x) = T
(P Q)(x) = T
x TP Q .
x F (P ) and x F (Q)
P (x) = F and Q(x) = F
(P Q)(x) = F
(why?)
x FP Q .
x F (P ) or x F (Q)
P (x) = F or Q(x) = F
(P Q)(x) = F
(why?)
x FP Q .
3. F (P ) F (Q) = FP Q
x F (P ) F (Q)
4. F (P ) F (Q) = FP Q
x F (P ) F (Q)
Solution 26:
TP Q TP
(FP TQ ) TP
(TP TQ ) TP
TP TP and TQ TP .
78
2. Logic
The only possibility to make TP TP is when TP = , namely, TP = U .
If TP = U , then TQ TP is satisfied for any TQ . Therefore, TP = U is
the most general condition for (P (x) Q(x)) P (x) to be true.
2. (P (x) Q(x)) Q(x).
[(P (x) Q(x)) Q(x)]
TP Q TQ
(FP TQ ) TQ
FP TQ and TQ TQ
FP TQ .
Solution 27:
Solution 28:
Let Dx = Dy = {1, 2, 3, 4, 5}, and P (x, y) := (y x)(x+y >
6). Thus, the truth set of P (x, y) is a subset of Dx Dy .
1. TP (x,y) = Tyx Tx+y>6 .
Tyx
Tx+y>6
(1, 1),
(5, 2),
2.5. Solutions
79
Tyx Tx+y>6
(1, 1),
(5, 2),
(1, 2), (2, 2),
(1, 3), (2, 3), (3, 3), (4, 3), (5, 3),
=
(1, 4), (2, 4), (3, 4), (4, 4), (5, 4),
=
=
=
=
=
{y
{y
{y
{y
{y
: (y
: (y
: (y
: (y
: (y
1) (y
2) (y
3) (y
4) (y
5) (y
=
=
=
=
=
Solution 29:
Let V = TP (x,y) .
80
2. Logic
2. Given any k,
k TxP (x,y)
xP (x, k)
x Dx , (x, k) TP (x,y)
x Dx , (x, k) V
Dx {k} V
k {b : b Dy , Dx {b} V }.
Solution 30:
Recall that TP TQ is equivalent to P Q. Suppose
x Dx , y Dy , and (x + y 1) (y x 1). We prove P Q in the
following.
1. From x + y 1:
steps
(1) x + y 1
(2) 1 x
(3) 0 y
(4) 1 x + y
(5) 1 x + y 1
(6) (x + y)2 1
(7) x2 + 2xy + y 2 1
reasons
given
x Dx
y Dy
(2) + (3)
(1) + (4)
math (5)
math (6)
steps
(1) y x 1
(2) 0 y
(3) 1 x
(4) 1 x
(5) 1 y x 1
(6) (y x)2 1
(7) x2 2xy + y 2 1
reasons
given
y Dy
x Dx
(3) 1
(2) + (4)
math (5)
math (6)
2. y x 1
x 2xy + y
c Chung-Chih Li, Kishan Mehrotra
1.
(2.5)
(2.6)
2.5. Solutions
81
x2 + y 2 1.
Solution 31:
Recall the definition of subset. We say that S is a subset of X
if and only if for all x, if x is in S, then x is in X. We may rewrite the definition
as
SX
iff
(x S) (x X).
Please note that we are using in the above definition instead of , i.e.,
S is a subset of X if and only if (x S x X) is a tautology. Therefore, it
is legitimate not to express for all explicitly in the second definition.1
In order to easily find the error in this problem, let us rewrite the definition
of subset without omitting the universal quantifier.
SX
Therefore, S (A B)
iff
x(x S x X).
iff
x(x S x (A B))
x(x S (x A or x B))
x[(x S x A) or (x S x B)]
6 x(x S x A) or x(x S x B)
(S A or S B).
(1)
(2)
(3)
(4)
82
2. Logic
S = all children, A = all boys, B = all girls.
It is clear that (2) is true, which means for all x, if x is a child, then x is either
a boy or a girl. However, (3) is not true, which means either all children are
boys, or all children are girls.
2
Solution 32:
xy[(x y) z] xy[(x y) z]
xy[(x y) z]
xy[(x y) z].
Solution 33:
To find the negations of the given formulas, we use the basic
rules and De Morgans laws. Recall that xp(x) xp(x) and xp(x)
xp(x) for any predicate p(x). Thus,
1. x y [(x > y) (x y > 0)]
2
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
83
Solution 34:
Let the domain Dx be the set of all people. Define the
following predicates.
P B(x) :
SC(x) :
M L(x):
P E(x) :
P R(x) :
CC(x) :
HC(x):
LC(x) :
a
:
p1 :
p2 :
p3 :
p4 :
p5 :
p6 :
p7 :
:
:
:
:
:
:
:
P B(a) SC(a).
M L(a) P E(a).
P R(a).
CC(a) LC(a).
P E(a) P B(a).
SC(a) HC(a).
M L(a) P R(a).
c Chung-Chih Li, Kishan Mehrotra
84
2. Logic
We have
steps
1 P R(a) M L(a)
2 M L(a)
3 P E(a)
4 P B(a)
5 SC(a)
6 HC(a)
reasons
p7 , Contrapositive
1, p3 , Modus Ponens
2, p2 , Modus Ponens
3, p5 , Modus Ponens
4, p1 , Modus Ponens
5, p6 , Modus Ponens
Now, we can transfer the propositions back to English, which will tell us some
facts about Amos Judd.
M L(a):
P E(a) :
P B(a) :
SC(a) :
HC(a):
Amos
Amos
Amos
Amos
Amos
Judd
Judd
Judd
Judd
Judd
We do not know if Amos Judd is our cooks cousin, and we do not know if
Amos Judd loves cold mutton.
2
Solution 35:
Solution 36:
2.5. Solutions
85
x(S(x) M (x))
x(B(x) S(x))
x(B(x) M (x))
From the first premise and by the rule of universal specification we have, for
any a,
S(a) M (a),
B
S
M
Where M is the set of all creatures that can march, B is the set of babies, and S
is the set of all soldiers. We interpret x S as S(x) is true, likewise for x M .
c Chung-Chih Li, Kishan Mehrotra
86
2. Logic
Solution 37:
P as
1. yP (1, y) = T.
2. xP (x, 0) = T.
3. xP (x, x) = T.
4. yxP (x, y) = T.
Given any number y, there exists x, say x = 1, such that x divides y.
5. yxP (x, y) = T. Such a y is 0.
6. xy[(P (x, y) P (y, x)) (x = y)] = T.
Given any x and y, suppose that (P (x, y) P (y, x)) is true.
P (x, y) y = ax, a N0 ;
P (y, x) x = by, b N.
Thus, x = by = b(ax) = abx, and hence ab = 1. Because both a and b are
nonnegative integers, we know that a = b = 1. Therefore, x = y.
7. xyz[(P (x, y) P (y, z)) P (x, z)] = T.
Given any x, y, and z, suppose that (P (x, y) P (y, z)) is true.
P (x, y) y = ax, a N0 ;
P (y, z) z = by, b N0 .
Thus, z = by = b(ax) = abx. Since ab N0 , therefore, P (x, z) is true.
Solution 38:
Consider the quantified statement, x y [x + y = 17]. Let
Dx and Dy denote the universes of x and y, respectively.
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
87
Solution 39:
of f first.
b
T
F
T
F
a b a b
T
T
F
T
T
F
T
T
f (a, b)
T
F
F
T
The building blocks for the DNF of a propositional formula with two variables
are (a b), (a b), (a b), and (a b).
a
T
T
F
F
b
T
F
T
F
ab ab
T
F
F
T
F
F
F
F
ab ab
F
F
F
F
T
F
F
T
f (a, b)
T
F
F
T
88
2. Logic
Solution 40:
b
T
F
T
F
ab
T
F
T
T
a b
F
T
T
T
f (a, b)
F
F
T
T
b
T
F
T
F
ab ab
T
F
F
T
F
F
F
F
ab ab
F
F
F
F
T
F
F
T
f (a, b)
F
F
T
T
Solution 41:
Remark: Since using building blocks and the truth tables to
find the DNF or CNF is pretty mechanical, it should not be difficult to find the
DNF and CNF in this way. Let us solve this problem by using propositional
calculus. Sometimes the propositional calculus method is easier than the truth
table approach, sometimes it isnt.
1. a b = a b = (a b).
2. For (a b) c:
(a b) c = (a c) (b c)
= ((a c) F ) (F (b c))
= ((a c) (b b)) ((a a) (b c))
= ((a c b) (a c b)) ((a b c) (a b c))
= (a b c) (a b c) (a b c).
Note: Why can we insert F without changing the value of the formula of the
problem? How about the case?
2
Solution 42:
Let f = a (b c). We will use the shortcut method to find
the CNF of f and propositional calculus to find the DNF.
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
89
a
T
T
T
T
F
F
F
F
b
T
T
F
F
T
T
F
F
c
T
F
T
F
T
F
T
F
bc
T
F
F
T
T
F
F
T
a (b c)
T
F
F
T
F
F
F
F
2. Propositional Calculus:
a (b c) = a ((b c) (b c))
= (a (b c)) (a (b c))
= (a b c) (a b c).
2
c Chung-Chih Li, Kishan Mehrotra
90
2. Logic
Solution 43:
In general, if . . . then . . . can be translated into a logical implication (), and there is or there are should use an existential quantifier
(). We need a predicate for a property described. And, or, and all used
in English sentences are equal to , , and , respectively, in the corresponding
mathematical expressions. With this in mind, lets examine the statement from
the number theory:
For every integer n bigger than 1, there is a prime strictly
between n and 2n.
Lets move one step forward:
For all integers, if the integer n is bigger than 1, then there is
a number which is a prime and strictly between n and 2n.
Let Dx be the set of all integers, and define predicate P (x) as
P (x) : x is prime.
1. We can obtain a logical sentence from the statement above:
n[(n > 1) x(P (x) (n < x < 2n))].
(2.7)
Solution 44:
2.5. Solutions
91
first method uses the contradiction argument, and the second one will check all
the possible cases to show that the result is valid for all of them.
Let Dx be the set of integers. Define
P (x) : x is even.
We can restate the given result as the predicate,
P (xy) (P (x) P (y)).
Method 1:
(2.8)
(2.9)
(2.10)
If x and y are not even, then they are odd and can be expressed as
x = 2k + 1, y = 2q + 1
for some integers k and q. Thus,
xy = (2k + 1)(2q + 1)
= 4kq + 2k + 2q + 1
= 2(2kq + k + q) + 1
Because k and q are both integers, we know that 2kq + k + q is an integer too. Thus, xy is not even, i.e., P (xy) is false. This contradicts our
assumption that P (xy) is true. Therefore, (2.8) is correct.
2
Method 2: Given any two integers, we have three cases: 1. both are even, 2.
both are odd, 3. one is odd and the other one is even. We want to show
that, in each case, (2.8) is correct.
1. Both are even: Let x = 2k, y = 2q for some integers k and q.
P (xy)
(P (x) P (y))
P (4kq) (P (2k) P (2q))
T (T T )
T T
T
(P (x) P (y))
P (4kq + 2k + 2q + 1) (P (2k + 1) P (2q + 1))
F (F F )
F F
T
c Chung-Chih Li, Kishan Mehrotra
92
2. Logic
3. One odd and one even: Let x = 2k + 1, y = 2q for some integers k
and q.
P (xy) (P (x) P (y))
P (4kq + 2q) (P (2k + 1) P (2q))
T (F T )
T T
T
We have seen that, in all cases, (2.8) is true. Therefore, it is a correct
statement for all integers.
Solution 45:
Let the domain Dx be the set of all people. Define the
following predicates with variables over Dx .
P (x): x is anxious to learn.
Q(x): x works hard.
R(x): x is one of those boys.
Now we can rewrite the premises and the conclusion in terms of the predicates defined above.
P 1 : x[P (x) Q(x)]
P 2 : x[R(x) Q(x)]
C : x[R(x) P (x)]
The conclusion C is not logically correct from the premises. Consider the
following Venn diagram for the truth sets of predicates P, Q, and R.
Dx
TP
TR
TQ
2.5. Solutions
93
Solution 46:
Let the domain Dx be the set of all people. Define the
following predicates with variables over Dx .
P (x):
Q(x):
R(x):
S(x) :
x
x
x
x
is
is
is
is
a man.
a soldier.
strong.
brave.
The premises and the conclusion in terms of the predicates defined above
are:
P1 :
P2 :
P3 :
C:
TP TQ 6=
TQ TR
TQ TS
Based on the facts above, we want to prove the conclusion that is equivalent to
(TP TR TS ) 6= .
From P 1, we know there is a nonempty set such that TP TQ = .
steps
1. TQ
2. TQ TR
3. TR
4. TQ TS
5. TS
6. TP
7. (TP TR TS )
8. 6=
9. (TP TR TS ) 6=
reasons
Definition of
P2
1, 2, Definition of
P3
1, 4, Definition of
Definition of
3, 5, 6, Definition of
P1
steps 7, 8
Since (TP TR TS ) =
6 , there must be at least one element a in the
universe (domain Dx ) such that (P (a) R(a) S(a)) is true. Thus, we
can conclude that
x(P (x) R(x) S(x)) = T,
c Chung-Chih Li, Kishan Mehrotra
94
2. Logic
i.e., conclusion C is correct.
Method 2: Proof by using the laws of logic and inference rules for quantified
predicate calculus.
steps
reasons
1. x[P (x) Q(x)]
P1
2. P (a) Q(a)
1, Existential Specification
3. x[Q(x) R(x)]
P2
4. Q(a) R(a)
3, Universal Specification
5. Q(a)
2, Conjunctive Simplification
6. R(a)
4, 5, Modus Ponens
7. x[Q(x) S(x)]
P3
8. Q(a) S(a)
7, Universal Specification
9. S(a)
5, 8Modus Ponens
10. P (a)
2, Conjunctive Simplification
11. P (a) R(a) S(a)
6, 9, 10, conjunction
12. x(P (x) R(x) S(x)) 11, Existential Generalization
2
c Chung-Chih Li, Kishan Mehrotra
2.5. Solutions
95
Solution 47:
1. All members love each other.
2. There are some members who love some of the other members.
3. All members love some members.
4. There are some members who love all of the other members.
Solution 48:
There are many alternatives for the conclusion that can be
derived from the given premises. Let us just write down three of the most
obvious, but not trivial, conclusions and see how to derive them logically from
the premises.
We first define some needed predicates and translate the English sentences
into logical formulas:
P (x) :
Q(x) :
R(x) :
Premises:
P1 :
P2 :
x is an integer.
x is a rational number.
x is a real number.
x[P (x) Q(x)]
R() Q()
steps
reasons
1. x(P (x) Q(x))
P1
2. R() Q()
P2
3. P () Q()
1, Universal Specification
4. Q() P ()
3, Contrapositive
5. Q()
2, Conjunctive Simplification
6. P ()
4, 5, Modus Ponens
7. R()
2, Conjunctive Simplification
8. R() P ()
6, 7, Conjunction
9. x(R(x) P (x)) 8, Existential Generalization
10. P () R()
6, Disjunctive Amplification
11. [P () R()]
10, De Morgans Law
12. x(P (x) R(x)) 11, Existential Generalization
13. x(P (x) R(x))
12, Logical Equivalence
In step 6, is not an integer.
c Chung-Chih Li, Kishan Mehrotra
96
2. Logic
In step 9, there is a real but not rational number.
In step 13, not all numbers are both integer and real.
Solution 49:
x is a librarian.
x knows the system.
We want to use the rule of universal specification and Modus Ponens. If the
unknown premise is Margaret is a librarian, then we can have the following
inference.
P1 :
P2 :
C:
steps
1. x(P (x) Q(x))
2. P (m)
3. P (m) Q(m)
4. Q(m)
reasons
P1
P2
1, Universal Specification
2, 3, Modus Ponens
Solution 50:
Prove
2.5. Solutions
97
Solution 51:
Prove
reasons
Assumption
1, Logical Equivalence
2, Existential Specification
3, De Morgans law
4, Existential Generalization
5, Logical Equivalence
6, De Morgans law
c Chung-Chih Li, Kishan Mehrotra
98
2. Logic
Step 7 gives a conclusion that contradicts our assumption:
xP (x) xQ(x).
Solution 52:
To prove xP (x) xQ(x) x[P (x) Q(x)], by contradiction, assume that
steps
reasons
1. x[P (x) Q(x)]
Assumption
2. x[P (x) Q(x)]
1, Logical Equivalence
3. [P (a) Q(a)]
2, Existential Specification
4. P (a) Q(a)
3, De Morgans law
5. P (a)
4, Conjunctive Simplification
6. xP (x)
5, Existential Generalization
7. xP (x)
6, Logical Equivalence
8. Q(a)
4, Conjunctive Simplification
9. xQ(x)
8, Existential Generalization
10. xQ(x)
9, Logical Equivalence
11. xP (x) xQ(x)
7, 10, Conjunction
12. [xP (x) xQ(x)]
11, De Morgans law
xP (x) xQ(x).
2.5. Solutions
99
Solution 53:
To disprove x[P (x) Q(x)] xP (x) xQ(x), we will
construct a counter example.
Let the universe be {a, b}, and let p, q be two predicates with the truth
values defined in the following table.
a
T
F
P (x)
Q(x)
x[P (x) Q(x)] =
=
=
=
b
F
T
Solution 54:
We already know that 2is irrational. Now, consider the
2
2
number 2 . We dont know whether 2
is irrational or not. But it is
certain that there are only two cases.
2
Case 1:
2 is rational. Let a = 2 and b = 2. Then both a and b are
irrational and ab is rational.
2
2
Case 2:
2 is irrational. Let a = 2 and b = 2.
b
a =
2
2
2 = 2.
Chapter 3
Mathematical Induction
To develop the skill of correct thinking is in the first place
to learn what you have to disregard.
In order to go on, you have to leave out;
this is the essence of effective thinking.
Kurt Godel
3.1. Concepts
3.1
103
Concepts
3.1.1
.......
......
......
......
......
......
.....
..
.....
.....
..
In the domino analogue above, to be able to (1) line up the dominoes, and (2)
identify the first domino in the line are two necessary conditions for knocking
down all of the dominoes. The two conditions are exactly the same necessary
conditions for being able to make use of mathematical induction.
Suppose a given mathematical statement is about a property over the domain
S. If all elements in S can be well ordered, i.e., (1) we can enumerate all elements
in S one by one, and (2) we can identify the first element in the enumeration,
then mathematical induction is very likely to be the approach for verifying the
statement.
In particular, any well-ordered set S can be represented as
S = {s0 , s1 , s2 , . . .}.
In this representation, (1) for any element a in S, there is n N such that
a = sn (all dominoes have been lined up properly), and (2) s0 is identified,
which is called the least element (s0 serves as the first domino in the line to
fall.)
Example 3.1
104
3. Mathematical Induction
numbers, multiples of 5, etc., are typical well-ordered sets that are often encountered in mathematics. They can be represented as:
Natural numbers
Integers
Even numbers
Odd numbers
Multiples of 5
:
:
:
:
:
{1, 2, 3, 4, . . .};
{0, 1, 1, 2, 2, 3, 3, . . .};
{0, 2, 2, 4, 4, . . .};
{1, 1, 3, 3, 5, 5, . . .};
{0, 5, 5, 10, 10, . . .}.
For more advanced mathematical inductive proof, the domain set may be
rational numbers, prime numbers, or any other well-ordered sets.
3.1.2
reasons
proved
proved
1,2, Modus Ponens
proved
3,4, Modus Ponens
proved
5,6, Modus Ponens
..
.
Modus Ponens
proved
Modus Ponens
3.1. Concepts
3.1.3
105
Suppose that the universal set (domain) is the set of non-negative integers, and
P (n) is any property of non-negative integers. We wish to prove that P (n) is
true for all n = 0, 1, 2, . . .; i.e., nP (n). Then the following procedure can be
applied.
Step 1: Prove that P (0) is true. This step is known as the basis step,
and the proved result, P (0) = T , is called the basis of induction.
Step 2: Let n be an arbitrary fixed integer, and assume that P (n) is
true. This assumption is called the weak inductive hypothesis.
Step 3: Use the assumption in step 2 to prove that P (n + 1) is true.
This step is known as the inductive step.
If we can prove the basis in step 1 and the implication in step 3, then we can
claim that P (n) is true for all n = 0, 1, 2, . . .. This method of proof is known as
the mathematical induction of the first form or the weak induction.
Comment: The above proof procedure is an application of the following rule
of inference,
1. P (0)
2. n[P (n) P (n + 1)]
3. nP (n),
where the first assertion, P (0), is proved in step 1, and the second assertion, n[P (n) P (n + 1)], is shown by picking an arbitrary value of n
for P (n) in step 2 and by the implication proved in step 3.
Comment: One should not be confused by the statement in step 2 let n be
an arbitrary fixed integer, and assume that P (n) = T and the goal for
all n P (n) = T that we want to prove. The letter n in step 2 denotes
an instance in the domain, and the letter n in the statement nP (n) is a
variable that ranges over the domain. After step 2, the instance n is fixed.
The following modification makes the difference explicit, but it also makes
the proof awkward, and hence, for simplicity, most textbooks do not use
it.
Step 2: For the inductive hypothesis, we assume that
P (n) = T when n = i for some i in the domain.
Step 3: In the inductive step, we prove that
P (i) P (i + 1).
c Chung-Chih Li, Kishan Mehrotra
106
3. Mathematical Induction
Then we conclude that for all n in the domain, P (n) = T .
3.1.4
Suppose that the universal set (domain) is the set of non-negative integers, and
P (n) is any property of non-negative integers. We wish to prove that P (n) is
true for all n = 0, 1, 2, . . .; i.e., nP (n). The following procedure can be applied.
Step 1: Prove that P (0) is true. This step is known as the basis step,
and the proved result P (0) = T is called the basis of induction.
Step 2: Let n be an arbitrary fixed integer in the domain, and assume
that P (0), P (1), . . . , and P (n) are true. This assumption is called
the strong inductive hypothesis.
Step 3: Use the assumption to prove that P (n + 1) is true. This step
is known as the inductive step.
If we can prove the basis in step 1 and the implication in step 3, then we can
claim that that P (n) is true for all n = 0, 1, 2, . . .. This method of proof is known
as the mathematical induction of the second form, or the strong induction.
Comment: The above proof procedure is an application of the following rule
of inference,
1. P (0)
2. n[(P (0) P (1) P (n)) P (n + 1)]
3. nP (n)
Comment: Sometimes we prove that P (n) is true for n S, where S =
{s0 , s1 , s2 , . . .}, and s0 may not be equal to 0, or in some cases S may not
be a set of numbers at all. If that is the case, the basis step changes to:
Step 1: Show that P (s0 ) is true.
Comment: In some problems, one may claim that P (n) is true for all n
{0, 1, 2, . . .}, but the basis is not P (0), but P (1) or P (2). It is important
to recognize this property; otherwise, incorrect proofs are obtained. See
problem 17 in the problem section of this chapter and its note on page
133.
c Chung-Chih Li, Kishan Mehrotra
3.2
107
3.2.1
Theoretically, any computable function can be defined recursively. In the following we take the point of view that the argument of the function f takes values in
the set of non-negative integers. In general, recursively defined functions have
an infinitely large domain set.
A function f can be recursively defined as follows:
1: Define the value of the function at a few points. For example, f (0), f (1)
are specified. Such values are called the initial values.
2: Define the value of the function at n + 1 in terms of f (0), f (1), . . . , f (n),
and n itself.
3: Write a closing statement that in most cases reads Steps 1 and 2 are the
only two steps that define the function f .
Comment: The essence of recursive definition is its simplicity that helps us to
understand the function being defined, but not its efficiency when we are
asked to actually find the value of the function. We prefer to compute a
function by using its closed-form formula instead of by using its recursive
definition directly. Mathematical induction has nothing to do with finding
a closed-form formula for a given function,3 but it is a powerful technique
for verifying that a given closed-form formula is a correct one for the
recursively defined function.
Example 3.2 Let f be a function taking a non-negative integer as its argument, and be recursively defined as follows.
1: f (0) = 0.
1 Basic
108
3. Mathematical Induction
2: For all n 0, f (n + 1) = f (n) + (n + 1).
We note that
f (0) = 0,
f (1) = f (0) + 1 = 0 + 1 = 1,
f (2) = f (1) + 2 = 0 + 1 + 2 = 3,
f (3) = f (2) + 3 = 0 + 1 + 2 + 3 = 6,
..
.
and conjecture that f (n) is the summation of the first n natural numbers, i.e.,
the closed-form of f is given as
f (n) =
n(n + 1)
, for all n 0.
2
(3.1)
n(n + 1)
.
2
(n + 1)(n + 2)
.
2
(3.2)
4 We do not explicitly define a predicate to be proved true in its domain for this example.
Implicitly, the predicate is:
n(n + 1)
P (n) : f (n) =
,
2
0
and Dn = N . In general, if the predicate is clear from the problem context, we can omit
it to improve the compactness of the proof. Please compare the solutions to Problems 6 and
7. On the other hand, if the subject is not clear, a well-stated predicate and its domain can
help us to move the first step (see Problem 32.) We will explicitly define a predicate in most
solutions in Section 3.5.
109
n(n+1)
.
2
We have
f (n + 1) = f (n) + (n + 1)
n(n + 1)
+ (n + 1)
2
n(n + 1) + 2(n + 1)
=
2
(n + 1)(n + 2)
.
=
2
3.2.2
n(n+1)
,
2
We will introduce an important variant of mathematical induction called structural induction in this subsection. Let us first study how to define a set by using
recursive definitions. The idea is: (1) give a few initial elements for the set, and
(2) specify a few rules to construct new elements by using old elements that are
already in the set.
A set S can be recursively defined as follows:
1: Identify a few elements of the set S.
2: Explain how to obtain new elements of the set S from the old elements of
the set.
3: Write a closing statement that in most cases reads (1) and (2) are the
only two ways to generate elements of the desired set S.
Example 3.3
Let set S be a set of strings of 1s and 0s and be recursively
defined as follows:
1: 1 S, 100 S.
2: If s S, then 11s S.
3: If s S, then 00s S.
4: Nothing but strings generated according to rules 1, 2, and 3 are
elements in S.
The following table shows some elements in the set and the rules used to
c Chung-Chih Li, Kishan Mehrotra
110
3. Mathematical Induction
elements
1
001
1100111
001100001
11001100001
00001100001
rules used
1
1, 3
1, 2, 3, 2
1, 3, 3, 2, 3
1, 3, 3, 2, 3, 2
1, 3, 3, 2, 3, 3
111
3.3
Nested Induction
112
3. Mathematical Induction
by def (iii)
by the hypothesis
A(n + 1, m)
=
>
A(n + 1, m 1) + 1
A(n, A(n + 1, m 2)) + 1
A(n + 1, m 2) + 1
by def (iii)
by the hypothesis
A(n + 1, m)
..
.
A(n + 1, m 2) + 2
A(n + 1, m)
=
=
>
A(n + 1, m m) + m
A(n + 1, 0) + m
A(n, 1) + m
1+m
by the hypothesis
3.3.1
We use the previous example, and define two-place and one-place predicates Q
and P , respectively, over natural numbers as follows.
Q(n, m) =
A(n, m) > m;
P (n)
= mQ(n, m).
113
Thus, we can rewrite the theorem according the following logic equivalences.
nm[A(n, m) > m] nmQ(n, m) nP (n).
To prove nP (n) by mathematical induction, we apply the inference rule we
have been familiar with:
P (0)
n[P (n) P (n + 1)]
nP (n).
Use the definition of P , the inference above can be rewritten as:
mQ(0, m)
n[mQ(n, m) mQ(n + 1, m)]
nmQ(n, m).
Therefore, in the inductive proof we just shown, the inductive basis is mQ(0, m)
and the inductive hypothesis is mQ(n, m).
114
3. Mathematical Induction
3.4
Problems
The assertion
X
2k = 2n+1 ,
n 1
1kn
2k = 2n+1 .
1kn
2k = 2 2n+1
1kn+1
2k = 2n+1+1 .
1kn+1
1: a0 = 2, and a1 = 3.
2: For n 2, define an = 2an1 an2 .
We are given the following assertion:
There is no element in the sequence equal to 1.
We present the following proof. What is wrong with the proof?
If we can prove that a0 6= 1 and the sequence is increasing, i.e., for all
n, an+1 > an , then we can claim that no element in the sequence can be
equal to 1.
c Chung-Chih Li, Kishan Mehrotra
3.4. Problems
115
Inductive Basis:
Inductive Hypothesis:
Inductive Step:
esis, we have
1. Use the
(3.3)
Problem 5:
1
1
1
1
+
+
+ +
.
1 4 4 7 7 10
(3n 2) (3n + 1)
P
notation to express the expression above.
1. Use the
(3.4)
Problem 7:
Prove that
X
1kn
Problem 8:
3k =
0kn
Problem 9:
(3n+1 1)
.
2
k2 =
n(n + 1)(2n + 1)
.
6
(3.5)
116
3. Mathematical Induction
Problem 10:
k(k 1) =
1kn
Problem 11:
(3.6)
k(k 1)(k 2) =
1kn
Problem 12:
for
1
(n + 1)n(n 1).
3
1
(n + 1)n(n 1)(n 2).
4
(3.7)
Problem 13: Prove the closed form obtained for (3.8) by mathematical
induction .
Problem 14:
(2)k =
0kn
Problem 15:
Problem 16:
1
1
=1
.
k(k + 1)
n+1
Problem 17:
1
(1 2n+1 ).
3
2k + 1
1
=1
.
k 2 (k + 1)2
(n + 1)2
1in
3.4. Problems
Problem 19:
117
Let x be any real number and x > 1. Prove that for all n > 1
(1 + x)n > 1 + nx.
Problem 20:
that
x, xx , x(x ) , x(x
(xx )
,...
is an increasing sequence.
Problem 21: Prove by mathematical induction that if n is any positive odd
integer, then 1 + 3n is divisible by 4.
Problem 22: Prove that the sum of the cubes of any three consecutive
integers is divisible by 9.
Problem 23:
1
if n is even,
(1)n =
1
if n is odd.
118
3. Mathematical Induction
Problem 27:
!n
!n !
1
1+ 5
1 5
fn =
.
2
2
5
Problem 28: Let S be a set with n elements. Prove by mathematical induction that the total number of subsets of S having exactly two elements
is n(n 1)/2.
Problem 29: Let p(n) be the maximum number of intersection points of n
distinct lines in the plane. Prove by mathematical induction that for all
integers n 2, p(n) = n(n 1)/2.
q
Problem 30: Let x1 = 1 and xn+1 = x2n + x12 . Prove by mathematical
n
induction that for all n 1,
1 xn n.
Problem 31:
n
H2 n 1 +
,
2
n 0.
Problem 32: Let denote the empty string. Let A be any finite nonempty
set. A palindrome over A can be defined as a string that reads the same
forward as backward. For example, mom and dad are palindromes
over the set of English alphabets.
We define a set S as follows:
1. S
2. a A, a S
3. a A x S, axa S
4. All the elements in S must be generated by the rules above.
Prove by structural induction that S equals the set of all palindromes
over A.
c Chung-Chih Li, Kishan Mehrotra
3.4. Problems
119
120
3.5
3. Mathematical Induction
Solutions
Solution 1:
for n = 1,
2k = 21 = 2,
1k1
Solution 2:
The proof is incorrect. The proof shows that a0 6= 1 and claims
that it is the basis of the induction. According to the hypothesis given in the
proof, the correct basis is a0 6= 1 and a1 > a0 .
To see the mistake more clearly, lets change the initial values of the sequence
to a0 = 3, and a1 = 2. We thus have a2 = 1. The inductive basis only proves
that a0 6= 1, but does not mention the problem that a0 > a1 .
2
Solution 3:
1.
1 1! + 2 2! + 3 3! + + n n! =
k k!.
1kn
2. In order to obtain a closed form for the sum above, we note that k =
(k + 1) 1 for any k. Thus,
1 1! + 2 2! + 3 3! + + n n!
= (2 1! 1!) + (3 2! 2!) + (4 3! 3!) + + ((n + 1) n! n!)
= (2! 1!) + (3! 2!) + (4! 3!) + + ((n + 1)! n!)
= (n + 1)! 1.
Therefore,
k k! = (n + 1)! 1.
(3.9)
1kn
3.5. Solutions
121
Solution 4:
Recall that our goal is to prove that equation (3.9) holds for
all values of n 1.
by mathematical induction:
Inductive Basis:
n = 1.
X
k k! = 1 1! = 1,
1k1
(1 + 1)! 1 = 1.
That means both sides of (3.9) are equal to 1.
Inductive Step:
X
k k! =
1kn+1
k k! + (n + 1) (n + 1)!
1kn
= (n + 1)! 1 + (n + 1) (n + 1)!
= (n + 2) (n + 1)! 1
= (n + 2)! 1.
[by IH]
Solution 5:
1.
1
1
1
1
+
+
+ +
=
1 4 4 7 7 10
(3n 2) (3n + 1)
X
1kn
1
.
(3k 2) (3k + 1)
1
1
1 3k + 1 3k + 2
1
=
3 3k 2 3k + 1
3 (3k 2)(3k + 1)
1
=
.
(3k 2)(3k + 1)
c Chung-Chih Li, Kishan Mehrotra
122
3. Mathematical Induction
1
1
1
1
+
+
+ +
1 4 4 7 7 10
(3n 2) (3n + 1)
1 1 1
1 1 1
1 1
1
1
1
1
= ( ) + ( ) + ( ) + + (
)
3 1 4
3 4 7
3 7 10
3 3n 2 3n + 1
1 1 1 1 1 1
1
1
1
=
+ +
+ +
3 1 4 4 7 7 10
3n 2 3n + 1
1
1
1
.
=
3
3n + 1
1
1
=
(3k 2) (3k + 1)
3
1
3n + 1
(3.10)
Solution 6:
Inductive Basis:
n = 1.
1
1
1
= ,
312 31+1
4
1
1
1
RHS =
1
= .
3
31+1
4
LHS =
Inductive Hypothesis:
X
1kn
Suppose
1
1
=
(3k 2) (3k + 1)
3
1
3n + 1
3.5. Solutions
123
Inductive Step:
X
1kn+1
1
(3k 2) (3k + 1)
1
1
+
(3k 2) (3k + 1)
(3n + 1) (3n + 4)
1kn
1
1
1
=
1
+
[by IH]
3
3n + 1
(3n + 1) (3n + 4)
1
1
3
=
1
+
3
3n + 1 (3n + 1) (3n + 4)
1
3n + 4 3
=
1
3
(3n + 1) (3n + 4)
1
3n + 1
1
=
3
(3n + 1) (3n + 4)
1
1
=
1
3
3n + 4
=
Solution 7:
Let Dn = N, and 5
X
1
P (n)6 :
k(k + 1) = n(n + 1)(n + 2).
3
1kn
Inductive Basis:
n = 1.
12=
Therefore, P (1) = T.
1
(1 2 3).
3
[The Basis Holds.]
5 Beginning from this problem and onwards, we will explicitly define the predicate and its
domain.
6 Note: P (n) is a predicate; for any fixed value of n, its value is either T rue or F alse. It
does not represent the sum or its value on the other side of the equality, i.e.,
X
1
P (n) 6=
k(k + 1) and P (n) 6= n(n + 1)(n + 2).
3
1kn
124
3. Mathematical Induction
Inductive Step: We want to prove that P (n + 1) = T rue. In other
words, we want to prove that the following equality is correct:
X
1
k(k + 1) = (n + 1)(n + 2)(n + 3).
3
1kn+1
k(k + 1) =
1kn+1
k(k + 1) + (n + 1)((n + 1) + 1)
1kn
=
=
=
=
=
=
n(n + 1)(n + 2)
+ (n + 1)(n + 2)
3
n(n + 1)(n + 2)
+ (n + 1)(n + 2)
3
n(n + 1)(n + 2) + 3(n + 1)(n + 2)
3
(n + 1)(n + 2)(n + 3)
3
(n + 1)((n + 1) + 1)((n + 1) + 2)
3
1
(n + 1)(n + 2)(n + 3).
3
P (n + 1) = T.
Solution 8:
[by IH]
Let Dn = N, and
X
P (n) :
3k =
0kn
Inductive Basis:
n = 1.
(3n+1 1)
.
2
3k =30 + 31 = 4,
0k1
(31+1 1) 9 1
=
= 4.
2
2
Therefore, P (1) = T.
Inductive Hypothesis:
0kn
3k =
(3n+1 1)
.
2
3.5. Solutions
125
Inductive Step:
to prove that
3k =
0kn+1
(3n+2 1)
.
2
3k =
3k + 3n+1
0kn
0kn+1
n+1
+ 3n+1
[by IH]
3n+1 1 + 2 3n+1
2
3 3n+1 1
2
3n+1+1 1
2
3n+2 1
.
2
=
=
=
=
P (n + 1) = T.
Solution 9:
Let Dn = N, and
P (n) :
k2 =
1kn
Inductive Basis:
1
n(n + 1)(2n + 1).
6
n = 1.
12 =
1
123
6
1
i(i + 1)(2i + 1).
6
c Chung-Chih Li, Kishan Mehrotra
126
3. Mathematical Induction
Inductive Step:
X
Consider P (i + 1),
k 2 = 12 + 22 + + i2 + (i + 1)2
1ki+1
k 2 + (i + 1)2
1ki
=
=
=
=
=
1
i(i + 1)(2i + 1) + (i + 1)2
[by IH]
6
1
(i + 1)(i(2i + 1) + 6(i + 1))
6
1
(i + 1)(2i2 + 7i + 6)
6
1
(i + 1)(i + 2)(2i + 3))
6
1
(i + 1)((i + 1) + 1)(2(i + 1) + 1)).
6
P (i + 1) = T.
Solution 10:
Let Dn = N, and
P (n) :
k(k 1) =
1kn
Inductive Basis:
1
(n + 1)n(n 1).
3
n = 1.
1 (1 1) =
1
(1 + 1) 1 (1 1).
3
1ki
1
(i + 1)i(i 1).
3
3.5. Solutions
127
Inductive Step:
Consider P (i + 1),
X
k(k 1) =
k(k 1) + (i + 1)((i + 1) 1)
X
1ki+1
1ki
1
(i + 1)i(i 1) + i(i + 1)
3
1
= (i + 1)i(i 1 + 3)
3
1
= (i + 1)i(i + 2).
3
P (i + 1) = T.
[by IH]
Solution 11:
Let Dn = N, and
X
1
P (n) :
k(k 1)(k 2) = (n + 1)n(n 1)(n 2).
4
1kn
Inductive Step:
X
1ki+1
1
(i + 2)(i + 1)i(i 1).
4
k(k1)(k 2)
1ki+1
1ki
1
= (i + 1)i(i 1)(i 2) + (i + 1)i(i 1)
4
1
= (i + 1)i(i 1) ((i 2) + 4)
4
1
= (i + 1)i(i 1)(i + 2).
4
[by IH]
128
3. Mathematical Induction
P (i + 1) = T.
Solution 12:
Lets observe the following properties first. Let f (k) and g(k)
be two functions of k, and a be any constant. We have the following equalities.
X
X
X
(f (k) + g(k)) =
f (k) +
g(k).
1kn
1kn
1kn
af (k) = a
1kn
f (k)
1kn
k3 =
1kn
k(k 1)(k 2) + 2
1kn
k(k 1) +
1kn
k2 .
1kn
1
n(n + 1)[3(n 1)(n 2) + 8(n 1) + 2(2n + 1)]
12
1
=
n(n + 1)(3n2 9n + 6 + 8n 8 + 4n + 2)
12
1
=
n(n + 1)(3n + 3n2 )
12
1
= n2 (n + 1)2 .
4
=
Solution 13:
Let Dn = N, and
X
1
P (n) :
k 3 = n2 (n + 1)2 .
4
1kn
3.5. Solutions
129
1 2
1 (1 + 1)2 .
4
Inductive Hypothesis:
k3 =
1ki
Inductive Step:
X
1 2
i (i + 1)2 .
4
Consider P (i + 1),
X
k3 =
k 3 + (i + 1)3
1ki+1
1ki
=
=
=
=
1 2
i (i + 1)2 + (i + 1)3
4
1
(i + 1)2 (i2 + 4(i + 1))
4
1
(i + 1)2 (i2 + 4i + 4)
4
1
(i + 1)2 (i + 2)2 .
4
Thus, P (i + 1) = T.
Therefore, n Dn , P (n) = T.
Solution 14:
[by IH]
P (n) :
(2)k =
0kn
1
(1 2n+1 ).
3
130
3. Mathematical Induction
Inductive Hypothesis: Let i Dn , and assume P (i) = T , i.e.,
X
1
(2)k = (1 2i+1 ).
3
0ki
0ki
=
=
=
=
=
=
=
=
i+1ki+2
1
(1 2i+1 ) + (2)i+1 + (2)i+2
[by IH]
3
1
[1 2i+1 + 3(2)i+1 + 3(2)i+2 ]
3
1
[1 2i+1 + 3(2)i+1 + 3(2)(2)i+1 ]
3
1
[1 2i+1 + 3(2)i+1 6(2)i+1 ]
3
1
[1 (1 3 + 6) 2i+1 ]
3
1
(1 (2)2 (2)i+1 ) since i + 1 is even
3
1
(1 (2)i+3 )
3
1
(1 2i+3 ) since i + 3 is even.
3
P (i + 2) = T.
Solution 15:
X
1k1
RHS = 1
1
1
=
= 1/2.
k(k + 1)
12
1
= 1/2.
1+1
3.5. Solutions
131
Inductive Hypothesis:
X
1kn
Inductive Step:
X
1kn+1
1
1
=1
.
k(k + 1)
n+1
To prove P (n + 1) is true.
X
1
1
1
=
+
k(k + 1)
k(k + 1) (n + 1)(n + 2)
1kn
1
1
+
n + 1 (n + 1)(n + 2)
(n + 2) 1
=1
(n + 1)(n + 2)
n+1
=1
(n + 1)(n + 2)
1
=1
n+2
=1
Therefore, P (n + 1) is true.
[by IH]
Solution 16:
X
1kn
Inductive Basis:
2k + 1
1
=1
.
k 2 (k + 1)2
(n + 1)2
n = 1.
X
1k1
2k + 1
2+1
= 2 2 = 3/4.
2
+ 1)
1 2
k 2 (k
1
= 3/4.
(1 + 1)2
k 2 (k
132
3. Mathematical Induction
Inductive Step:
X
1kn+1
To prove P (n + 1) is true.
X
2k + 1
2k + 1
2(n + 1) + 1
=
+
k 2 (k + 1)2
k 2 (k + 1)2
(n + 1)2 (n + 2)2
1kn
=1
=1
=1
=1
=1
=1
2(n + 1) + 1
1
+
2
(n + 1)
(n + 1)2 (n + 2)2
2
(n + 2) 2(n + 1) 1
(n + 1)2 (n + 2)2
2
n + 4n + 4 2n 2 1
(n + 1)2 (n + 2)2
2
n + 2n + 1
(n + 1)2 (n + 2)2
(n + 1)2
(n + 1)2 (n + 2)2
1
(n + 2)2
Therefore, P (n + 1) is true.
[by IH]
Solution 17:
Let Ai denote a set for any i N, and P (n) be the predicate,
for n {2, 3, 4, . . .},
\
[
P (n) :
Ai =
Ai .
1in
1in
Inductive Basis:
Inductive Step:
Ai =
Ai .
1ik
Let n = k + 1.
[
Ai = (
1ik+1
1ik
Ai ) Ak+1 .
3.5. Solutions
If we take (
133
S
1ik
Ai ) Ak+1 = (
1ik
Ai ) Ak+1 .
1ik
Ai ) Ak+1 = (
1ik
Ai ) Ak+1
1ik
Ai .
1ik+1
That proves P (k + 1) = T .
Therefore, n 2, P (n) is T .
Note: If we want to claim that [n 1, P (n)] is also true, we have to prove the
special case, n = 1, and the inductive basis, n = 2, separately. It is trivial
to prove P (1) is true, but P (1) = T is not the basis of the induction. We
have to prove P (2) = T as the inductive basis, because P (1) does not
imply P (2).
Solution 18:
Let Dn = N, and
P (n) : (a b)|(an bn ),
134
3. Mathematical Induction
Inductive Step:
Solution 19:
Inductive Basis:
n = 2.
Inductive Step:
(1 + x)i+1 = (1 + x)i (1 + x)
> (1 + ix)(1 + x)
= 1 + (i + 1)x + ix
3.5. Solutions
135
Note: The given condition x > 0 and the inductive hypothesis are both needed
to claim that
(1 + x)i (1 + x) > (1 + ix)(1 + x).
One can easily find a counter example if x < 0.
Solution 20:
x, xx , x(x ) , x(x
(xx )
,...
as
a1 , a2 , a3 , . . . , . . .
. Thus,
a1 = x,
a2 = xx = xa1 ,
x
a3 = x(x
= x a2 ,
1. Suppose that 0 < x < 1. In this case, we know that log x < 0. Since
0 < x < 1, we have log x < x log x. It follows that x < xx .
2. If x > 1, then it is clear that x < xx if x > 1.
Thus, in both cases, we have
a1 < a2 ,
P (1) = T rue.
[The Basis Holds.]
Inductive Hypothesis:
136
3. Mathematical Induction
Inductive Step: We want to prove P (i + 1) is also true. Using the
hypothesis, we have
ai < ai+1 xai < xai+1
P (i + 1) = T.
because x > 1
Solution 21:
Let Dn be the set of all positive odd integers, i.e, Dn =
{1, 3, 5 . . .}, and define
P (n) : 1 + 3n is divisible by 4.
Inductive Basis: n = 1. We choose 1 as the base because 1 is the first
element in Dn . Apparently, 1 + 31 = 4, which is divisible by 4. Therefore,
P (1) = T.
[The Basis Holds.]
Inductive Hypothesis: Assume P (n) = T , i.e., 1 + 3n is divisible by
4. Note: n is a positive odd integer.
Inductive Step: We want to prove P (n+2) = T , i.e., we want to prove
that 1 + 3n+2 is divisible by 4.
Note: We choose n + 2 instead of n + 1 because n + 2 is the odd number
next to n fixed in the inductive hypothesis, whereas n + 1 is not an
element in Dn .
From the inductive hypothesis, we can assume that 1 + 3n = 4k, where k
is an integer. We have
1 + 3n+2 = 1 + 9 3n
= (1 + 3n ) + 8 3n
= 4k + 8 3n
= 4(k + 2 3n ).
Because k and n are integers, k + 2 3n must be an integer. Therefore,
1 + 3n+2 is divisible by 4, and hence P (n + 2) = T.
[The Inductive Step Holds.]
Therefore, P (n) is true for all n in Dn .
3.5. Solutions
137
Solution 22:
The domain of this problem includes both positive and negative integers. The easiest way is to split the domain into two parts: positive
integers and negative integers. Then, we prove the statement by mathematical
induction in the two sub-domain separately.
(1) Let Dn = {0, 1, 2, 3, . . .} Define:
n = 0.
03 + 13 + 23 = 9.
P (0) is true.
Inductive Hypothesis:
Prove P (i + 1) is true.
[by IH]
= 9(k + i + 3i + 3)
Because k + i2 + 3i + 3 is an integer, therefore
n = 0.
03 + 13 + 23 = 9.
P (0) is true.
138
3. Mathematical Induction
Inductive Hypothesis:
Prove P (i 1) is true.
[by IH]
= 9(k i + 3i 3)
Because k i2 + 3i 3 is an integer, therefore
Putting the two domains together, we have that the sum of the cubes of any
three consecutive integers is divisible by 9.
2
Solution 23:
We first prove that the statement is correct in the non-negative
part of the domain. Let Dn = {0} N, and define
P (n) : (1) =
1
1
if n is even,
if n is odd.
n = 0.
n = i.
(1)i =
c Chung-Chih Li, Kishan Mehrotra
1
1
if i is even,
if i is odd.
3.5. Solutions
139
Inductive Step:
n = i + 1.
(1)i+1 = 1 (1)i
1 1
=
1 1
1
if
=
1
if
1
if
=
1
if
Therefore, P (i + 1) is true.
if i is even,
if i is odd.
i is even,
i is odd.
i + 1 is odd,
i + 1 is even.
[The Inductive Step Holds.]
We have proved that the predicate is true for all non-negative integers. We
can use the same technique shown in the previous problem, i.e., we can further
prove that the statement is correct for the other part of the domain (negative
integers). Or, we can use the result we just got and the following arguments.
From the proved result above, if n is a non-negative integer, we know that
2n is even and (1)2n = 1. Observe the following fact: if n N, then
(1)n =
1
(1)2n
=
= (1)n .
n
(1)
(1)n
Therefore, we can claim that for all i Z, the predicate P (i) is always true.
That proves the theorem.
2
The following is another proof for the above problem. It is a bit awkward,
but it shows how to reorder the domain so we can examine the entire domain
without missing any element of it. Lets consider the following ordered sequence,
Z : 0, 1, 1, 2, 2, 3, 3, 4, 4, . . .
It is clear that any number in Z must be in the sequence Z somewhere. Let zi
denote the ith number in Z, where i 1. Let Dn = N. Define
1
if zn is even,
zn
P (n) : (1) =
1
if zn is odd.
Thus, our original problem can be viewed as:
Prove that for all n Dn , P (n) is true.
Inductive Basis:
n = 1.
140
3. Mathematical Induction
Inductive Hypothesis:
n = i.
(1)zi =
1
1
if zi is even,
if zi is odd.
Inductive Step: n = i + 1.
There are only two possible values for zi+1 in terms of zi , i.e., .zi+1 = zi
if zi is positive or zi+1 = zi + 1 if zi is negative. We will discuss this by
cases.
case 1: zi+1 = zi .
(1)zi+1 = (1)zi =
1
=
(1)zi
1/1
=1
1/ 1 = 1
if zi is even,
if zi is odd.
From Z we know that in this case if zi is even, then zi+1 is even, and
if zi is odd, then zi+1 is odd. Therefore,
1
if zi+1 is even,
(1)zi+1 =
1
if zi+1 is odd.
case 2: zi+1 = zi + 1.
(1)zi+1 = (1)zi +1 =
1
=
(1)zi
1/1 = 1 if zi is even,
1/ 1 = 1 if zi is odd.
From Z we know that in this case if zi is even, then zi+1 is odd, and
if zi is odd, then zi+1 is even. Therefore,
1
if zi+1 is even,
(1)zi+1 =
1
if zi+1 is odd.
In both cases, P (i + 1) is true.
Solution 24:
3.5. Solutions
141
Inductive Basis:
n = 0, 1, 2.
c(0) = 0 0 + 1 = 1.
c(1) = 1 1 + 1 = 1.
c(2) = 4 2 + 1 = 3.
To prove that P (n + 1) = T .
To calculate the value of c(n+1), we can use the values of c(n), c(n1), and
c(n 2) given in the strong inductive hypothesis, because the arguments,
n, n 1, and n 2, are in the domain of the inductive hypothesis. We
have:
c(n) = n2 n + 1,
c(n 1) = (n 1)2 (n 1) + 1,
c(n 2) = (n 2)2 (n 2) + 1.
Therefore,
c(n + 1)
= 3c(n) 3c(n 1) + c(n 2)
= 3(n2 n + 1) 3((n 1)2 (n 1) + 1) + (n 2)2 (n 2) + 1
= 3n2 3n + 3 3n2 + 9n 9 + n2 5n + 7
= n2 + n + 1
= (n2 + 2n + 1) (n + 1) + 1
= (n + 1)2 (n + 1) + 1.
We have the result above by using the definition of c(n + 1) and the
hypothesis, and the result agrees with the given closed-form formula for
c(n + 1).
[The Inductive Step Holds.]
This completes the proof.
Solution 25:
142
3. Mathematical Induction
following.
n 0[b(n + 2) + 2b(n + 1) + b(n) = 0]
n 0[b(n + 2) = 2b(n + 1) b(n)]
n 2[b(n) = 2b(n 1) b(n 2)].
Thats why this problem has to state that b(n) is defined by the equation after
first two values. Please compare this problem to the previous one7 .
Define b(0) = b(1) = 1. Let Dn = N0 and
P (n) : b(n) = (1 2n)(1)n .
Inductive Basis:
n = 0, and n = 1.
We have to take P (0) and P (1) as our basis, because both b(1) and
b(2) are undefined, and hence b(0) and b(1) cannot be obtained by using
the equation b(n) = 2b(n 1) b(n 2) in the inductive step. [Same
reason for the next problem.]
b(0) = 1 = (1 0)(1)0 .
b(1) = 1 = (1 2)(1)1 .
P (0) = P (1) = T.
Let n = i + 1.
b(n) = b(i + 1)
= 2b((i + 1) 1) b((i + 1) 2)
= 2b(i) b(i 1)
= 2(1 2i)(1)i (1 2(i 1))(1)i1
= 2(1 2i)(1)i (3 2i)(1)i1
= (1)i1 (2(1 2i)(1) (3 2i))
= (1)i1 (1 2i)
= (1)2 (1)i1 (1 2 2i)
= (1 2(i + 1))(1)i+1
= (1 2n)(1)n .
7 One
by using the given equation directly without adjusting the domain of n. Can we define a
function based on its future values instead of its previous values? Theoretically, the answer is
yes, but thats beyond the scope of our interest of using mathematical induction.
3.5. Solutions
143
P (i + 1) = T.
Solution 26:
Inductive Basis:
n = 0, and n = 1.
b(0) = 1 = (1 + 0)(1)0 .
b(1) = 3 = (1 + 2)(1)1 .
P (0) = P (1) = T.
Let n = i + 1.
b(n) = b(i + 1)
= 2b((i + 1) 1) b((i + 1) 2)
= 2b(i) b(i 1)
= 2(1 + 2i)(1)i (1 + 2(i 1))(1)i1
= 2(1 + 2i)(1)i (2i 1)(1)i1
= (1)i1 (2(1 + 2i)(1) (2i 1))
= (1)i1 (3 + 2i)
= (1)2 (1)i1 (1 + 2 + 2i)
= (1 + 2(i + 1))(1)i+1
= (1 + 2n)(1)n .
P (i + 1) = T.
Solution 27:
Given
f0 = 0, f1 = 1,
fn = fn1 + fn2 , for n 2.
c Chung-Chih Li, Kishan Mehrotra
144
3. Mathematical Induction
!n
!n !
1
1+ 5
1 5
fn =
.
2
2
5
Inductive Basis:
1
5
n=0:
0
1+ 5
2
0
1 5
2
1
5
(1 1)
= 0 = f0 .
n=1:
1
5
1
1+ 5
2
1
1 5
2
1
5
1
5
1+ 5
2
1 5
2
1+ 51+ 5
2
= 1 = f1
[The Basis Holds.]
Inductive Hypothesis:
!k
!k
1 5
1
1+ 5
.
fk =
2
2
5
3+ 5
1 5
3 5
1+ 5
=
,
and
=
2
2
2
2 .
fn+1 = fn + fn1
n n
1+ 5
= 15
12 5
+
2
1
5
1
5
1
5
1
5
n
1+ 5
2
n1
1+ 5
2
n1
1+ 5
2
n+1
1+ 5
2
n1
1+ 5
2
3+ 5
2
1
5
2
1+ 5
2
n
1 5
2
n1
1 5
2
n+1
1 5
2
n1
1+ 5
2
n1
1 5
2
n1
1 5
2
3 5
2
n1
1 5
2
2
1 5
2
3.5. Solutions
145
Solution 28:
Prove by induction that the total number of subsets having
exactly two elements in a set of n elements is n(n 1)/2.
It is clear that if A is a set of 2 elements, the only subset of A with two
elements is A itself. And since 1 = 2(2 1)/2, the basis holds.
Suppose we have a set A with elements, and let n 2. And suppose we
already know by the inductive hypothesis that there are n(n1)/2 many subsets
of A with 2 elements. Now, we add a new element a into A, and examine the
power set of the new A. What are those subsets with 2 elements? They are the
old subsets with 2 elements plus every singleton subset of the old A union with
{a}. Apparently, the old A has n-many singleton subsets. Therefore, the new
A has (n(n 1)/2 + n)-many subsets with 2 elements, where the new size of A
is n + 1. And
n(n 1)
(n + 1)n
+n=
.
2
2
This proves the inductive step and completes the proof of this problem.
One may also want to define a recurrent relation according to the discussion
above, and prove the result by induction more formally. The following is a proof.
Let t(n) be the number of subsets with 2 elements of a set with n elements.
Apparently, t(0) = 0. If n 1, we can recursively define t(n) as follows. For
n 1,
t(n) = t(n 1) + (n 1).
Now, lets prove the claim that for all n 0, t(n) = n(n 1)/2. Define
Dn = N0 , and
1
P (n) : t(n) = n(n 1).
2
Inductive Basis:
n = 0.
t(0) = 0 =
1
0 (0 1).
2
Therefore, P (0) = T.
1
n(n 1).
2
c Chung-Chih Li, Kishan Mehrotra
146
3. Mathematical Induction
Inductive Step:
Let n = i + 1.
Therefore, for any set with n elements, the set has n(n 1)/2-many subsets
having exactly 2 elements.
2
Solution 29:
Prove by induction that for all integers n 2 the set of all
points of intersection of n distinct lines in the plane has no more than n(n1)/2
elements. Give examples showing exactly that many, and also fewer.
Suppose we already have n lines on the plane with the maximum number
of intersection points. If we draw a new line on the plane, we cannot introduce
more than n new intersection points. Therefore, if p(n) is the maximum number
of the intersection points of n distinct lines, the recurrent relation will be
p(n) = p(n 1) + (n 1).
This is exactly the same as the recurrence relation in the previous problem. We
skip the proof here.
2
Solution 30:
P (n) : 1 xn n.
Inductive Basis:
n = 1. x1 = 1, and
1 x1 1.
Inductive Step:
1 xn n.
To prove P (n + 1) is true.
3.5. Solutions
147
1 xn n 1 x2n n
1
1
1
1 + 2 x2n + 2 n + 2 .
xn
xn
xn
Because 1 x2n
1
x2n
1, we have
11+
1
x2n
and n +
1
n + 1.
x2n
Therefore,
1
1
1
x2n + 2 n + 2 n + 1
2
xn
xn
xn
1
1 x2n + 2 n + 1
xn
11+
1 x2n+1 n + 1
1 xn+1 n + 1.
P (n + 1) is true.
Method 2:
Inductive Step:
To prove P (n + 1) is true.
1
n
1 x2n n
1
1
2 1
n
xn
1
xn
1. Moreover,
(3.11)
(3.12)
1
1
x2n + 2 n + 1.
n
xn
Because 1 1 + n1 , we have
1
n+1
x2n
1
1 x2n + 2 n + 1
xn
1 x2n +
1 x2n+1 n + 1
1 xn+1 n + 1.
P (n + 1) is true.
148
3. Mathematical Induction
Solution 31:
Inductive Basis:
n = 0.
H2 n = H1 =
X 1
1
0
= 1+ .
i
1
2
1i1
Assume H2n 1 +
n
2
Inductive Step:
H2n+1 = H22n
1 1
1
1
1
1
= + + + n + n
+
+ + n
1 2
2
2 + 1 2n + 2
2 + 2n
1
1
1
+
+ + n
= H2 n + n
2 + 1 2n + 2
2 + 2n
n
1
1
1
1+ + n
+
+ + n
2
2 + 1 2n + 2
2 + 2n
2n
{
n
1
1
1
1+ + n
+ n
+ + n
2
2 + 2n
2 + 2n
2 + 2n
z
=1+
n
2n
+ n
2
2 + 2n
=1+
n+1
2
}|
Solution 32:
Let A denote the set of all possible strings made from A,
where A . Let range over A , and let || denote the length of . We will
prove the theorem by mathematical induction on the length of strings. Let us
first define the domain and the predicate P (n).
Dn : {0, 1, 2, 3, . . .},
P (n) : A , [(|| = n) ( S is a palindrome)].
c Chung-Chih Li, Kishan Mehrotra
3.5. Solutions
149
For any length n, P (n) is true, which means that S is the set of palindromes
over A.
Note: The proof given above uses the original form of mathematical induction.
We havent seen the power of structural induction yet. Please compare
the following proof with the previous one. We will see the full power of
structural induction in the last two problems of this chapter.
Method 2: Structural induction
Ds : A ,
P (s) : (s S s is a palindrome).
c Chung-Chih Li, Kishan Mehrotra
150
3. Mathematical Induction
Inductive Basis: By the definitions of S and palindrome, S and it
is a palindrome. Thus, P () = T.
[The Basis Holds.]
Inductive Hypothesis:
s S s is a palindrome.
Inductive Step:
Solution 33:
for all , S,
Inductive Basis:
= a, and = b.
3.5. Solutions
151
R(())
R()R()
R()R()R()
R()(R()R())
R()R()
[by IH]
[by IH]
[by IH]
Solution 34:
We will use the result proved in the previous problem: for all , S,
R() = R()R().
(3.13)
R(R()) = R(R()R())
= R(R())R(R())
=
by (3.13)
by (3.13)
[by IH]
2
c Chung-Chih Li, Kishan Mehrotra
152
3. Mathematical Induction
Solution 35:
We will prove this problem by structural mathematical induction. For convenience, let () denote the number of as in , and () the number of bs in
. We shall prove that, for every A, () = ().
Inductive Basis:
Basis Holds.]
= . It is clear that () = () = 0.
Inductive Hypothesis:
() = () = n.
[The
Inductive Step:
By rule 2: = ab. Clearly, () = () = m + 1.
By rule 3: = . Thus, () = () = m + n and () = () =
m + n.
Thus, () = () in all cases.
Therefore, if A, then () = ().
Solution 36:
As with the previous problem, let () denote the number
of as in , and () the number of bs in . We shall prove that, if A, then
for any prefix of we have () ().
Inductive Basis: = . The only prefix of is itself. It is clear
that () = () = 0. Thus, the inductive basis holds.
[The Basis
Holds.]
Inductive Hypothesis: Fix , A, and assume that, for any , if
is a prefix of or , then () ().
Inductive Step:
By rule 2: We obtain a new string = ab. Given a prefix of , we
have the following cases.
1. = . In this case, it is clear that () ().
2. = a 0 , where 0 is a prefix of . Thus, () = (a 0 ) = ( 0 )+
1 and () = (a 0 ) = ( 0 ). By the inductive hypothesis,
( 0 ) ( 0 ). Thus, ( 0 ) + 1 ( 0 ), and hence () ().
3. = = ab. In this case, () = () + 1 and () = () + 1.
By the inductive hypothesis, () (). Thus, () ().
c Chung-Chih Li, Kishan Mehrotra
3.5. Solutions
153
Chapter 4
Relations
I wanted certainty in the kind of way in which
people want religious faith.
I thought that certainty is more likely to be found in
mathematics than elsewhere.
Bertrand Russell
4.1
157
The concept of relation is widely used in everyday life. For example, Sean and
Leon are brothers carries the concept of relation brother that Sean and Leon
have. Or, Dennis is the father of Sean carries the concept of relation father.
For some relations, we can exchange the subject and object in the English
sentences that represent some relations; while for some others we cannot. For
example, if Sean is a brother of Leon, then we also have the fact that Leon
is a brother of Sean (presumably that both Sean and Leon are boys), whereas
Dennis is the father of Sean shows that exchanging subject and object of the
sentence is not allowed.
In this chapter, we will study some widely used relations in mathematics
and give them mathematical characterizations.
4.1.1
Definitions
158
4. Relations
For example, note the similarity in the infix notation and a typical everyday real-life relation x is a brother of y, or a typical mathematical
statement x is divisible by y.
Example 4.2
Consider the relation in Example 4.1. We have bRa
because (b, a) R, but we dont have aRb because (a, b) 6 R.
1 if i, j S and (i, j) R
ri,j =
0 if i, j S and (i, j) 6 R
Example 4.3 Let S = {x, y, z}, T = {a, b, c, d}. We represent a relation
R S T in the following 3 4 matrix r.
R =
x
y
z
a b
1 0
0 1
1 0
c d
1 0
0 0
1 1
R = {(a, b), (a, c), (a, d), (b, b), (c, a), (d.b), (d, c)}.
The following figure shows two different representations of the same relation R.
a
b
c
d
a
0
0
1
0
b
1
1
0
1
c d
1 1
0 0
0 0
1 0
c
6
?
a
?
- b
6
Matrix
c Chung-Chih Li, Kishan Mehrotra
Directed Graph
159
k
S
i=1
Ai = S, and
2. for all i, 1 i k,
(a) Ai S,
(b) Ai 6= ,
(c) Ai Aj = , where 1 j k and i 6= j.
160
4. Relations
R =
1
1
1
0
0
0
1
2
1
1
0
0
0
1
3
0
0
1
0
0
0
4
0
0
0
1
1
0
5
0
0
0
1
1
0
6
1
1
0
0
0
1
161
4.1.2
Theorems
162
4.2
4. Relations
Problems
a
= 2i for some integer i 0.
b
4.2. Problems
163
Mark the following table properly to indicate the properties of the relations R1 and R2 have.
reflexive
symmetric
antisymmetric
irreflexive
asymmetric
transitive
R1
R2
Problem 7:
164
4. Relations
1. Given R and A as above, write a predicate to define the isolated
point.
2. Suppose R is a binary relation on A such that, R is symmetric
and transitive, and R has no isolated points. Prove that R is an
equivalence relation.
For all a, b, x, y in N,
(a, b)R(x, y) iff ay = bx.
Prove that R is an equivalence relation.
Problem 18: Let A = {1, 2, 3, 4}. For each of the following three relations
on A, prove or disprove that it is an equivalence relation and, if it is one,
write down its equivalence classes.
R1 = {(1, 1), (2, 2), (3, 4), (3, 3), (4, 4)}
(1, 1), (2, 2), (3, 4), (4, 4), (1, 2), (2, 1),
R2 =
(3, 3), (4, 3), (1, 3), (1, 4), (3, 1), (4, 1)
R3 = {(1, 1), (2, 2), (3, 4), (3, 3), (4, 4), (1, 2), (2, 1), (4, 2), (2, 3)}.
c Chung-Chih Li, Kishan Mehrotra
4.2. Problems
165
Problem 19:
Problem 20:
Problem 21:
follows:
a
= 2i .
b
166
4.3
4. Relations
Solutions
Solution 1:
R is reflexive
iff
a S, (a, a) R.
R is symmetric iff
R is transitive iff
Solution 2:
R is irreflexive
iff
a S, (a, a) 6 R.
R is asymmetric
iff
R is antisymmetric iff
Solution 3:
1. Relation matrix of on the power set P({a, b, c}):
{a}
{b}
{c}
{a, b}
{b, c}
{a, c}
{a, b, c}
{a}
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
{b, c}
1
0
1
1
0
1
0
0
{a, c}
1
1
0
1
0
0
1
0
{a, b, c}
1
1
1
1
1
1
1
1
4.3. Solutions
167
Solution 4:
defined as,
Solution 5:
R1
R2
Answers:
reflexive
symmetric
antisymmetric
irreflexive
asymmetric
transitive
l2
90
90
l1
l3
c Chung-Chih Li, Kishan Mehrotra
168
4. Relations
R1 :
R2 :
1:
2:
3:
4:
l1
l1
l1
If
k l2 and l2 k l3 , l1 k l3 (l1 , l3 ) R2 .
k l2 and l2 l3 , l1 l3 (l1 , l3 ) R2 .
l2 and l2 k l3 , l1 l3 (l1 , l3 ) R2 .
l1 l2 and l2 l3 , l1 k l3 (l1 , l3 ) R2 .
4.3. Solutions
Solution 6:
R1
R2
169
Answers:
reflexive
symmetric
antisymmetric
irreflexive
asymmetric
transitive
Explanation:
R1 :
R2 :
a
a
= 1 = 20 , this (a, a) R4 .
a
b
= 2i
a
b
= 1,
a
b
= 1 = 2i+j .
b
a
Thus, i + j = 0. Since i, j 0, we have i = j = 0. Therefore,
and hence a = b.
5. R2 is transitive because, if (a, b), (b, c) R2 , then
where i, j 0.
a
b
= 2i and
b
c
= 2j ,
a
a b
= = 2i+j , where i + j 0.
c
b
c
Therefore, (a, c) R2 .
c Chung-Chih Li, Kishan Mehrotra
170
4. Relations
Solution 7:
If c+d is even, then we can find an integer i such that, c+d = 2i.
(4.1)
(4.2)
Solution 8:
R is not an equivalence relation due to the lack of transitivity.
Let x, y, z B. Suppose x and y taking discrete mathematics, y and z taking
programming languages. That means (x, y) R and (y, z) R. But, that does
not mean x takes programming languages, nor z takes discrete mathematics.
Therefore, (x, z) R is not necessarily true.
2
Solution 9:
Reflexivity:
4.3. Solutions
Symmetry:
171
For all a, b S, from the definition of Y , we have
(a, b) Y (a, b) R and (b, a) R
(b, a) R and (a, b) R
(b, a) Y.
Transitivity:
Solution 10:
1. Let S = {1, 2, 3}, and define R on S as:
R = {(1, 1), (2, 2), (1, 2), (2, 1)}.
This is an example of a relation that is symmetric and transitive, but not
reflexive.
2. If R is reflexive, we require that for every element a A, (a, a) has to be
in R. But, if R is symmetric and transitive, given any a in A, (a, b) may
not be in R. Therefore, we cant assure that (b, a) R, and apply the
transitivity to conclude that (a, a) is in R. In the above example, if a = 3,
we dont have any relation (3,b) in R. Thus, in no way we can apply
symmetric and transitive properties of R to conclude that (3, 3) R.
Solution 11:
(4.3)
172
4. Relations
Solution 12:
1. The predicate P that defines the isolated points is: For all a A,
P (a) = (a A) [x A((a, x) 6 R (x, a) 6 R)].
a is an isolated point of R if and only if p(a) is true.
4.3. Solutions
173
Solution 13:
Consider the relation matrix of a equivalence relation on a set
A with n elements.
1 2 3 n
1 1
2 1
3
1
.. ..
..
..
.
. .
.
.. ..
.
..
. ..
. .
n 1
Because R is symmetric, the number of 1s in the upper right corner must be
equal to the number of 1s in the lower left corner. Therefore, the total number
of 1s in both corners is an even number. Let it be 2k.
Because R is reflexive, all entries on the diagonal must be 1, and the total
number is n. Thus, the total number of ordered pairs in R is 2k + n.
Therefore, if n is even, then 2k + n is even, and if n is odd, then 2k + n is
odd.
2
Solution 14:
174
4. Relations
Solution 15:
Solution 16:
If we want to claim that a collection of sets is a partition of
set A, we have to make sure 3 things.
1. None of the sets in the collection is empty.
2. The union of the sets in the collection is equal to A.
3. The sets in the collection are mutually disjointed, i.e., they are disjointed
to each other.
For this problem, lets first draw a Venn diagram. Its not the only case, but it
will help us to build up the feeling.
c Chung-Chih Li, Kishan Mehrotra
4.3. Solutions
175
C
:= (A C) B
:= A (B C)
:= A C
176
4. Relations
ii. a 6 B.
(a 6 B) (a 6 C) (a 6 (B C)).
Therefore, a (A (B C)).
From above, and the definition of union, we have
a ((A (B C)) ((A C) B) (A C)).
Therefore,
A ((A (B C)) ((A C) B) (A C)).
That prove 2.
Solution 17:
c Chung-Chih Li, Kishan Mehrotra
4.3. Solutions
177
Note: Do not be confused by the notation (a, b)R(c, d). (a, b)R(c, d) means
((a, b), (c, d)) R, in another words, (a, b) and (c, d) have R relation. And,
another common mistake is to consider (a, b) as an instance of R. (a, b) is
only an object in N N, and this object may or may not have R relation
to other objects in N N. Therefore, if (a, b) N N, the statement
(a, b) R is nonsense.
Reflexivity: Given any (a, b) N N. ((a, b), (a, b)) R since ab = ba.
Thus, R is reflexive.
Symmetry:
Therefore, R is symmetric.
Transitivity:
R is transitive.
Solution 18:
R1
R2
R3
reflexive symmetric
transitive
178
4. Relations
Solution 19:
{{a, b, c}}, {{a}, {b, c}}, {{a, b}, {c}}, {{b}, {a, c}}, {{a}, {b}, {c}}.
Solution 20:
If S is a non-empty set, then {S} is a partition of S. If S = ,
the partition of S is not {}. The partition of is .
2
Solution 21:
1. Reflexivity: For a N,
R is reflexive.
Symmetry:
a
a
Suppose (a, b) R.
a
= 2i
b
b
i Z, = 2i
a
(b, a) R because i Z.
(a, b) R i Z,
Transitive:
(a, b) R i Z,
a b
a
= = 2i+j .
c
b
c
Since i + j Z, therefore, (a, c) R.
Therefore, R is an equivalence relation.
2. Given any natural number x, there exist k, i N such that, k is not
divisible by 2 and x = k2i . For any natural number y = k2j , we have
x
ij
, and i j is an integer. Thus (x, y) R, namely, x and y are in
y =2
c Chung-Chih Li, Kishan Mehrotra
4.3. Solutions
179
Solution 22:
By theorem 4.1, each partition determines an equivalence
relation on A. Therefore, this problem is exactly same problem 19. We just
have to list all possible partitions of A. They are:
{{1, 2, 3}}, {{1}, {2, 3}}, {{1, 2}, {3}}, {{2}, {1, 3}}, {{1}, {2}, {3}}.
Solution 23:
Solution 24:
Let R1 and R2 be two partial order relation on S. The union
R1 R2 may not be a partial order relation, because the union operation does
not preserve antisymmetry and transitivity. Consider the following example.
Let S = {a, b, c}, and
R1 = {(a, a), (b, b), (c, c), (a, b)}
R2 = {(a, a), (b, b), (c, c), (b, a), (b, c)}.
c Chung-Chih Li, Kishan Mehrotra
180
4. Relations
Both R1 and R2 are partial order relations, but R1 R2 is not. Because both
(a, b) and (b, a) are both in R1 R2 but a 6= b, thus R1 R2 is not antisymmetric.
(a, b) and (b, c) are both in R1 R2 but (a, c) 6 R1 R2 , thus R1 R2 is not
transitive.
Note: Although we have shown that both antisymmetry and transitivity cannot be preserved by the union operation, but one is enough for us to claim
that partial order relations are not closed under union.
Solution 25:
that:
Reflexivity:
Antisymmetry:
Transitivity:
Solution 26:
1. P2 is the only one that is not a partition of S, because, in which {7, 4, 3, 8}
{1, 5, 10, 3} 6= .
2. P4 is a refinement of both P1 and P3 , because itself is a partition of S and
every element of P4 is a subset of one of the elements in P1 and P3 .
Solution 27:
The number of refinements of a partition P is the number of
the ways to further partition cells in P . The cell {1, 2, 3} has 5 ways, {4, 5} has
2 ways, and {6} has one way. Therefore, the total number of refinements of P
is 5 2 1 = 10.
2
4.3. Solutions
181
by the definition of Q
i, j [a Ci and a Dj ]
by the definition of
a A since P1 and P2 are two partiontions on A.
2. To prove, for all p, q Q, if p 6= q then p q = , let p = (Ci Dj ) and
q = (Ck Dl ). Suppose p 6= q. If so, it must be the case that, i 6= k
or j 6= l. Since P1 and P2 are two partitions, we have if i 6= k then
Ci Ck = ; if j 6= l then Dj Dl = . Thus,
p q = (Ci Dj ) (Ck Dl )
= (Ci Ck ) (Dj Dl )
= ( (Dj Dl )) or ((Ci Ck ) )
= .
From 1. and 2., Q is a partition of A.
Moreover, given any (Ci Dj ) Q, since (Ci Dj ) Ci , it follows that Q
is a refinement of P1 . Likewise, (Ci Dj ) Dj , and hence Q is a refinement of
P2 .
2
Chapter 5
Functions
A new problem ... is like a young rice plant,
which can only thrive and bear fruit when it is carefully
grafted onto an old stem according to
the rules of art of the gardener,
the stem here being the secure treasury of mathematical knowledge.
David Hilbert
5.1
185
Function is one of the most frequent used terms in mathematics. For example,
f (x) = x2 , g(x, y) = x2 + y 2 , ... are typically functions we have studied since
middle school. In general, f and g are the names of the functions, which are
used to identify the functions. x2 and x2 + y 2 are the bodies of the functions
f and g respectively, which show the meanings of the functions. x and y are
called arguments.
In this chapter, we will introduce important formal terminologies and definitions for functions, and study some typical properties of functions.
5.1.1
Definitions
186
5. Functions
187
f (x) =
1
0
if x A
if x
6 A.
5.1.2
Theorems
188
5.2
5. Functions
The Pigeonhole Principle is an easy yet powerful tool in the study of combinatorial mathematics. For example, many difficult proofs of the theorem in
Ramsey Theory are based on the principle. Consider the following intuitively
understandable statement:
The Pigeonhole Principle: If we wish to distribute k pigeons to n pigeonholes and k > n, then there must exist a pigeonhole with at least two
pigeons.
This principle is based on an important observation of the one-to-one functions. Let S and T be two finite sets and |S| < |T |, i.e., the number of elements
in S is less than the number in T . Then it is impossible to define a one to one
function from s to T .
Theorem 5.5 Let S = {1, 2, . . . , 9}. Any six-element-subset of S must have
at least two elements with sum equal 10.
Proof: The set S = {1, 2, . . . , 9} can be partitioned into five cells as follows.
{1, 9}, {2, 8}, {3, 7}, {4, 6}, {5}.
By the Pigeonhole Principle, if 6 different numbers are picked from S, then at
least one cell must contribute 2 numbers. Clearly, the sum of the two numbers
is 10 according to our partition.
2
Theorem 5.6 Let x0 , x1 , x2 , . . . , xn2 be any sequence of n2 + 1 distinct numbers. Then, there must exist a subsequence of n + 1 numbers that is either
increasing or decreasing. That is, there exists a sequence xi0 , xi1 , . . . , xin
such that, i0 < i1 < < iin and either xi0 < xi1 < . . . < xin or
xi0 > xi1 > . . . > xin .
Proof: For each xi in the sequence, let (ai , bi ) be the pair of numbers such that,
ai is the length of the longest increasing subsequence ending at xi and bi is the
length of the longest decreasing subsequence ending at xi . We observe that, if
0 i, j n and i 6= j, then (ai , bi ) 6= (aj , bj ). Since we have n2 + 1 numbers
in the sequence, it is impossible to associate every number in the sequence a
pair of numbers each is less than n. (Note: the number of possible pairs of two
numbers from {1, 2, . . . n} is n2 .) Therefore, there must be an xi that is the end
of an increasing or decreasing subsequence of length at least n + 1.
2
c Chung-Chih Li, Kishan Mehrotra
5.3
189
Asymptotic Notations
nx[x n P (x)].
nx[(x n) P (x)].
Theorem 5.7
nx (x n) [P (x) Q(x)]
nx (x n) [P (x) Q(x)]
xP (x) xQ(x).
xP (x) xQ(x)
nx[(x n) P (x)] nx[(x n) Q(x)]
x[(x n0 ) P (x)] x[(x n1 ) Q(x)], where n0 , n1 N
190
5. Functions
We have two cases: n0 n1 and n0 < n1 . We now consider the first case.
Suppose n0 n1 . In this case, we have (x > n0 ) (x > n1 ). Thus,
However, the distributive law of over does not hold. Consider the
following properties. We leave the proofs to the reader as exercises.
Exercise:
191
Proof:
f (g)
c1 c2 x [c1 g(x) f (x)] [f (x) c2 g(x)]
h
i
2
Theorem 5.9
[f1 O(g) f2 O(g)] (f1 + f2 ) O(g).
Proof: For () direction:
f1 O(g) f2 O(g)
For () direction:
(f1 + f2 ) O(g)
2
Theorem 5.10
[f1 (g) f2 (g)] = (f1 + f2 ) (g).
c Chung-Chih Li, Kishan Mehrotra
192
5. Functions
Proof:
f1 (g) f2 (g)
2
Theorem 5.11
f (g) g (f ).
f (g)
x [c1 g(x) f (x)] [f (x) c2 g(x)]
1
1
x [g(x) f (x)] [ f (x) g(x)]
c1
c2
1
1
f (x) g(x) f (x)
x
c2
c1
g (f ).
2
Exercise 1 Prove:
[f (g) g (h)] = f (h).
(5.1)
Theorem 5.12
f (g) (f ) = (g).
Proof: The proof of () direction is trivial.
For () direction, suppose f (g). We shall prove (f ) (g) and
(f ) (g).
c Chung-Chih Li, Kishan Mehrotra
193
Therefore, (g) = (f ).
Let a, b R+ . Then, an (bn ) a = b.
Theorem 5.13
=
=
=
=
If x , then
log c1
n
n
n
n
x [c1 b a c2 b ]
n
n
n
x [log(c1 b ) log a log(c2 b )]
log c1
log c2
+ log b log a
+ log b .
x
n
n
0 and
log c2
n
194
5.4
5. Functions
Problems
Problem 1: List all total and partial functions with domain {1, 2} and
codomain {a, b}.
Problem 2:
1. g : R R. g(x) := 2x + 1.
2. h : N N. h(x) := x2 + 2.
Problem 3: Let D = {1, 2, 3, 4} be the domain and N be the codomain of
the functions f1 and f2 defined as follows:
1. For all b in D, f1 (b) := b2 .
2. For all b in D, f2 (b) := the smallest prime that divides 3b + 1.
Express f1 and f2 in two relations.
Problem 4: Let A be any set. Consider relations on A and functions from
A to A as sets of ordered pairs. Find all equivalence relations on A which
are also functions from A to A. Explain.
Problem 5: Let f and g be injective functions, f : X Y and g : W
X, for sets W, X, Y . Prove that the composition f g is injective.
Problem 6: Give an example of two functions f : D Y and g : Y W
such that D, Y, and W are finite sets and g f is bijective, but neither
f nor g is bijective.
Problem 7:
that
Let f : X Y be a function.
5.4. Problems
195
Problem 12:
Problem 13: Suppose there are n people lined up in some order. Show that
you can achieve any other ordering of them by successively having some
two adjacent people trade places.
Problem 14: Prove that in a group of 700 people, there must be 2 people
who have the same first and last initials.
Problem 15: Prove that at any party there must be two people who have
shaken hands with the same number of others present.
196
5.5
5. Functions
Solutions
Solution 1:
f0
f1
f2
f3
f4
= ,
= {(1, a)}
= {(1, b)}
= {(2, a)}
= {(2, b)}
f5
f6
f7
f8
Solution 2:
1. g : R R. x R, g(x) := 2x + 1.
(a) g is injective. Because, for all x1 , x2 R,
x1 6= x2 2x1 + 1 6= 2x2 + 2
g(x1 ) 6= g(x2 ).
(b) g is surjective. Because, for all y R,
x R, x = (y 1)/2,
x R, f (x) = y.
2. h : N N. x N, h(x) := x2 + 2.
(a) h is injective. Because, for all x1 , x2 0,
x1 6= x2 x21 + 2 6= x22 + 2
h(x1 ) 6= h(x2 ).
and, x1 , x2 N x1 , x2 0.
(b) h is not surjective. Because, given any y N, we cannot always find
x N such that, f (x) = y. For example, if y = 1, there is no x N
such that f (x) = x2 + 2 = 1.
Solution 3:
c Chung-Chih Li, Kishan Mehrotra
5.5. Solutions
197
1
1
2
4
3
9
4
16
1
4
2
2
7
7
3
10
2
4
13
13
Solution 4:
Let A be any set {a, b, c, . . .}. The only equivalence relation R
on A which is also a function from A to A is,
{(a, a), (b, b), (c, c), . . .}.
Why? The restriction of a relation being a function is that the relation has to
be single valued, i.e., if (x, y) and (x, z) in the relation, then y = z. And, since
R is an equivalence relation, we know that for each element a A, (a, a) R.
Therefore, (a, x) 6 R unless a = x.
2
Solution 5:
Let f and g be injective functions, f : X Y and g : W X,
for sets W, X, Y . We first prove that f g : W Y is well defined. The only
thing we have to do is to prove that f g as a relation on W Y is single valued.
Given w1 , w2 W . If w1 = w2 and g(w1 ), g(w2 ) are defined, then
g(w1 ) = g(w2 ),
because g is a well defined function. And, if g(w1 ) = g(w2 ) and f (g(w1 )),
f (g(w2 )) are defined, then
f (g(w1 )) = f (g(w2 )),
c Chung-Chih Li, Kishan Mehrotra
198
5. Functions
g is injective
f is injective.
Therefore, f g is injective.
Solution 6:
as
1
x
f (x) a
2
b
g : Y W
as
x
a
g(x)
Wh have
g f : D W
as
1
x
(g f )(x)
Solution 7:
Let f : X Y , and A X, B X.
y f (A B)
x (A B), f (x) = y
x, x A, x B, f (x) = y
x A, f (x) = y and x B, f (x) = y
y f (A) and y f (B)
y (f (A) f (B))
Therefore,
f (A B) f (A) f (B).
However, the the reverse inclusion is not true. Here is a counter example.
Define f : Z Z, f (x) = x2 . Let, A = {2}, B = {2}. We have
f (A) = {4}, f (B) = {4}, f (A) f (B) = {4}, f (A B) = .
c Chung-Chih Li, Kishan Mehrotra
5.5. Solutions
199
Solution 8:
Let y f(A).
y f(A)
x A, f (x) = y
x B, f (x) = y
y f(B).
because A B
Solution 9:
The only thing having to do with this problem is the definitions
of the sets f(A) and f1 (B). We carefully write down the definitions as follows.
Let f : X Y , A X and B Y.
f( A) := {b | a A, f (a) = b}.
(5.2)
(5.3)
2
c Chung-Chih Li, Kishan Mehrotra
200
5. Functions
Solution 10:
(5.4)
by def. (5.3).
Therefore, A f1 (f(A)).
If f1 (f(A)) A is given, then, with the fact (5.4) we just proved, we can
conclude that A = f 1 (f(A)).
2
Solution 11:
Let f : X Y.
1. With the fact (5.4) that we have proven in the previous problem, this
problem is in fact asking to prove that if f is injective, and A is any
subset of X, then
f1 (f(A)) A.
Suppose f is injective.
a f1 (f(A)) f (a) f(A)
x0 A, f (a) = f (x0 )
x0 A, a = x0
f is injective
a A.
Therefore, f1 (f(A)) A, plus (5.4), gives
f1 (f(A)) = A.
2. Lets first prove a result similar to (5.4).
f(f1 (B)) B.
b f(f1 (B)) a f1 (B), f (a) = b
a X, f (a) B, f (a) = b
b B.
That proves (5.5). Now, suppose f is surjective.
b B a X, f (a) = b.
c Chung-Chih Li, Kishan Mehrotra
(5.5)
5.5. Solutions
201
Solution 12:
Reflexivity:
Therefore, (a, a) R.
Symmetry: Given any a, b X, and (a, b) R, i.e., exists i 0, b = f i (a).
Consider the following sequence,
f 0 (a), f 1 (a), . . . , f i (a), . . . , f j (a), . . . , f j+k (a), . . . ,
where f 0 (a) = a and f i (a) = b. Because f is a permutation on X, we are
able to find j, k such that
i j, 0 k, f j (a) = f j+k (a) = c,
where c X.1 Now, we want to prove that a is in the cycle
f j (a), f j+1 (a), . . . , f j+k (a).
For any two sequences, let
a0 , a1 , . . . , an b0 , b1 , . . . , bn iff a0 = b0 , a1 = b1 , . . . , and an = bn .
By way of contradiction, suppose that
a 6 {f j (a), f j+1 (a), . . . , f j+k (a)}.
There are two cases:
1 In
202
5. Functions
Case 1: j k. Because f is injective, f (a) = f (b) implies a = b. By
the assumption that f j (a) = f j+k (a) = c, we have
f j (a) = f j+k (a) f (f j1 (a)) = f (f k+j1 (a))
f j1 (a) = f k+j1 (a)
f j2 (a) = f k+j2 (a)
..
.
f 1 (a) = f k+1 (a)
f 0 (a) = f k (a).
Therefore, f k (a) = f 0 (a) = a, and
f 0 (a), f 1 (a), . . . , f j (a) f k (a), f k+1 (a), . . . f j+k (a).
From the assumption in this case that j k j + k, we know
a {f j (a), f j+1 (a), . . . , f j+k (a)}.
That leads a contradiction.
Case 2: k < j. With the same reason that f is injective, we can have
the following deduction,
f j (a) = f j+k (a) = c f j1 (a) = f j+k1 (a)
f j2 (a) = f j+k2 (a)
..
.
f jk (a) = f j (a).
Therefore, we have
f jk (a), f jk+1 (a), . . . , f j (a) f j (a), f j+1 (a), . . . f j+k (a),
where f jk = f j (a) = c and 0 < j k. From the assumption,
a 6 {f j (a), f j+1 (a), . . . f j+k (a)}
a
/ {f jk (a), f jk+1 (a), . . . , f j (a)}.
Now, if j k is still greater than k, we repeat the above arguments,
until, after n times, we have
f jnk (a), f jnk+1 (a), . . . , f jnk+k (a)
f jnk+k (a), f jnk+1 (a), . . . f jnk+2k (a),
5.5. Solutions
203
For all a, b, c X,
(a, b), (b, c) R
R is transitive.
Therefore, R is an equivalence relations.
Solution 13:
If we do some experiment, we will find that it is not so difficult
to see that we are able to reorder a line of people by successively switching two
adjacent people. The problem is, how to prove it formally. It is indeed what we
try to learn in this class. As to conclude the homework solutions for this class,
let me prove it by mathematical induction on the number of people lined up.
c Chung-Chih Li, Kishan Mehrotra
204
5. Functions
At first, lets define a class of functions as the following. For any x, y,
y if a = x,
x if a = y,
fx,y (a) =
(5.7)
a otherwise.
Inductive Hypothesis: If there are n people lined up, then any order of the
line can be achieved from any other order by using the functions in the
class defined in (5.7).
Inductive Step:
order.
(5.8)
(5.9)
(5.10)
(5.11)
Now, we have to permute (5.11) into (5.9). Since ak is already in the first
position required by the target order (5.9), we only have to permute
a1 , . . . , ak1 , ak+1 , . . . , an+1
(5.12)
b2 , . . . , bn , bn+1 .
(5.13)
into
From the inductive hypothesis, we can make a composition function g of
the functions in (5.7) to do the job. Let f 0 denote the composition function
(5.10). We have g f 0 , which will perform the permutation from (5.8) into
(5.9), and g f 0 is a composition of functions from the class defined in
(5.7).
[The Inductive Step Holds.]
c Chung-Chih Li, Kishan Mehrotra
5.5. Solutions
205
Solution 14:
initials are
Thus, by the Pigeonhole Principle, assigning 700 people to 676 different initials
must introduce at least 2 people who have the same initials.
2
Solution 15:
Suppose there is a party with n people. We may consider the
following two cases.
Case 1: Every body has shaken hands. Then, the possible numbers of people
for each person who has shaken hands with are 1, 2, 3, . . . , n 1. Every
body got a number from those possible numbers. We have n people,
and n 1 numbers. By the Pigeonhole Principle, at least one number is
assigned to two people.
Case 2: There is one person who does not shake hands with any others. In
this case, the possible numbers become 0, 1, 2, . . . , n 2. Please note,
n 1 is not allowed, otherwise, there is one person has shaken hands with
everybody in the party, and that contradicts the assumption. Just like
case 1, we have n people and n 1 numbers. By the Pigeonhole Principle,
at least one number is assigned to two people.