0% found this document useful (0 votes)
8 views88 pages

Discrete Mathematics: Induction

The document discusses the principle of mathematical induction, detailing its structure and providing examples, including proofs of theorems related to sums and divisibility. It also presents a false proof regarding the claim that all horses are the same color, illustrating common pitfalls in inductive reasoning. Exercises are included for further practice on induction proofs.

Uploaded by

vanhtran18.soict
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views88 pages

Discrete Mathematics: Induction

The document discusses the principle of mathematical induction, detailing its structure and providing examples, including proofs of theorems related to sums and divisibility. It also presents a false proof regarding the claim that all horses are the same color, illustrating common pitfalls in inductive reasoning. Exercises are included for further practice on induction proofs.

Uploaded by

vanhtran18.soict
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Discrete Mathematics

Induction

Tran Vinh Duc

February 16, 2025

1 / 37
References

• Eric Lehman, F Thomson Leighton & Albert R Meyer,


Mathematics for Computer Science, 2013 (Free)
• Kenneth H. Rosen, Discrete Mathematics and Its Applications
(Vietnamese translation)

2 / 37
Outline

1 Principle of Induction

2 Strong Induction
Principle of Induction

Let P be a predicate on nonnegative in-


tegers. If

4 / 37
Principle of Induction

Let P be a predicate on nonnegative in-


tegers. If
• P(0) is true,

4 / 37
Principle of Induction

Let P be a predicate on nonnegative in-


tegers. If
• P(0) is true, and
• for every n ∈ N, (P(n) ⇒ P(n + 1))
is also true,

4 / 37
Principle of Induction

Let P be a predicate on nonnegative in-


tegers. If
• P(0) is true, and
• for every n ∈ N, (P(n) ⇒ P(n + 1))
is also true,
then P(n) is true for all n ∈ N.

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

Let P(n) be the equation


n
X n(n + 1)
i=
i=1
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:

P(n) ⇒ P(n + 1).

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:

P(n) ⇒ P(n + 1).

Indeed, assume P(n) is true for an integer n. Because

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:

P(n) ⇒ P(n + 1).

Indeed, assume P(n) is true for an integer n. Because

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.

Let P(n) be the proposition


"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)

is divisible by 3, so P(n + 1) is true.

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)

is divisible by 3, so P(n + 1) is true.


By induction, P(n) is true for all n ∈ 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.

Let P(n) be the proposition


"In every set of n horses, 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,

color(h1 ) = color(h2 , . . . , hn ) = color(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).
• The horses h2 , h3 , . . . , hn+1 are all the same color (inductive
hypothesis).
Therefore,

color(h1 ) = color(h2 , . . . , hn ) = color(hn+1 ).

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

2 Prove that 2n > n2 for n ≥ 5.

12 / 37
Exercises

1 Prove that
n
X n(n + 1)(2n + 1)
i2 =
i=1
6

2 Prove that 2n > n2 for n ≥ 5.


3 Prove that for all n ≥ 1,

F (n − 1)F (n + 1) − F (n2 ) = (−1)n

where F (i) is the i-th Fibonacci number.

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

Figure: Grid Figure: Tile


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
(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."

• Base step: P(0) is true because


because Bill fills the whole
courtyard.

16 / 37
Proof.
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


because Bill fills the whole
courtyard.
• Inductive step: Assume P(n) is
true, we will prove P(n + 1) is true.

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."

• Base step: P(0) is true because B


2n
because Bill fills the whole
X
courtyard. X X
• Inductive step: Assume P(n) is 2n
true, we will prove P(n + 1) is true.
2n 2n

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."

• Base step: P(0) is true because B


2n
because Bill fills the whole
X
courtyard. X X
• Inductive step: Assume P(n) is 2n
true, we will prove P(n + 1) is true.
2n 2n
By induction, P(n) is true for all n ∈ N.

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

(a) (b) (c)

Figure 3.7 The 8-Puzzle in its initial configuration (a) and after one (b) and
two (c) possible moves.

3.3.4 The 8-Puzzle


In the 8-Puzzle, there are 8 lettered tiles (A–H) and a blank square arranged in a
3 ⇥ 3 grid. Any lettered tile adjacent to the blank square can be slid into the blank. 19 / 37
8-Puzzle
“mcs-ftl” — 2010/9/8 — 0:40 — page 60 — #66
“mcs-ftl” — 2010/9/8 — 0:40 — page 61 — #67

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

(a) (b) (c)


Figure 3.8 The desired final configuration of the 8-puzzle.
Figure 3.7 The 8-Puzzle in its initial configuration (a) and after one (b) and
two (c) possible moves.
2 3 4
3.3.4 The 8-Puzzle
5 6 7
in/a37
In the 8-Puzzle, there are 8 lettered tiles (A–H) and a blank square arranged 20
Theorem
There is no valid sequence of moves for the above puzzle.

21 / 37
D E F
Row Moves
G H

The natural order


Figure 3.8 ofThe
thedesired
lettersfinal
onconfiguration
the grid: of the 8-puzzle.

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

The natural order


Figure 3.8 ofThe
thedesired
lettersfinal
onconfiguration
the grid: of the 8-puzzle.

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

ut the effects of row and column moves in terms of inversions.

During a move, the number of inversions can only increase by 2,


or remain the same.

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

ut the effects of row and column moves in terms of inversions.

During a move, the number of inversions can only increase by 2,


or remain the same.

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

Definition Definition 3.3.6. A pair of letters L1 and L2 is an inversion if L1 p


E H
the alphabet, but L1 appears
63 after L2 in the puzzle order.
A pair of letters L1 and L2 is called inverted if L1 comes before L2
ininthe For example, in the puzzle below, there are three inversions: .D
inversions the alphabet
end state: but L1 appears after L2 in the grid.
There is exactly one inversion .G; H / in the start state:
.E; 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

There is exactly one inversion .G; H / in the start state:


ut the effects of row and column moves in terms of inversions.

During a move, the number of inversions can only increase by 2,


A B C
or remain the same.

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.

Column move: will change the order of exactly 2 pairs of 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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted:

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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted: the number of inversion pairs
increases by 2.

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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted: the number of inversion pairs
increases by 2.
• If both pairs are inverted:

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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted: the number of inversion pairs
increases by 2.
• If both pairs are inverted: the number of inversion pairs
decreases by 2.

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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted: the number of inversion pairs
increases by 2.
• If both pairs are inverted: the number of inversion pairs
decreases by 2.
• If only one of the pairs is inverted:

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.

Column move: will change the order of exactly 2 pairs of letters.


• If both pairs are not inverted: the number of inversion pairs
increases by 2.
• If both pairs are inverted: the number of inversion pairs
decreases by 2.
• If only one of the pairs is inverted: the number of inversion
pairs remains unchanged.

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.

3.3.4 The 8-Puzzle


In the 8-Puzzle, there are 8 lettered tiles (A–H) and a blank squ
3 ⇥ 3 grid. Any lettered tile adjacent to the blank square can be s
27 / 37
“mcs-ftl” — 2010/9/8 — 0:40 — page 60 — #66
Proof by induction.
Let P(n)
60 be the proposition: “The number of inversion pairs in the
Chapter 3 Induction
configuration obtained from

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

(a) (b) (c)


Figure 3.8 The desired final configuration of the 8-puzzle.
Figure 3.7 The 8-Puzzle in its initial configuration (a) and after one (b) and
two (c) possible moves.
2 3 4
3.3.4 The 8-Puzzle
5 6 7
In the 8-Puzzle, there are 8 lettered tiles (A–H) and a blank square arranged in a
3 ⇥ 3 grid. Any lettered tile adjacent to the blank square can be slid into the blank.
8 9 : 29 / 37
Outline

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

Consider the predicate P(n) on N. If

32 / 37
Principle of Strong Induction

Consider the predicate P(n) on N. If


• P(0) is true,

32 / 37
Principle of Strong Induction

Consider the predicate P(n) on N. If


• P(0) is true, and
• for every n ∈ N, (P(0) ∧ P(1) ∧ · · · ∧ P(n)) ⇒ P(n + 1),

32 / 37
Principle of Strong Induction

Consider the predicate P(n) on N. If


• P(0) is true, and
• for every n ∈ N, (P(0) ∧ P(1) ∧ · · · ∧ P(n)) ⇒ P(n + 1),
then P(n) is true for all n ∈ N.

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

• There is a stack of boxes. You will perform a sequence of


moves.

34 / 37
Unstacking Game

• There is a stack of boxes. You will perform a sequence of


moves.
• In each move, you split a box of size (a + b) into two
non-empty stacks of sizes a and b. You earn a b points for this
move.

34 / 37
Unstacking Game

• There is a stack of boxes. You will perform a sequence of


moves.
• In each move, you split a box of size (a + b) into two
non-empty stacks of sizes a and b. You earn a b points for this
move.
• The game ends when each stack contains only one box.

34 / 37
Unstacking Game

• There is a stack of boxes. You will perform a sequence of


moves.
• In each move, you split a box of size (a + b) into two
non-empty stacks of sizes a and b. You earn a b points for this
move.
• The game ends when each stack contains only one box.
• Your score is the total points you earn from each move.

34 / 37
Unstacking Game

• There is a stack of boxes. You will perform a sequence of


moves.
• In each move, you split a box of size (a + b) into two
non-empty stacks of sizes a and b. You earn a b points for this
move.
• The game ends when each stack contains only one box.
• Your score is the total points you earn from each move.
• Find a strategy to maximize your score.

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 .

Base step: P(0) is true because S(0) = 0.

Inductive step: Assume P(0) ∧ · · · ∧ P(n) is true to prove P(n + 1) is


true.

Consider the game with n + 1 disks. We arbitrarily split these n + 1


disks into two non-empty parts a, b such that a + b = n + 1. By the
inductive hypothesis, we have
a(a − 1) b(b − 1)
S(a + b) = S(a) + S(b) + a b = + + ab
2 2
a2 − a + b2 − b + 2a b (a + b)2 − (a + b)
= =
2 2
(a + b)(a + b − 1) (n + 1)n
= = ✓
2 2

37 / 37

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy