Professional Documents
Culture Documents
Discrete Mathematics
July 17 2018
Babak Moazzez
Today we will study …
• Pigeonhole Principle
• Induction
• Recursions
Pigeonhole Principle
554 Chapter 9 Counting and Probability
The pigeonhole principle states that if n pigeons fly into m pigeonholes and n > m,
then at least one hole must contain two or more pigeons. This principle is illustrated in
• A function from one finite set to a smaller finite set cannot be
Figure 9.4.1 for n = 5 and m = 4. Illustration (a) shows the pigeons perched next to their
one-to-one: There must be a least two elements in the domain
holes, and (b) shows the correspondence from pigeons to pigeonholes. The pigeonhole
that have the same image in the co-domain.
principle is sometimes called the Dirichlet box principle because it was first stated for-
mally by J. P. G. L. Dirichlet (1805–1859).
Pigeons Pigeonholes
2 1 2 3
1 1
2
2
3
1 3 4 4 5 3
4
5 4
(a) (b)
Figure 9.4.1
13
If follows that the decimal digits obtained from the divisions between r j and rk−1 repeat
forever. In the case of 3/14, the repetition begins with r7 = 2 = r1 and the decimal
Pigeons Pigeonholes
3 1 8 1 2 4
1
2 1
3
4 2
5
2 3 5 6 7 4 9 6 3
7
8 4
9
(a) ( b)
Figure 9.4.2
• Any wholeEven
number of cents of at least 8¢ can be obtained using 3¢
more formally:
Induction
The cases shown in the table provide inductive evidence to support the claim that
P(n) is true for general n. Indeed, P(n) is true for all n ≥ 8 if, and only if, it is possible
to continue filling in the table for arbitrarily large values of n.
The kth line of the table gives information about how to obtain kc/ using 3c/ and 5c/
coins. To continue the table to the next row, directions must be given for how to obtain
(k + 1)c/ using 3c/ and 5c/ coins. The secret is to observe first that if kc/ can be obtained
using at least one 5c/ coin, then (k + 1)c/ can be obtained by replacing the 5c/ coin by two
246 Chapter 5 Sequences, Mathematical Induction, and Recursion
3c/ coins, as shown in Figure 5.2.1.
k¢ (k + 1)¢ k¢ (k + 1)¢
Replace a 5¢ coin by
two 3¢ coins. Replace three 3¢ coins
by two 5¢ coins.
3¢ 3¢
3¢ 3¢ 5¢ 5¢
5¢
3¢
If, on the other hand, kc/ is obtained without using a 5c/ coin, then 3c/ coins are used
exclusively. And since the total is at least 8c/, three or more 3c/ coins must be included.
Principle of Mathematical Induction
Three of the 3c/ coins can be replaced by two 5c/ coins to obtain a total of (k + 1)c/, as
shown in Figure 5.2.2. Let P(n) be a property that is defined for integers n, and let a be a fixed integer.
The structure of the argument above can be summarized as follows: To show Suppose
that the following two statements are true:
Replace three 3¢ coins
by two 5¢ coins.
3¢ 3¢
Induction 3¢
5¢ 5¢
Remove Add
Figure 5.2.2
The first known use of mathematical induction occurs in the work of the Italian sci-
entist Francesco Maurolico in 1575. In the seventeenth century both Pierre de Fermat
and Blaise Pascal used the technique, Fermat calling it the “method of infinite descent.”
In 1883 Augustus De Morgan (best known for De Morgan’s laws) described the process
carefully and gave it the name mathematical induction.
theorem. It is equivalent to the following property of the integers, which is easy to accept
on intuitive grounds:
Suppose S is any set of integers satisfying (1) a ∈ S, and (2) for all
integers k ≥ a, if k ∈ S then k + 1 ∈ S. Then S must contain every integer
Here is a formal version of the proof about coins previously developed informally.
Proposition5.2.1
Proposition 5.2.1
For all
For integersn n≥ ≥
allintegers 8, 8, / can
nc/ nc
can be obtained
be obtained usingusing 3c/5cand
3c/ and 5c/ coins.
/ coins.
Proof
Proof(by
(bymathematical
mathematicalinduction):
induction):
Let
Let the
theproperty
propertyP(n)
P(n)be be
thethe
sentence
sentence
nc/ can be obtained using 3c/ and 5c/ coins. ← P(n)
nc/ can be obtained using 3c/ and 5c/ coins. ← P(n)
Show that P(8) is true:
Show
P(8) isthat
true P(8) is true:
because 8c/ can be obtained using one 3c/ coin and one 5c/ coin.
P(8) is true because 8c can be obtained using one 3c coin and one 5c coin.
Show that for all integers/ k ≥ 8, if P(k) is true then P(k+1) / is also true: /
Show that
[Suppose thatfor allisintegers
P(k) true for a kparticular
≥ 8, if P(k) is true then
but arbitrarily P(k+1)
chosen integerisk also true:is:]
≥ 8. That
[Supposethat
Suppose thatk P(k)
is anyisinteger
true for a particular
with k ≥ 8 suchbut arbitrarily chosen integer k ≥ 8. That is:]
that
Suppose thatkc is any
k can integer with
be obtained ≥and
usingk3c 8 such that
5c coins.
/ / / ← P(k)
inductive hypothesis
kc/ can be obtained using 3c/ and 5c/ coins. ← P(k)
[We must show that P(k + 1) is true. That is:] We must show that inductive hypothesis
Chapter 5 CaseInduction,
Sequences, Mathematical 1 (There isRecursion
+
(kand a 5/ ccan
1)c / coin
beamong those
obtained used
using 3c/toand
make up the kc
5c/ coins. ←/.): In+this
P(k 1) case
replace the 5c/ coin by two 3c/ coins; the result will be (k + 1)c/.
Case 1 (There is a 5 c/ coin among those used to make up the kc/.): In this case
Case 2 (There is not a 5 c/ coin among those used to make up thecontinued kc/.): In thison page case,248
replacekthe
because ≥ 8, 5c/atcoin
leastby threetwo 3c/3c / coins;
coins mustthe have result
been willused.be So(k + 1)c/three
remove . 3c coins
/
and replace them by two 5c/ coins; the result will be (k + 1)c/. continued on page 248
Thus in either case (k + 1)c/ can be obtained using 3c/ and 5c/ coins [as was to be
shown].
Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
med that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
[Since we have proved the basis step and the inductive step, we conclude that the propo-
rning. All Rights Reserved. May not be copied, sition is true.]
scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
shown].
[Since we have proved the basis step and the inductive step, we conclude that the propo-
sition is true.]
Induction
The following example shows how to use mathematical induction to prove a formula
for the sum of the first n integers.
n(n + 1)
1 + 2 + ··· + n = for all integers n ≥ 1.
2
Solution To construct a proof by induction, you must first identify the property P(n). In
this case, P(n) is the equation
n(n + 1)
1 + 2 + ··· + n = . ← the property (P(n))
2
[To see that P(n) is a sentence, note that its subject is “the sum of the integers from 1
Exercise Set 5.2
1. Use mathematical induction (and the proof of Proposi- Proof: Let the property
Induction
tion 5.2.1 as a model) to show that any amount of money
of at least 14c/ can be made up using 3c/ and 8c/ coins. 1+3+5+
2. Use mathematical induction to show that any postage of at Show that P(1) is true
least 12c/ can be obtained using 3c/ and 7c/ stamps. that when 1 is substitu
equals the right-hand s
3. For each positive integer n, let P(n) be the formula side is the sum of all t
2 2 2 n(n + 1)(2n + 1) which is the sum of the
1 + 2 + ··· + n = .
6 just 1. The right-hand s
a. Write P(1). Is P(1) true? P(1) is true.
b. Write P(k). Show that for all inte
c. Write P(k + 1).
P(k + 1) is true: Let k
d. In a proof by mathematical induction that the formula
holds for all integers n ≥ 1, what must be shown in the [Suppose P(k) is tru
inductive step?
Suppose 1 + 3 + 5 + ·
4. For each integer n with n ≥ 2, let P(n) be the formula
n−1
! n(n − 1)(n + 1) [We must show that
i(i + 1) = .
Recursion
each later term in the sequence by reference to earlier terms and also one or more initial
values for the sequence.
Sometimes it is very difficult or impossible to find an explicit formula for a sequence,
but it is possible to define the sequence using recursion. Note that defining sequences
Recursion
recursively is similar to proving theorems by mathematical induction. The recurrence
relation is like the inductive step and the initial conditions are like the basis step. Indeed,
the fact that sequences can be defined recursively is equivalent to the fact that mathemat-
ical induction works as a method of proof.
• Definition
A recurrence relation for a sequence a0 , a1 , a2 , . . . is a formula that relates each
term ak to certain of its predecessors ak−1 , ak−2 , . . . , ak−i , where i is an integer with
k − i ≥ 0. The initial conditions for such a recurrence relation specify the values
of a0 , a1 , a2 , . . . , ai−1 , if i is a fixed integer, or a0 , a1 , . . . , am , where m is an integer
with m ≥ 0, if i depends on k.
The puzzle consisted of eight disks of wood with holes in their centers, which were piled in order of
decreasing size on one pole in a row of three. Those who played the game were supposed to move all
the disks one by one from one pole to another, never placing a larger disk on top of a smaller one. The
puzzle offered a prize of ten thousand francs (about $34,000 US today) to anyone who could move a
tower of 64 disks by hand while following the rules of the game. Assuming that you transferred the
hapter 5 Sequences,
disks as Mathematical
efficientlyInduction, and Recursion
as possible, how many moves would be required to win the prize?
64
golden
disks
A B C
Figure 5.6.2
Tower of k – 1
disks
Bottom
disk
Recursion
A B C
5.6 Defining Sequences Recursively 295 Position after Transferring k – 1 Disks from A to B
(b)
Tower of Tower of k – 1
k disks disks
Bottom
disk
A B C A B C
Initial Position Position after Moving the Bottom Disk from A to C
(a) (c)
Tower of k – 1 Tower of
disks k disks
Bottom
disk
A B C A B C
Position after Transferring k – 1 Disks from A to B Position after Transferring k – 1 Disks from B to C
(b) (d)
Recursion
5.7 Solving Recurrence Relations by Iteration 307
• Definition
A sequence a0 , a1 , a2 , . . . is called an arithmetic sequence if, and only if, there is
a constant d such that
ak = ak−1 + d for all integers k ≥ 1.
It follows that,
an = a0 + dn for all integers n ≥ 0.
• Definition
A sequence a0 , a1 , a2 , . . . is called a geometric sequence if, and only if, there is a
constant r such that
ak = rak−1 for all integers k ≥ 1.
It follows that,
an = a0r ′′ for all integers n ≥ 0.
In section 5.7 we discussed finding explicit formulas for recursively defined sequences
using iteration. This is a basic technique that does not require any special tools beyond
Recursion
the ability to discern patterns. In many cases, however, a pattern is not readily discernible
and other methods must be used. A variety of techniques are available for finding explicit
formulas for special classes of recursively defined sequences. The method explained in
this section is one that works for the Fibonacci and other similarly defined sequences.
• Definition
A second-order linear homogeneous recurrence relation with constant coeffi-
cients is a recurrence relation of the form
ak = Aak−1 + Bak−2 for all integers k ≥ some fixed integer,
where A and B are fixed real numbers with B ̸ = 0.
“Second-order” refers to the fact that the expression for ak contains the two previous
terms ak−1 and ak−2 , “linear” to the fact that ak−1 and ak−2 appear in separate terms and
to the first power, “homogeneous” to the fact that the total degree of each term is the same
(thus there is no constant term), and “constant coefficients” to the fact that A and B are
fixed real numbers that do not depend on k.
“Second-order” refers to the fact that the expression for ak contains the two previous
terms ak−1 and ak−2 , “linear” to the fact that ak−1 and ak−2 appear in separate terms and
to the first power, “homogeneous” to the fact that the total degree of each term is the same
Recursion
(thus there is no constant term), and “constant coefficients” to the fact that A and B are
fixed real numbers that do not depend on k.
• Definition
Given a second-order linear homogeneous recurrence relation with constant coeffi-
cients:
ak = Aak−1 + Bak−2 for all integers k ≥ 2, 5.8.1
for some real numbers A and B with B ̸ = 0 and all integers k ≥ 2. If the character-
istic equation
t 2 − At − B = 0 5.8.2
has two distinct roots r and s, then a0 , a1 , a2 , . . . is given by the explicit formula
an = Cr n + Ds n ,
where C and D are the numbers whose values are determined by the values a0 and a1 .
Note: To say “C and D are determined by the values of a0 and a1 ” means that C and D
how to find an explicit formula for any recursively defined sequence satisfying a second-
order linear homogeneous recurrence relation with constant coefficients for which the
characteristic equation has just one root. Taken together, the distinct-roots and single-root
theorems cover all second-order linear homogeneous recurrence relations with constant
Recursion
coefficients. The proof of the single-root theorem is very similar to that of the distinct-
roots theorem and is left as an exercise.