Discrete Mathematics: Induction
Discrete Mathematics: Induction
Induction
1 / 37
References
2 / 37
Outline
1 Principle of Induction
2 Strong Induction
Principle of Induction
4 / 37
Principle of Induction
4 / 37
Principle of Induction
4 / 37
Principle of Induction
4 / 37
Principle of Induction
880
81
777879
82
3 84
8685
73747576
88
87
72
71
70
69
68
67
666564
63621
660
59
58
57
56
535455
505152
49
48
47
46
45
44432
4 4140
393387
36
35
34
Let P be a predicate on nonnegative in- 32 33
2 2 293031
8
tegers. If
2562 7
24
23
22
• P(0) is true, and 221109
• for every n ∈ N, (P(n) ⇒ P(n + 1)) 18 7
1 1615
is also true,
114132
11
10
9
then P(n) is true for all n ∈ N. 6 78
4 5
3
2
1
4 / 37
Example
Theorem
For all n ∈ N,
n(n + 1)
1 + 2 + ··· + n =
2
5 / 37
Example
Theorem
For all n ∈ N,
n(n + 1)
1 + 2 + ··· + n =
2
5 / 37
Proof.
• Base step: P(0) is true.
6 / 37
Proof.
• Base step: P(0) is true.
• Inductive step: We will prove: for all n ≥ 0, the following
statement "If ... then" is true:
6 / 37
Proof.
• Base step: P(0) is true.
• Inductive step: We will prove: for all n ≥ 0, the following
statement "If ... then" is true:
1 + 2 + · · · + n + (n + 1) = (1 + 2 + · · · + n) + (n + 1)
n(n + 1)
= + (n + 1)
2
(n + 1)(n + 2)
=
2
6 / 37
Proof.
• Base step: P(0) is true.
• Inductive step: We will prove: for all n ≥ 0, the following
statement "If ... then" is true:
1 + 2 + · · · + n + (n + 1) = (1 + 2 + · · · + n) + (n + 1)
n(n + 1)
= + (n + 1)
2
(n + 1)(n + 2)
=
2
the statement P(n + 1) is true. By induction, P(n) is true for all
n ∈ N.
6 / 37
Example
Prove that
1 1 1 1
+ + + ··· + n < 1
2 4 8 2
for all n ≥ 1.
7 / 37
Example
Theorem
For all n ∈ N, we have n3 − n is divisible by 3.
8 / 37
Example
Theorem
For all n ∈ N, we have n3 − n is divisible by 3.
8 / 37
Proof.
• Base step: P(0) is true because 03 − 0 = 0 is divisible by 3.
9 / 37
Proof.
• Base step: P(0) is true because 03 − 0 = 0 is divisible by 3.
• Inductive step: We will prove that, for all n ∈ N, the following
statement is true
P(n) ⇒ P(n + 1).
Indeed, assume P(n) is true for any integer n.
9 / 37
Proof.
• Base step: P(0) is true because 03 − 0 = 0 is divisible by 3.
• Inductive step: We will prove that, for all n ∈ N, the following
statement is true
P(n) ⇒ P(n + 1).
Indeed, assume P(n) is true for any integer n. Because
(n + 1)3 − (n + 1) = n3 + 3n2 + 3n + 1 − n − 1
= n3 + 3n2 + 2n
= n3 − n + 3n2 + 3n
= (n3 − n) + 3(n2 + n)
9 / 37
Proof.
• Base step: P(0) is true because 03 − 0 = 0 is divisible by 3.
• Inductive step: We will prove that, for all n ∈ N, the following
statement is true
P(n) ⇒ P(n + 1).
Indeed, assume P(n) is true for any integer n. Because
(n + 1)3 − (n + 1) = n3 + 3n2 + 3n + 1 − n − 1
= n3 + 3n2 + 2n
= n3 − n + 3n2 + 3n
= (n3 − n) + 3(n2 + n)
9 / 37
Example of a false proof
Theorem (False)
All horses are the same color.
10 / 37
Example of a false proof
Theorem (False)
All horses are the same color.
10 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
Consider a set of n + 1 horses {h1 , h2 , · · · , hn+1 }
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
Consider a set of n + 1 horses {h1 , h2 , · · · , hn+1 }
• The horses h1 , h2 , . . . , hn are all the same color (inductive
hypothesis).
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
Consider a set of n + 1 horses {h1 , h2 , · · · , hn+1 }
• The horses h1 , h2 , . . . , hn are all the same color (inductive
hypothesis).
• The horses h2 , h3 , . . . , hn+1 are all the same color (inductive
hypothesis).
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
Consider a set of n + 1 horses {h1 , h2 , · · · , hn+1 }
• The horses h1 , h2 , . . . , hn are all the same color (inductive
hypothesis).
• The horses h2 , h3 , . . . , hn+1 are all the same color (inductive
hypothesis).
Therefore,
11 / 37
Let P(n) be the proposition
"In every set of n horses, all horses are the same color."
False Proof.
• Base step: P(1) is true because there is only one horse.
• Inductive step: Assume P(n) is true to prove P(n + 1).
Consider a set of n + 1 horses {h1 , h2 , · · · , hn+1 }
• The horses h1 , h2 , . . . , hn are all the same color (inductive
hypothesis).
• The horses h2 , h3 , . . . , hn+1 are all the same color (inductive
hypothesis).
Therefore,
Thus, all the horses {h1 , h2 , · · · , hn+1 } are the same color. This
means that P(n + 1) is true.
By induction, P(n) is true for all n ∈ N.
11 / 37
Exercises
1 Prove that
n
X n(n + 1)(2n + 1)
i2 =
i=1
6
12 / 37
Exercises
1 Prove that
n
X n(n + 1)(2n + 1)
i2 =
i=1
6
12 / 37
Exercises
1 Prove that
n
X n(n + 1)(2n + 1)
i2 =
i=1
6
12 / 37
(In the special case n = 0, the whole courtyard co
a proof technique in the preceding examples. But induction
rwise, there are four central squares.) A complicat
ore general reasoning tool. Tiling Example
dtional architect,
a new computer FrankAsGehry,
science building. insisted
the project went further that only spec
here were some radical fundraising ideas. One plan was to
dimensions 2n ⇥ 2n :
2n
2n
13 / 37
(In the special case n = 0, the whole courtyard co
a proof technique in the precedingProof.
examples. ButTheinduction
rwise, there are four central squares.) A complicat
(successful attempt) proof is by induction. Let P (n) be the proposition that
every location of Bill in a 2 ⇥ 2 courtyard, there exists a tiling of the remainder.
n n
ore general reasoning tool. Tiling Example
Base case: P (0) is true because Bill fills the whole courtyard.
dtional architect,
a new computer FrankAsGehry,
science building. insisted
the project went further that only spec
Inductive step: Asume that P (n) is true for some n 0; that is, for every location of Bil
a 2n ⇥ 2n courtyard, there exists a tiling of the remainder. Divide the 2n+1 ⇥ 2n+1 courty
here were some radical fundraising
intoideas. Oneeachplan
four quadrants, 2 ⇥ 2 was to contains Bill (B in the diagram belo
. One quadrant
n n
dimensions 2n ⇥ 2n : Place a temporary Bill (X in the diagram) in each of the three central squares lying outs
this quadrant:
B
2n
X
2n X X
2n
2n 2n
2n
Figure: Tiling and
Figure: Grid Figure: Tile Placing Bill’s Statue
would be occupied by a statue of a wealthy potential donor.
g these constraints exsists, at least for n = 2:
e special case n = 0, the whole courtyard consists of a single
there are four central squares.) A complication was that the
architect, Frank Gehry, insisted that only special L-shaped tiles
13 / 37
For all n 0there exists a tiling of a 2n 2n courtyard with Bill in a
central square.
14 / 37
Theorem
For all n ≥ 0, there exists a tiling of a 2n × 2n courtyard with Bill in
a central square.
14 / 37
Proof Attempt.
Consider P(n) as the proposition.
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
15 / 37
Proof Attempt.
Consider P(n) as the proposition.
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
• Base step: P(0) is true because Bill fills the whole courtyard.
15 / 37
Proof Attempt.
Consider P(n) as the proposition.
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
• Base step: P(0) is true because Bill fills the whole courtyard.
• Inductive step: !
15 / 37
Proof.
Consider P(n) as the proposition
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
16 / 37
Proof.
Consider P(n) as the proposition
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
16 / 37
Proof.
Consider P(n) as the proposition
"There exists a tiling of a 2n × 2n courtyard with Bill in
the center."
16 / 37
Proof. (successful attempt) The proof is by induction. Let P (n) be the propo
every location of Bill in a 2n ⇥ 2n courtyard, there exists a tiling of the rema
Base case: P (0) is true because Bill fills the whole courtyard.
Proof. Inductive step: Asume that P (n) is true for some n 0; that is, for every loc
a 2n ⇥ 2n courtyard, there exists a tiling of the remainder. Divide the 2n+1 ⇥ 2
Consider P(n) as theinto
proposition
four quadrants, each 2n ⇥ 2n . One quadrant contains Bill (B in the dia
Place a temporary n (X innthe diagram) in each of the three central squares
Bill
"There exists a tiling of a 2 × 2 courtyard with Bill in
this quadrant:
the center."
16 / 37
Proof. (successful attempt) The proof is by induction. Let P (n) be the propo
every location of Bill in a 2n ⇥ 2n courtyard, there exists a tiling of the rema
Base case: P (0) is true because Bill fills the whole courtyard.
Proof. Inductive step: Asume that P (n) is true for some n 0; that is, for every loc
a 2n ⇥ 2n courtyard, there exists a tiling of the remainder. Divide the 2n+1 ⇥ 2
Consider P(n) as theinto
proposition
four quadrants, each 2n ⇥ 2n . One quadrant contains Bill (B in the dia
Place a temporary n (X innthe diagram) in each of the three central squares
Bill
"There exists a tiling of a 2 × 2 courtyard with Bill in
this quadrant:
the center."
16 / 37
“mcs-ftl” — 2010/9/8 — 0:40 — page 59 — #65
15-Puzzle
3.3. Invariants 59
2 3 4 5 2 3 4 5
6 7 8 9 6 7 8 9
: 21 22 23 : 21 22
24 26 25 24 26 25 23
(a) (b)
Figure 3.5 The 15-puzzle in its starting configuration (a) and after the 12-block
is moved into the hole below (b).
2 3 4 5
17 / 37
“mcs-ftl”
“mcs-ftl”—
— 2010/9/8
2010/9/8 —
— 0:40
0:40 —
— page
page 59
59 —
— #65
#65
15-Puzzle
3.3.
3.3.Invariants
Invariants 59
59
22 33 44 55 22 3 4 5
66 77 88 99 66 7 8 9
⇒
:: 21
21 22
22 23
23 :: 21 22
2424 26
26 25
25 24
24 26
26 25
25 23
23
(a)
(a) (b)
(b)
Valid move:
Figure 3.5 move a number
The 15-puzzle to the configuration
in its starting adjacent empty space.
(a) and after the 12-block
Figure 3.5 The 15-puzzle in its starting configuration (a) and after the 12-block
isismoved
movedinto
intothe
thehole
holebelow
below(b).
(b).
22 33 44 55
17 / 37
6 7 8 9 6 7 8 9
: 21 22 23 15-Puzzle
: 21 22
24 26 25 24 26 25 23
“mcs-ftl” — 2010/9/8 — 0:40 — page 59 — #65
(a) (b)
3.3. Invariants
Is there a valid Figure 3.5of The
sequence 15-puzzle
moves in its starting
between theconfiguration
two states (a) and
59after the 12-block
below?
is moved into the hole below (b).
2 3 4 5 2 2 3 3 4 4 5 5
6 7 8 9 6 6 7 7 8 8 9 9
to
: 21 22 23 : : 21 21 2222 23
24 26 25 24 24 25 26 2625 23
(a) (b)
Figure 3.6 The desired final configuration for the 15-puzzle. Can it be achieved
Figure 3.5 The 15-puzzle in its starting configuration (a) and after the 12-block
by only moving one block at a time into an adjacent hole?
is moved into the hole below (b).
get all 15 blocks into their natural order. A picture of the 15-puzzle is shown in
Figure 3.5 along
2 with 5
3 the configuration
4 after the 12-block is moved into the hole
below. The desired final configuration is shown in Figure 3.6.
The 15-puzzle
6 became
7 very
8 popular
9 in North America and Europe and is still
sold in game and puzzle shops today. Prizes were offered for its solution,18but / 37
“mcs-ftl” — 2010/9/8 — 0:40 — page 60 — #66 8-Puzzle
Chapter 3 Induction
A B C A B C A B C
D E F D E F D F
H G H G H E G
Figure 3.7 The 8-Puzzle in its initial configuration (a) and after one (b) and
two (c) possible moves.
Problem
60 Chapter 3 Induction
Is there a valid3.3.sequence
Invariants of moves between the two states below?
A B C A A
B B
C C A B C
D E F to D D
E E
F F D F
H G H G H
G H E G
21 / 37
D E F
Row Moves
G H
2 3 4
5 6 7
8 9 :
problem:
Lemma 3.3.4. A row move does not change the order of the tiles.
Proof. A row move moves a tile from cell i to cell i C 1 or vice versa. This tile
does not change its order with respect to any other tile. Since no other tile moves,
there is no change in the order of any of the other pairs of tiles. ⌅
Let’s turn to column moves. This is the more interesting case, since here the 22 / 37
D E F
Row Moves
G H
2 3 4
5 6 7
8 9 :
problem:
Lemma
Lemma 3.3.4.
Each row A row
move move
does does
not not change
change the the order
order ofofthe
the letters.
tiles.
Proof. A row move moves a tile from cell i to cell i C 1 or vice versa. This tile
does not change its order with respect to any other tile. Since no other tile moves,
there is no change in the order of any of the other pairs of tiles. ⌅
Let’s turn to column moves. This is the more interesting case, since here the 22 / 37
Column Moves
Lemma
Each column move changes the order of exactly two pairs of letters.
23 / 37
Column Moves
“mcs-ftl” — 2010/9/8 — 0:40 — page 62 — #68
Lemma
Chapter 3
Induction
Each column move changes the order of exactly two pairs of letters.
A B C A B C
D F D F G
H E G H E
(a) (b)
Figure 3.9 An example of a column move in which the G-tile is moved into the
adjacent hole above. In this case, G changes order with E and H .
23 / 37
Inversion Pairs
Definition
A pair of letters L1 and L2 is called inverted if L1 comes before L2
in the alphabet but L1 appears after L2 in the grid.
24 / 37
Inversion Pairs
— 2010/9/8 — 0:40 — page 63 — #69
Definition
63
A pair of letters L1 and L2 is called inverted if L1 comes before L2
ininthe
inversions the alphabet
end state: but L1 appears after L2 in the grid.
A B C
D E F
G H
ma 3.3.4, a row move does not change the order of the tiles, and so 24 / 37
.E; G/.
Inversion Pairs
A B C
— 2010/9/8 — 0:40 — page 63 — #69
F D G
Definition E H
63
A pair of letters L1 and L2 is called inverted if L1 comes before L2
ininthe
inversions the alphabet
end state: but L1 appears after L2 in the grid.
There is exactly one inversion .G; H / in the start state:
A B C A B C
D E F D E F
G H H G
ma 3.3.4, a row move does not change the order of the tiles, and so 24 / 37
.E; G/. H E G H E
Inversion
(a)
Pairs (b)
A B C
Figure 3.9 An example of a column move in which the G-tile is m
— 2010/9/8 — 0:40 — page 63 — #69
adjacent hole above. In this case, G changes order with E and H .
F D G
A B C A B C A B C
D E F D E F F D G
G H H G E H
ma 3.3.4, a row move does not change the order of the tiles, and so D E F 24 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Lemma
Each move can only increase the number of inversion pairs by 2,
decrease it by 2, or keep it unchanged.
Proof.
Row move: does not change because it does not alter the order of
the letters.
25 / 37
Corollary
In every move, the parity of the number of inversion pairs remains
unchanged.
26 / 37
“mcs-ftl” — 2010/9/8 — 0:40 — page 60 — #66
Lemma
60 Chapter 3 Induction
The number of inversion pairs in any configuration obtained from
A B C A B C A
D E F D E F D
H G H G H
(a) (b)
is always odd. Figure 3.7 The 8-Puzzle in its initial configuration (a) and
two (c) possible moves.
A B C A B C A
D E F D E F D
H G H G H
(a) (b)
after n moves is always
Figureodd.”
3.7 The 8-Puzzle in its initial configuration (a) and
• Base step: P(0)twois(c) possible
true. Why? moves.
• Inductive step: Assume P(n) is true. By the previous
corollary about3.3.4 The 8-Puzzle
the parity of the number of inversion pairs
remaining unchanged, we getthere
In the 8-Puzzle, thatare
P(n + 1) istiles
8 lettered true.(A–H) and a blank squ
3 ⇥ 3 grid. Any lettered tile adjacent to the blank square can be s
For example, a sequence of two moves is illustrated in Figure 3.7
28 / 37
“mcs-ftl” — 2010/9/8 — 0:40 — page 60 — #66
“mcs-ftl” — 2010/9/8 — 0:40 — page 61 — #67
Theorem
60 Chapter 3 Induction
There is no valid sequence of moves to go from
3.3. Invariants
A B C A A
B B
C C A B C
D E F to D D
E E
F F D F
H G H G H
G H E G
1 Principle of Induction
2 Strong Induction
Problem
Use induction to prove that every positive integer can be factored
into a product of prime numbers.
31 / 37
Principle of Strong Induction
32 / 37
Principle of Strong Induction
32 / 37
Principle of Strong Induction
32 / 37
Principle of Strong Induction
32 / 37
Example
In the country of Induction, they use the currency unit Strong.
They only have two types of coins: 3S (Strong) and 5S. Although
they have a small problem with exchanging 4S or 7S, they realize
that they can exchange any amount of money of at least 8S.
Explain to them why this is true.
33 / 37
Unstacking Game
34 / 37
Unstacking Game
34 / 37
Unstacking Game
34 / 37
Unstacking Game
34 / 37
Unstacking Game
34 / 37
A “divide and conquer” strategy for the
game with n = 10 disks
Points
10
5 5 25
5 3 2 6
3 3 2 2 6
2 3 2 2 1 2
1 3 2 2 1 1 1
1 2 2 2 1 1 1 2
1 1 2 2 1 1 1 1 1
1 1 1 2 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
45
35 / 37
Theorem
Every strategy for the game with a stack of n boxes yields the same
score
n(n − 1)
S(n) = .
2
36 / 37
Proof.
n(n−1)
Let P(n) be the proposition S(n) = 2 .
37 / 37