Top Banner
Mathematical Induction
197

Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Aug 26, 2018

Download

Documents

vuthuy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Mathematical Induction

Page 2: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Everybody – do the wave!

Page 3: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The Wave

● If done properly, everyone will eventually end up joining in.

● Why is that?● Someone (me!) started everyone off.● Once the person before you did the wave, you did

the wave.

Page 4: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The principle of mathematical induction states that if for some property P(n), we have that

P(0) is true

and

For any natural number n, P(n) → P(n + 1)

Then

For any natural number n, P(n) is true.

Page 5: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The principle of mathematical induction states that if for some property P(n), we have that

P(0) is true

and

For any natural number n, P(n) → P(n + 1)

Then

For any natural number n, P(n) is true.

If it starts...

Page 6: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The principle of mathematical induction states that if for some property P(n), we have that

P(0) is true

and

For any natural number n, P(n) → P(n + 1)

Then

For any natural number n, P(n) is true.

If it starts...

and it keeps going...

Page 7: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The principle of mathematical induction states that if for some property P(n), we have that

P(0) is true

and

For any natural number n, P(n) → P(n + 1)

Then

For any natural number n, P(n) is true.

If it starts...

and it keeps going...

...then it's always true

Page 8: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Another Example of Induction

Page 9: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number
Page 10: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Human Dominoes

● Everyone (except that last guy) eventually fell over.

● Why is that?● Someone fell over.● Once someone fell over, the next person fell over

as well.

Page 11: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The principle of mathematical induction states that if for some property P(n), we have that

P(0) is true

and

For any natural number n, P(n) → P(n + 1)

Then

For any natural number n, P(n) is true.

Page 12: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Induction, Intuitively

● It's true for 0.● Since it's true for 0, it's true for 1.● Since it's true for 1, it's true for 2.● Since it's true for 2, it's true for 3.● Since it's true for 3, it's true for 4.● Since it's true for 4, it's true for 5.● Since it's true for 5, it's true for 6.● …

Page 13: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Proof by Induction

● Suppose that you want to prove that some property P(n) holds of all natural numbers. To do so:

● Prove that P(0) is true.● This is called the basis or the base case.

● Prove that for any natural number n, if P(n) is true, then P(n + 1) is true as well.● This is called the inductive step.● P(n) is called the inductive hypothesis.

● Conclude by induction that P(n) holds for all n.

Page 14: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Some Sums

0 = 00 + 1 = 10 + 1 + 2 = 30 + 1 + 2 + 3 = 60 + 1 + 2 + 3 + 4 = 100 + 1 + 2 + 3 + 4 + 5 = 15

Page 15: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

1 + 2 + … + (n – 1) + n

n

n + 1

= n(n+1) / 2

Page 16: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Some Sums

0 = 00 + 1 = 10 + 1 + 2 = 30 + 1 + 2 + 3 = 60 + 1 + 2 + 3 + 4 = 100 + 1 + 2 + 3 + 4 + 5 = 15

Page 17: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Some Sums

0 = 0 = 0(0 + 1) / 20 + 1 = 1 = 1(1 + 1) / 20 + 1 + 2 = 3 = 2(2 + 1) / 20 + 1 + 2 + 3 = 6 = 3(3 + 1) / 20 + 1 + 2 + 3 + 4 = 10 = 4(4 + 1) / 20 + 1 + 2 + 3 + 4 + 5 = 15 = 5(5 + 1) / 2

Page 18: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 19: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 20: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Always mention that you're planning on doing the proof by induction, just as you would by contradiction or

contrapositive.

Page 21: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 22: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 23: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Explicitly state what property you're trying to show for all

the natural numbers.

Page 24: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 25: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

State what you're trying to prove for P(0), then go and prove it. You can use any

proof technique you'd like.

Page 26: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 27: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 28: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

In this step, we need to prove“For any natural number n, P(n) P(n + 1)”→

To prove this, we choose an arbitrary n, then assume P(n).

Page 29: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 30: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

State what P(n + 1) means, then try to prove it.

Page 31: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 32: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

Page 33: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

1+...+n+n+1=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

Page 34: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

1+...+n+n+1=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2The inductive hypothesis is that P(n) is

true. It's why we can use the result for n to simplify this sum.

Page 35: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

1+...+n+n+1=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

Page 36: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

1+...+n+n+1=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

Page 37: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Our First Proof By InductionTheorem: The sum of the first n positive natural numbers is n(n + 1)/2.Proof: By induction. Let P(n) be “the sum of the first n positive natural numbers is n(n + 1) / 2.” We show that P(n) is true for all natural numbers n.

For our base case, we need to show P(0) is true, meaning that the sum of the first zero positive natural numbers is 0(0 + 1)/2. Since the sum of the first zero positive natural numbers is 0 = 0(0 + 1)/2, P(0) is true.

For the inductive step, assume that for some n, P(n) holds, so 1 + 2 + … + n = n(n + 1) / 2. We need to show that P(n + 1) holds, meaning that the sum of the first n + 1 natural numbers is (n + 1)(n + 2)/2. Consider the sum of the first n + 1 positive natural numbers. This is the sum of the first n positive natural numbers, plus n + 1. By the inductive hypothesis, this is given by

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

1+...+n+n+1=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

Page 38: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Structuring a Proof by Induction

● State that you are attempting to prove something by induction.

● State what your choice of P(n) is.

● Prove the base case:● State what P(0) is, then prove it.

● Prove the inductive step:● State that you're assuming P(n) and what P(n) is.● State what P(n + 1) is. (this is what you're trying to prove)● Go prove P(n + 1)

● This is very rigorous, so as we gain more familiarity with induction we will start being less formal in our proofs.

Page 39: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Notation: Summations

● Instead of writing 1 + 2 + 3 + … + n, we write

∑i=0

n

i

Page 40: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Notation: Summations

● Instead of writing 1 + 2 + 3 + … + n, we write

∑i=0

n

iSum from i = 0

Page 41: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Notation: Summations

● Instead of writing 1 + 2 + 3 + … + n, we write

∑i=0

n

iSum from i = 0 to n

Page 42: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Notation: Summations

● Instead of writing 1 + 2 + 3 + … + n, we write

∑i=0

n

iSum from i = 0 to n

of i

Page 43: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Summation Examples

∑i=1

5

i=1+2+3+4+5=15

∑i=1

3

i2=12+22

+32=1+4+9=14

∑i=0

2

(i2−i)=(02−0)+(12

−1)+(22−2)=2

Page 44: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The Empty Sum

● A sum of no numbers is defined to be zero.● Examples:

∑i=1

0

2i=0 ∑i=0

−1

i=0∑i=137

42

i i=0

Page 45: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 46: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 47: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 48: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 49: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 50: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 51: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Pro tip – When proving properties of sums with

induction, it often helps to “peel off” the last few terms.

Page 52: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 53: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 54: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

This is trivial, since the empty sum is defined to be zero.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2

∑i=1

n

i=n(n+1)

2

∑i=1

n+1

i=(n+1)(n+2)

2

Page 55: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 56: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 57: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 58: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 59: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 60: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+14+2n+2

2=

n2+3n+94

2=

(n+32)

2

2

Page 61: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+14+2n+2

2=

n2+3n+94

2=

(n+32)

2

2

Page 62: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+14+2n+2

2=

n2+3n+94

2=

(n+32)

2

2

Page 63: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

Where did we prove the base case?

=

n2+n+14+2n+2

2=

n2+3n+94

2=

(n+32)

2

2

Page 64: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Where did we prove the base case?

An Incorrect ProofTheorem: For any natural number n,

Proof: Let P(n) be P(n) ≡ .

Now, assume that for some n, P(n) holds, so

We want to show that P(n + 1) is true, which means that we want to show

To see this, note that

So P(n + 1) follows from P(n), completing the induction. ■

∑i=1

n

i=12(n+

12)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=∑i=1

n

i+n+1=12(n+

12)

2

+n+1=(n+

12)

2

2+

2(n+1)

2=

(n+12)

2

+2(n+1)

2

∑i=1

n

i=12(n+

12)

2

∑i=1

n+1

i=12(n+1+

12)

2

=12(n+

32)

2

=

n2+n+

14+2n+2

2=

n2+3n+

94

2=

(n+3/2)2

2

Page 65: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

When proving P(n) is true for all n by induction,

make sure to show the base case!

Otherwise, your entire argument is invalid!

Page 66: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Stopping the Juggernaut

“Once he gets a momentum, nothing can stop him”

- X Men 3

Page 67: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Stopping the Juggernaut

“Once he gets a momentum, nothing can stop him”

- X Men 3P(n) → P(n + 1)is not enough!

Page 68: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Sums of Powers of Two

20 = 1 = 120 + 21 = 1 + 2 = 3 20 + 21 + 22 = 1 + 2 + 4 = 7 20 + 21 + 22 + 23 = 1 + 2 + 4 + 8 = 15

Page 69: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Sums of Powers of Two

20 = 1 = 1 = 21 – 120 + 21 = 1 + 2 = 3 = 22 – 120 + 21 + 22 = 1 + 2 + 4 = 7 = 23 – 120 + 21 + 22 + 23 = 1 + 2 + 4 + 8 = 15 = 24 – 1

Page 70: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Sums of Powers of Two

20 = 1 = 1 = 21 – 120 + 21 = 1 + 2 = 3 = 22 – 120 + 21 + 22 = 1 + 2 + 4 = 7 = 23 – 120 + 21 + 22 + 23 = 1 + 2 + 4 + 8 = 15 = 24 – 1

∑i=0

n

2i=2n+1−1

Page 71: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

i=∑i=0

n

i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 72: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

i=∑i=0

n

i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 73: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

i=∑i=0

n

i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 74: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

i=∑i=0

n

i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 75: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

i=∑i=0

n

i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 76: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

2i=∑i=0

n

2i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 77: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

2i=∑i=0

n

2i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Seem familiar?

Page 78: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n+1

2i=∑i=0

n

2i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 79: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=∑i=0

n

2i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 80: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction. Let P(n) be

P(n) ≡

For our base case, we need to show P(0) is true, meaning that

Since 20 = 1 = 21 – 1, this is true.

For the inductive step, assume that for some n, P(n) holds, so

We need to show that P(n + 1) holds, meaning that

To see this, note that

Thus P(n + 1) holds when P(n) is true, so P(n) is true for all natural numbers n. ■

∑i=0

n

2i=2n+1−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=∑i=0

n

2i+2n+1=2n+1

−1+2n+1=2(2n+1

)−1=2n+2−1

∑i=0

0

2i=21−1

∑i=0

n

2i=2n+1−1

∑i=0

n+1

2i=2n+2−1

Page 81: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The Counterfeit Coin Problem

Page 82: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Problem Statement

● You are given a set of three seemingly identical coins, two of which are real and one of which is counterfeit.

● The counterfeit coin weighs more than the rest of the coins.

● You are given a balance. Using only one weighing on the balance, find the counterfeit coin.

Page 83: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

22

33

Page 84: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 22

33

Page 85: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

22

33

Page 86: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

22

33

Page 87: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

33

22

Page 88: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

33

22

Page 89: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 22

33

Page 90: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 22

3333

Page 91: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

A Harder Problem

● You are given a set of nine seemingly identical coins, eight of which are real and one of which is counterfeit.

● The counterfeit coin weighs more than the rest of the coins.

● You are given a balance. Using only two weighings on the balance, find the counterfeit coin.

Page 92: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

55

88

33

66

99

Page 93: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 44

77

22 55

88

33 66

99

Page 94: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

55

88

33

66

99

Page 95: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

55

88

33

66

99

Page 96: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

55

88

33

66

99

Now we have one weighing to find the counterfeit out of these three

Page 97: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

5588

33

6699

Page 98: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

5588

33

6699

Page 99: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11

44

77

22

5588

33

6699

Now we have one weighing to find the counterfeit out of these three

Page 100: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 44

77

22 55

88

33 66

99

Page 101: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 44

77

22 55

88

33 66

99

Page 102: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Finding the Counterfeit Coin

11 44

77

22 55

88

33 66

99

Now we have one weighing to find the counterfeit out of these three

Page 103: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

If we have n weighings on the scale, how many coins can we have while still being able to find the

duplicate?

Page 104: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

A Pattern

● If we have no weighings, how many coins can we have while still being able to find the counterfeit?● One coin, since that coin has to be the counterfeit!

● If we have one weighing, we can find the counterfeit out of three coins.

● If we have two weighings, we can find the counterfeit out of nine coins.

Page 105: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

So far, we have

1, 3, 9 = 30, 31, 32

Does this pattern continue?

Page 106: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 107: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 108: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 109: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 110: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 111: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 112: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 113: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 114: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 115: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 116: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 117: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 118: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, it is therefore possible to find which coin it is in n weighings. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 119: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, we can use n more weighings to find which of these 3n coins is counterfeit. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n+1 weighings, so P(n + 1) holds. ■

Page 120: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, we can use n more weighings to find which of these 3n coins is counterfeit. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 121: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: Given n weighings, we can detect which of the 3n coins is counterfeit.

Proof: By induction. Let P(n) be “Given n weighings, we can detect which of the 3n coins is counterfeit.” We prove that P(n) is true for all natural numbers n by induction.

For the base case, we want to show that P(0) holds, which means that we need to be able to detect which of the 30 = 1 coins is counterfeit in no weighings. But this is trivial – if there is only one coin, it must be the counterfeit.

For the inductive step, suppose that for some n, P(n) holds, so we can detect which of 3n coins is counterfeit using n weighings. We want to prove that P(n + 1) holds, which is true if we can detect which of 3n+1 coins is counterfeit using n + 1 weighings. To do this, split the coins into three equal groups of size 3n; call the groups A, B, and C. Now, put the coins in set A on one side of the scale and the coins in set B on the other side. There are three cases to consider:

Case 1: If side A is heavier, then the counterfeit coin must be in group A.Case 2: If side B is heaver, then the counterfeit coin must be in group B.Case 3: If the scale is balanced, then the counterfeit coin must be in group C, since it isn't in groups A or B.

In any case, we can use one weighing to find which group of 3n coins the counterfeit coin is contained in. By the inductive hypothesis, we can use n more weighings to find which of these 3n coins is counterfeit. Combined with our original weighing, this means that we can find the counterfeit of 3n + 1 coins in n + 1 weighings, so P(n + 1) holds. ■

Page 122: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Midway Reminder: Problem Session

● Problem Session tonight, 7-8PM in Y2E2, room 111.

● Purely optional, but should be a lot of fun!● We'll try to get it recorded and posted on SCPD

in a few days.

Page 123: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The MU Puzzle

Page 124: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Gödel, Escher Bach: An Eternal Golden Braid

● Pulitzer-Prize winning book exploring recursion, computability, and consciousness.

● Written by Douglas Hofstadter, computer scientist at Indiana University.

● A great (but dense!) read.

Page 125: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The MU Puzzle

● Begin with the string MI.

● Repeatedly apply one of the following operations:● Double the contents of the string after the M: for example, MIIU becomes MIIUIIU or MI becomes MII.

● Replace III with U: MIIII becomes MUI or MIU

● Append U to the string if it ends in I: MI becomes MIU

● Remove any UU: MUUU becomes MU

● Question: How do you transform MI to MU?

Page 126: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

A) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

Page 127: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

A) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

Page 128: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

A) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

A

Page 129: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIIIA) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

A

A

Page 130: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIIIA) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

MIIIIU

A

A

D

Page 131: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIIIA) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

MIIIIU

MUIU

A

A

D

B

Page 132: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIIIA) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

MIIIIU

MUIU

MUIUUIU

A

A

D

B

A

Page 133: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIIIA) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

MIIIIU

MUIU

MUIUUIU

MUIIU

A

A

D

B

A

C

Page 134: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

A) Double the contents of the string after M.

B) Replace III with U.

C) Remove UU

D) Append U if the string ends in I.

Try It!

Starting with MI, apply these operations to make MU:

Page 135: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Not a single person in this room was able to solve this puzzle.

Are we even sure that there is a solution?

Page 136: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Counting I's

Page 137: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

MI

MII

MIIII

MIIIIU

MIIIIUIIIIU

MIIIIUUIU

MIIIIUUIUIIIIUUIU

MUIUUIUIIIIUUIU

Counting I's

Page 138: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

7

MI

MII

MIIII

MIIIIU

MIIIIUIIIIU

MIIIIUUIU

MIIIIUUIUIIIIUUIU

1

2

4

4

8

5

10

MUIUUIUIIIIUUIU

Counting I's

Page 139: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

7

MI

MII

MIIII

MIIIIU

MIIIIUIIIIU

MIIIIUUIU

MIIIIUUIUIIIIUUIU

1

2

4

4

8

5

10

None of these are

multiples of three...

MUIUUIUIIIIUUIU

Counting I's

Page 140: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

The Key Insight

● Initially, the number of I's is not a multiple of three.

● To make MU, the number of I's must end up as a multiple of three.

● Can we ever make the number of I's a multiple of three?

Page 141: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 142: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 143: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 144: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 145: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 146: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 147: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 148: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 149: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 150: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 151: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 152: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Lemma: After beginning with MI and applying any legal sequence of the specified rules, the number of I's never becomes a multiple of three.

Proof: By induction. Let P(n) be “After making n legal moves after starting with MI, the number of I's is not a multiple of 3.” We prove that P(n) holds for all natural numbers n.

As a base case, to prove that P(0) is true, we need to show that after making no moves the number of I's is not a multiple of 3. MI has one I in it, which is not a multiple of 3.

For the inductive step, assume that P(n) holds and that after any sequence of n operations, the number of I's is not a multiple of 3. To prove that P(n + 1) holds (that after n + 1 operations the number of I's is not a multiple of 3), we note by the inductive hypothesis that after the first n operations, the number of I's is not a multiple of 3. Since it is not a multiple of 3, it must either have the form 3k + 1 or 3k + 2 for some k. Consider the (n + 1)st operation:

- If it's “double the string after the M,” then we either end up with 2(3k + 1) = 6k + 2 = 3(2k) + 2 or 2(3k + 2) = 6k + 4 = 3(2k + 1) + 1 I's, neither of which is a multiple of 3.- If it's “delete UU” or “append U,” the number of I's is unchanged.- If it's “delete III,” then we either go from 3k + 1 to 3k + 1 – 3 = 3(k – 1) + 1 or from 3k + 2 to 3k + 2 – 3 = 3(k – 1) + 2 I's, neither of which is a multiple of 3.

Thus any sequence of n + 1 legal operations starting with MI ends with the number of I's not a multiple of three, so P(n + 1) holds. ■

Page 153: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: The MU puzzle has no solution.

Proof: By contradiction; assume it has a solution. By our lemma, the number of I's in the final string must not be a multiple of 3. However, for the solution to be valid, the number of I's must be 0, which is a multiple of 3. We have reached a contradiction, so our assumption was wrong and the MU puzzle has no solution. ■

Page 154: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Algorithms and Loop Invariants

● The proof we just made had the form● “If P is true before we perform an action, it is true after we

perform an action.”

● We could therefore conclude that after any series of actions of any length, if P was true beforehand, it is true now.

● In algorithms and program analysis, this is sometimes called a loop invariant.

● Formal proofs of algorithms often use loop invariants to establish correctness.● Take CS161 for more details!

Page 155: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Slimming Down Induction Proofs

Page 156: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Induction in Practice

● Typically, a proof by induction will not explicitly state P(n).

● Rather, the proof will describe P(n) implicitly and leave it to the reader to fill in the details.

● Provided that there is sufficient detail to determine● what P(n) is,● that P(0) is true, and that● whenever P(n) is true, P(n + 1) is true,

the proof is usually valid.

Page 157: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n, Proof: By induction on n. For our base case, if n = 0, note that

and the theorem is true for 0.

For the inductive step, assume that for some n the theorem is true. Then we have that

so the theorem is true for n + 1, completing the induction. ■

∑i=1

n+1

i=∑i=1

n

i+(n+1)=n(n+1)

2+n+1=

n(n+1)+2(n+1)

2=

(n+1)(n+2)

2

∑i=1

n

i=n(n+1)

2

∑i=1

0

i=0(0+1)

2=0

Page 158: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

A Variant of Induction

Page 159: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

n2 versus 2n

● 02 = 0

● 12 = 1

● 22 = 4

● 32 = 9

● 42 = 16

● 52 = 25

● 62 = 36

● 72 = 49

● 82 = 64

● 92 = 81

● 102 = 100

● 20 = 1

● 21 = 2

● 22 = 4

● 23 = 8

● 24 = 16

● 25 = 32

● 26 = 64

● 27 = 128

● 28 = 256

● 29 = 512

● 210 = 1024

Page 160: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

n2 versus 2n

● 02 = 0

● 12 = 1

● 22 = 4

● 32 = 9

● 42 = 16

● 52 = 25

● 62 = 36

● 72 = 49

● 82 = 64

● 92 = 81

● 102 = 100

● 20 = 1

● 21 = 2

● 22 = 4

● 23 = 8

● 24 = 16

● 25 = 32

● 26 = 64

● 27 = 128

● 28 = 256

● 29 = 512

● 210 = 1024

<

<

=

>

=

<

<

<

<

<

<

Page 161: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

n2 versus 2n

● 02 = 0

● 12 = 1

● 22 = 4

● 32 = 9

● 42 = 16

● 52 = 25

● 62 = 36

● 72 = 49

● 82 = 64

● 92 = 81

● 102 = 100

● 20 = 1

● 21 = 2

● 22 = 4

● 23 = 8

● 24 = 16

● 25 = 32

● 26 = 64

● 27 = 128

● 28 = 256

● 29 = 512

● 210 = 1024

<

<

=

>

=

<

<

<

<

<

<

2n is much bigger here. Does the trend

continue?

Page 162: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 163: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 164: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 165: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 166: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 167: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 168: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 169: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 170: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 171: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 172: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 173: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 174: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 175: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 176: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 177: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 178: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 179: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Page 180: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Theorem: For any natural number n ≥ 5, n2 < 2n.

Proof: By induction on n. As a base case, if n = 5, 52 = 25 < 32 = 25, so the claim holds. For the inductive step, assume that for some n ≥ 5, n2 < 2n. Then we have that

(n + 1)2 = n2 + 2n + 1

Since n ≥ 5,

(n + 1)2 = n2 + 2n + 1< n2 + 2n + n (since 1 < 5 ≤ n)= n2 + 3n< n2 + n2 (since 3n < 5n ≤ n2)= 2n2.

By the inductive hypothesis, n2 < 2n, so

(n + 1)2 < 2n2

< 2(2n)= 2n + 1

Completing the proof by induction. ■

Why is this allowed?

Why is this allowed?

Page 181: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 182: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 183: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 184: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 185: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Remember: A B means →

“whenever A is true, B is true.” If B is always true, A B is →

true for any A.

Page 186: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 187: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 188: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 189: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 190: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.Again, A B is automatically true →

if B is always true.

Page 191: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 192: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Why is this Legal?

● Let P(n) be “Either n < 5 or n2 < 2n.”● P(0) is trivially true.● P(1) is trivially true, so P(0) → P(1)● P(2) is trivially true, so P(1) → P(2)● P(3) is trivially true, so P(2) → P(3)● P(4) is trivially true, so P(3) → P(4)● We explicitly proved P(5), so P(4) → P(5)● For any n ≥ 5, we explicitly proved that P(n) → P(n + 1).● Thus P(0) and for any n, P(n) → P(n + 1), so by induction

P(n) is true for all natural numbers n.

Page 193: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Induction Starting at k

● To prove that P(n) is true for all natural numbers greater than or equal to k:● Show that P(k) is true.● Show that for any n ≥ k, that P(n) → P(n + 1).● Conclude P(k) holds for all natural numbers greater

than or equal to k.

Page 194: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

One More Induction...

Page 195: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number
Page 196: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Rube Goldberg Machines

● Every device eventually trigges.● Why?

● The first device is triggered manually.● Every device then triggers the next device.

● (This machine was built by Purdue university and unveiled last weekend at the 2012 Rube Goldberg Machine Contest. It won second place.)

Page 197: Mathematical Induction - Stanford University · The principle of mathematical induction states that if for some property P(n), we have that P(0) is true and For any natural number

Next Time

● Strong Induction● Stronger than normal induction!● … or is it?