Foundations of Computer Science Lecture 5 Induction: Proving For - - PowerPoint PPT Presentation

foundations of computer science lecture 5 induction
SMART_READER_LITE
LIVE PREVIEW

Foundations of Computer Science Lecture 5 Induction: Proving For - - PowerPoint PPT Presentation

Foundations of Computer Science Lecture 5 Induction: Proving For All . . . Induction: What and Why? Induction: Good, Bad and Ugly Induction, Well-Ordering and the Smallest Counter-Example Last Time 1 Proving if . . . , then . . .


slide-1
SLIDE 1

Foundations of Computer Science Lecture 5 Induction: Proving “For All . . . ”

Induction: What and Why? Induction: Good, Bad and Ugly Induction, Well-Ordering and the Smallest Counter-Example

slide-2
SLIDE 2

Last Time

1 Proving “if . . . , then . . . ”. 2 Proving “. . . if and only if . . . ”. 3 Proof patterns: ◮ direct proof; ⋆ If x, y ∈ Q, then x + y ∈ Q. ⋆ If 4x − 1 is divisible by 3, then 4x+1 − 1 is divisible by 3. ◮ contraposition; ⋆ If r is irrational, then √r is irrational. ⋆ If x2 is even, then x is even. ◮ contradiction. ⋆ √

2 is irrational.

⋆ a2 − 4b = 2. ⋆ 2√n + 1/√n + 1 ≤ 2√n + 1. Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 2 / 18 Today →

slide-3
SLIDE 3

Today: Induction, Proving “. . . for all . . . ”

1

What is induction.

2

Why do we need it?

3

The principle of induction. Toppling the dominos. The induction template.

4

Examples.

5

Induction, Well-Ordering and the Smallest Counter-Example.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 3 / 18 Postage →

slide-4
SLIDE 4

Dispensing Postage Using 5¢ and 7¢ Stamps

19¢ 20¢ 21¢ 22¢ 23¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 ?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 4 / 18 Why Induction? →

slide-5
SLIDE 5

Dispensing Postage Using 5¢ and 7¢ Stamps

19¢ 20¢ 21¢ 22¢ 23¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 ? Perseverance is a virtue when tinkering.

19¢ 20¢ 21¢ 22¢ 23¢ 24¢ 25¢ 26¢ 27¢ 28¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 – 7,7,5,5 5,5,5,5,5 7,7,7,5 5,5,5,5,7 7,7,7,7

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 4 / 18 Why Induction? →

slide-6
SLIDE 6

Dispensing Postage Using 5¢ and 7¢ Stamps

19¢ 20¢ 21¢ 22¢ 23¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 ? Perseverance is a virtue when tinkering.

19¢ 20¢ 21¢ 22¢ 23¢ 24¢ 25¢ 26¢ 27¢ 28¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 – 7,7,5,5 5,5,5,5,5 7,7,7,5 5,5,5,5,7 7,7,7,7

Can every postage greater than 23¢ can be dispensed?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 4 / 18 Why Induction? →

slide-7
SLIDE 7

Dispensing Postage Using 5¢ and 7¢ Stamps

19¢ 20¢ 21¢ 22¢ 23¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 ? Perseverance is a virtue when tinkering.

19¢ 20¢ 21¢ 22¢ 23¢ 24¢ 25¢ 26¢ 27¢ 28¢ 7,7,5 5,5,5,5 7,7,7 5,5,5,7 – 7,7,5,5 5,5,5,5,5 7,7,7,5 5,5,5,5,7 7,7,7,7

Can every postage greater than 23¢ can be dispensed? Intuitively yes. Induction formalizes that intuition.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 4 / 18 Why Induction? →

slide-8
SLIDE 8

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-9
SLIDE 9

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-10
SLIDE 10

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

n

1 2 3 4 5 6 7 8

· · · n2 − n + 41

41✓ 43✓ 47✓ 53✓ 61✓ 71✓ 83✓ 97✓ · · ·

(4n − 1)/3

1 5 21 85 341 1365 5461 21845 · · ·

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-11
SLIDE 11

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

n

1 2 3 4 5 6 7 8

· · ·

40 41

n2 − n + 41

41✓ 43✓ 47✓ 53✓ 61✓ 71✓ 83✓ 97✓ · · · 1601✓ 1681✘

(4n − 1)/3

1 5 21 85 341 1365 5461 21845 · · ·

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-12
SLIDE 12

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

n

1 2 3 4 5 6 7 8

· · ·

40 41

n2 − n + 41

41✓ 43✓ 47✓ 53✓ 61✓ 71✓ 83✓ 97✓ · · · 1601✓ 1681✘

(4n − 1)/3

1 5 21 85 341 1365 5461 21845 · · · How can we prove something for all n ≥ 1? Verification takes too long!

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-13
SLIDE 13

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

n

1 2 3 4 5 6 7 8

· · ·

40 41

n2 − n + 41

41✓ 43✓ 47✓ 53✓ 61✓ 71✓ 83✓ 97✓ · · · 1601✓ 1681✘

(4n − 1)/3

1 5 21 85 341 1365 5461 21845 · · · How can we prove something for all n ≥ 1? Verification takes too long! Prove for general n. Can be tricky.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-14
SLIDE 14

Why Do We Need Induction?

Predicate Claim (i) P(n) = “5¢ and 7¢ stamps can make postage n.”

∀n ≥ 24 : P(n)

(ii) P(n) = “n2 − n + 41 a prime number.”

∀n ≥ 1 : P(n)

(iii) P(n) = “4n − 1 is divisible by 3.”

∀n ≥ 1 : P(n)

TINKER!

n

1 2 3 4 5 6 7 8

· · ·

40 41

n2 − n + 41

41✓ 43✓ 47✓ 53✓ 61✓ 71✓ 83✓ 97✓ · · · 1601✓ 1681✘

(4n − 1)/3

1 5 21 85 341 1365 5461 21845 · · · How can we prove something for all n ≥ 1? Verification takes too long! Prove for general n. Can be tricky.

  • Induction. Systematic.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 5 / 18 Does 3 divide 4n − 1? →

slide-15
SLIDE 15

Is 4n − 1 Divisible by 3 for n ≥ 1?

P(n) = “4n − 1 is divisible by 3.”

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 6 / 18 3|4n − 1 →

slide-16
SLIDE 16

Is 4n − 1 Divisible by 3 for n ≥ 1?

P(n) = “4n − 1 is divisible by 3.”

We proved: if 4n − 1 is divisible by 3

  • P(n)

, then 4n+1 − 1 is divisible by 3

  • P(n+1)

.

Proof. We prove the claim using a direct proof. 1: Assume that P(n) is t, that is 4n − 1 is divisible by 3. 2: This means that 4n − 1 = 3k for an integer k, or that 4n = 3k + 1. 3: Observe that 4n+1 = 4 · 4n, and since 4n = 3k + 1, it follows that 4n+1 = 4 · (3k + 1) = 12k + 4. Therefore 4n+1 − 1 = 12k + 3 = 3(4k + 1) is a multiple of 3 (4k + 1 is an integer). 4: Since 4n+1 − 1 is a multiple of 3, we have shown that 4n+1 − 1 is divisible by 3. 5: Therefore, P(n + 1) is t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 6 / 18 3|4n − 1 →

slide-17
SLIDE 17

Is 4n − 1 Divisible by 3 for n ≥ 1?

P(n) = “4n − 1 is divisible by 3.”

We proved: if 4n − 1 is divisible by 3

  • P(n)

, then 4n+1 − 1 is divisible by 3

  • P(n+1)

.

Proof. We prove the claim using a direct proof. 1: Assume that P(n) is t, that is 4n − 1 is divisible by 3. 2: This means that 4n − 1 = 3k for an integer k, or that 4n = 3k + 1. 3: Observe that 4n+1 = 4 · 4n, and since 4n = 3k + 1, it follows that 4n+1 = 4 · (3k + 1) = 12k + 4. Therefore 4n+1 − 1 = 12k + 3 = 3(4k + 1) is a multiple of 3 (4k + 1 is an integer). 4: Since 4n+1 − 1 is a multiple of 3, we have shown that 4n+1 − 1 is divisible by 3. 5: Therefore, P(n + 1) is t.

We proved:

P(n) → P(n + 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 6 / 18 3|4n − 1 →

slide-18
SLIDE 18

Is 4n − 1 Divisible by 3 for n ≥ 1?

P(n) = “4n − 1 is divisible by 3.”

We proved: if 4n − 1 is divisible by 3

  • P(n)

, then 4n+1 − 1 is divisible by 3

  • P(n+1)

.

Proof. We prove the claim using a direct proof. 1: Assume that P(n) is t, that is 4n − 1 is divisible by 3. 2: This means that 4n − 1 = 3k for an integer k, or that 4n = 3k + 1. 3: Observe that 4n+1 = 4 · 4n, and since 4n = 3k + 1, it follows that 4n+1 = 4 · (3k + 1) = 12k + 4. Therefore 4n+1 − 1 = 12k + 3 = 3(4k + 1) is a multiple of 3 (4k + 1 is an integer). 4: Since 4n+1 − 1 is a multiple of 3, we have shown that 4n+1 − 1 is divisible by 3. 5: Therefore, P(n + 1) is t.

We proved:

P(n) → P(n + 1)

What use is this?

(Reasoning in the absense of facts.)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 6 / 18 3|4n − 1 →

slide-19
SLIDE 19

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-20
SLIDE 20

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-21
SLIDE 21

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-22
SLIDE 22

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-23
SLIDE 23

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-24
SLIDE 24

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-25
SLIDE 25

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3) → ✓ P(4)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-26
SLIDE 26

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3) → ✓ P(4)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-27
SLIDE 27

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3) → ✓ P(4) → · · · →

P(n − 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-28
SLIDE 28

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3) → ✓ P(4) → · · · →

P(n − 1) → ✓ P(n)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-29
SLIDE 29

4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.” P(n) → P(n + 1)

NEW INFORMATION: From tinkering we know that P(1) is t: 41 − 3 = 3

← divisible by 3 (new fact)

P(1) → ✓ P(2) → ✓ P(3) → ✓ P(4) → · · · →

P(n − 1) → ✓ P(n) → · · ·

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 7 / 18 By Induction, 3|4n − 1 →

slide-30
SLIDE 30

By Induction, 4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.”

1 P(1) is t.✓ 2 P(n) → P(n + 1) is t.✓             

By induction, P(n) is t for all n ≥ 1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 8 / 18 Induction Template →

slide-31
SLIDE 31

By Induction, 4n − 1 is Divisible by 3 for n ≥ 1

P(n) = “4n − 1 is divisible by 3.”

1 P(1) is t.✓ 2 P(n) → P(n + 1) is t.✓             

By induction, P(n) is t for all n ≥ 1.

P(1) → P(2) → P(3) → P(4) → P(5) → · · ·

  • Practice. Exercise 5.2.

1 2 3 4 5 6 7 8

. . .

P(n) form an infinite chain of dominos. Topple the first and they all fall.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 8 / 18 Induction Template →

slide-32
SLIDE 32

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-33
SLIDE 33

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-34
SLIDE 34

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-35
SLIDE 35

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-36
SLIDE 36

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f. 3: Conclude: by induction, ∀n ≥ 1 : P(n).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-37
SLIDE 37

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f. 3: Conclude: by induction, ∀n ≥ 1 : P(n).

Prove the implication P(n) → P(n + 1) for a general n ≥ 1. (Often direct proof) Why is this easier than just proving P(n) for general n?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-38
SLIDE 38

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f. 3: Conclude: by induction, ∀n ≥ 1 : P(n).

Prove the implication P(n) → P(n + 1) for a general n ≥ 1. (Often direct proof) Why is this easier than just proving P(n) for general n? Assume P(n) is t, and reformulate it mathematically.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-39
SLIDE 39

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f. 3: Conclude: by induction, ∀n ≥ 1 : P(n).

Prove the implication P(n) → P(n + 1) for a general n ≥ 1. (Often direct proof) Why is this easier than just proving P(n) for general n? Assume P(n) is t, and reformulate it mathematically. Somewhere in the proof you must use P(n) to prove P(n + 1).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-40
SLIDE 40

Induction Template

Induction to prove: ∀n ≥ 1 : P(n). Proof. We use induction to prove ∀n ≥ 1 : P(n).

1: Show that P(1) is t. (“simple” verification.) [base case] 2: Show P(n) → P(n + 1) for n ≥ 1 [induction step] Prove the implication using direct proof or contraposition. Direct Contraposition Assume P(n) is t.

(valid derivations) must show for any n ≥ 1 must use P(n) here Show P(n + 1) is t. Assume P(n + 1) is f.

(valid derivations) must show for any n ≥ 1 must use ¬P(n + 1) here Show P(n) is f. 3: Conclude: by induction, ∀n ≥ 1 : P(n).

Prove the implication P(n) → P(n + 1) for a general n ≥ 1. (Often direct proof) Why is this easier than just proving P(n) for general n? Assume P(n) is t, and reformulate it mathematically. Somewhere in the proof you must use P(n) to prove P(n + 1). End with a statement that P(n + 1) is t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 9 / 18 Sum of Integers →

slide-41
SLIDE 41

Sum of Integers

1 + 2 + 3 + · · · + (n − 1) + n = ?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 10 / 18 n

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

slide-42
SLIDE 42

Sum of Integers

1 + 2 + 3 + · · · + (n − 1) + n = ?

The GREAT Gauss (age 8-10):

S(n) = 1 + 2 + · · · + n S(n) = n + n − 1 + · · · + 1 2S(n) = (n + 1) + (n + 1) + · · · + (n + 1) = n × (n + 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 10 / 18 n

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

slide-43
SLIDE 43

Sum of Integers

1 + 2 + 3 + · · · + (n − 1) + n = ?

The GREAT Gauss (age 8-10):

S(n) = 1 + 2 + · · · + n S(n) = n + n − 1 + · · · + 1 2S(n) = (n + 1) + (n + 1) + · · · + (n + 1) = n × (n + 1) S(n) = 1 + 2 + 3 + · · · + (n − 1) + n = 1

2n(n + 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 10 / 18 n

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

slide-44
SLIDE 44

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-45
SLIDE 45

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-46
SLIDE 46

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-47
SLIDE 47

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-48
SLIDE 48

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

  • i=1 i =

n

  • i=1 i + (n + 1)

[key step]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-49
SLIDE 49

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

  • i=1 i =

n

  • i=1 i + (n + 1)

[key step]

=

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

[induction hypothesis P(n)]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-50
SLIDE 50

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

  • i=1 i =

n

  • i=1 i + (n + 1)

[key step]

=

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

[induction hypothesis P(n)]

=

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

[algebra]

=

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

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-51
SLIDE 51

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

  • i=1 i =

n

  • i=1 i + (n + 1)

[key step]

=

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

[induction hypothesis P(n)]

=

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

[algebra]

=

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

This is exactly what was to be shown. So, P(n + 1) is t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-52
SLIDE 52

Proof:

n

  • i=1 i = 1

2n(n + 1)

  • Proof. (By Induction) P(n) :

n

  • i=1 i = 1

2n(n + 1).

1: [Base case] P(1) claims that 1 = 1

2 × 1 × (1 + 1), which is clearly t.

2: [Induction step] We show P(n) → P(n + 1) for all n ≥ 1, using a direct proof.

Assume (induction hypothesis) P(n) is t:

n

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

Show P(n + 1) is t:

n+1

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

  • i=1 i =

n

  • i=1 i + (n + 1)

[key step]

=

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

[induction hypothesis P(n)]

=

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

[algebra]

=

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

This is exactly what was to be shown. So, P(n + 1) is t.

3: By induction, P(n) is t for all n ≥ 1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 11 / 18 VERY BAD! Induction →

slide-53
SLIDE 53

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-54
SLIDE 54

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

n+1

  • i=1 i − (n + 1) =

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

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-55
SLIDE 55

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

n+1

  • i=1 i − (n + 1) =

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

  • i=1 i =

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

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-56
SLIDE 56

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

n+1

  • i=1 i − (n + 1) =

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

  • i=1 i =

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

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

2 + 1 − 1)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-57
SLIDE 57

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

n+1

  • i=1 i − (n + 1) =

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

  • i=1 i =

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

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

2 + 1 − 1) n

  • i=1 i =

1 2n(n + 1)✓

(phew, nothing bad )

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-58
SLIDE 58

VERY BAD! Induction Step

n+1

  • i=1 i =

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

(What we want)

n+1

  • i=1 i − (n + 1) =

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

  • i=1 i =

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

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

2 + 1 − 1) n

  • i=1 i =

1 2n(n + 1)✓

(phew, nothing bad )

7 = 4 → 4 = 7

(a=b → b=a)

+ 11 = 11✓ (phew ) (Have we proved 7=4?)

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-59
SLIDE 59

VERY BAD! Induction Step

n+1

  • i=1 i =

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

Compare:

n+1

  • i=1 i =

n

  • i=1 i + (n + 1)

n+1

  • i=1 i − (n + 1) =

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

  • i=1 i =

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

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

2 + 1 − 1) n

  • i=1 i =

1 2n(n + 1)✓

(phew, nothing bad )

7 = 4 → 4 = 7

(a=b → b=a)

+ 11 = 11✓ (phew ) (Have we proved 7=4?)

To start, you can NEVER assert (as though its true) what you are trying to prove.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 12 / 18 Sum of Squares →

slide-60
SLIDE 60

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Where’s the GREAT Gauss when you need him?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-61
SLIDE 61

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-62
SLIDE 62

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-63
SLIDE 63

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49 2nd difference

S′′(n)

5 7 9 11 13

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-64
SLIDE 64

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49 2nd difference

S′′(n)

5 7 9 11 13 3rd difference

S′′′(n)

2 2 2 2 3’rd difference constant is like 3’rd derivative constant.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-65
SLIDE 65

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49 2nd difference

S′′(n)

5 7 9 11 13 3rd difference

S′′′(n)

2 2 2 2 3’rd difference constant is like 3’rd derivative constant. So guess:

S(n) = a0 + a1n + a2n2 + a3n3.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-66
SLIDE 66

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49 2nd difference

S′′(n)

5 7 9 11 13 3rd difference

S′′′(n)

2 2 2 2 3’rd difference constant is like 3’rd derivative constant. So guess:

S(n) = a0 + a1n + a2n2 + a3n3.

a0 + a1 + a2 + a3 = 1 a0 + 2a1 + 4a2 + 8a3 = 5 a0 + 3a1 + 9a2 + 27a3 = 14 a0 + 4a1 + 16a2 + 64a3 = 30 a0 = 0, a1 = 1

6, a2 = 1 2, a3 = 1 3 Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-67
SLIDE 67

Sum of Integer Squares

S(n) = 12 + 22 + 32 + · · · + (n − 1)2 + n2 = ?

Replace Gauss with TINKERING: method of differences.

n

1 2 3 4 5 6 7

S(n)

1 5 14 30 55 91 140 1st difference

S′(n)

4 9 16 25 36 49 2nd difference

S′′(n)

5 7 9 11 13 3rd difference

S′′′(n)

2 2 2 2 3’rd difference constant is like 3’rd derivative constant. So guess:

S(n) = a0 + a1n + a2n2 + a3n3.

a0 + a1 + a2 + a3 = 1 a0 + 2a1 + 4a2 + 8a3 = 5 a0 + 3a1 + 9a2 + 27a3 = 14 a0 + 4a1 + 16a2 + 64a3 = 30 a0 = 0, a1 = 1

6, a2 = 1 2, a3 = 1 3

n 1 2 3 4 5 6 7 8 9 10

1 6n + 1 2n2 + 1 3n3

1 5 14 30 55 91 140 204 285 385

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 13 / 18 n

i=1 i2 = 1 6n(n + 1)(2n + 1) →

slide-68
SLIDE 68

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-69
SLIDE 69

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-70
SLIDE 70

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-71
SLIDE 71

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Assume (induction hypothesis) P(n) is t:

n

i=1 i2 = 1 6n(n + 1)(2n + 1).

Show P(n + 1) is t:

n+1

i=1 i2 = 1 6(n + 1)(n + 2)(2n + 3).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-72
SLIDE 72

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Assume (induction hypothesis) P(n) is t:

n

i=1 i2 = 1 6n(n + 1)(2n + 1).

Show P(n + 1) is t:

n+1

i=1 i2 = 1 6(n + 1)(n + 2)(2n + 3). n+1

  • i=1 i2 =

n

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

[key step]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-73
SLIDE 73

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Assume (induction hypothesis) P(n) is t:

n

i=1 i2 = 1 6n(n + 1)(2n + 1).

Show P(n + 1) is t:

n+1

i=1 i2 = 1 6(n + 1)(n + 2)(2n + 3). n+1

  • i=1 i2 =

n

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

[key step]

=

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

[induction hypothesis P(n)]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-74
SLIDE 74

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Assume (induction hypothesis) P(n) is t:

n

i=1 i2 = 1 6n(n + 1)(2n + 1).

Show P(n + 1) is t:

n+1

i=1 i2 = 1 6(n + 1)(n + 2)(2n + 3). n+1

  • i=1 i2 =

n

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

[key step]

=

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

[induction hypothesis P(n)]

=

1 6(n + 1)(n + 2)(2n + 3)

[algebra]

This is exactly what was to be shown. So, P(n + 1) is t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-75
SLIDE 75

Proof: S(n) =

n

  • i=1 i2 = 1

6n + 1 2n2 + 1 3n3 = 1 6n(n + 1)(2n + 1)

  • Proof. (By induction.) P(n) :

n

  • i=1 i2 = 1

6n(n + 1)(2n + 1).

1: [Base case] P(1), claims that 1 = 1

6 × 1 × 2 × 3, which is clearly t.

2: [Induction step] Show P(n) → P(n + 1) for all n ≥ 1. Direct proof.

Assume (induction hypothesis) P(n) is t:

n

i=1 i2 = 1 6n(n + 1)(2n + 1).

Show P(n + 1) is t:

n+1

i=1 i2 = 1 6(n + 1)(n + 2)(2n + 3). n+1

  • i=1 i2 =

n

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

[key step]

=

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

[induction hypothesis P(n)]

=

1 6(n + 1)(n + 2)(2n + 3)

[algebra]

This is exactly what was to be shown. So, P(n + 1) is t.

3: By induction, P(n) is t for all n ≥ 1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 14 / 18 Induction Gone Wrong →

slide-76
SLIDE 76

Induction Gone Wrong

P(1) → P(2) → P(3) → P(4) → P(5) → P(6) → P(7) → · · ·

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 15 / 18 Well Ordering Principle →

slide-77
SLIDE 77

Induction Gone Wrong

P(1) → P(2) → P(3) → P(4) → P(5) → P(6) → P(7) → · · · No Base Case.

P(1) → P(2) → P(3) → P(4) → · · ·

False: P(n) : n ≤ n + 1 for all n ≥ 1.

n ≤ n + 1 → n + 1 ≤ n + 2

therefore

P(n) → P(n + 1).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 15 / 18 Well Ordering Principle →

slide-78
SLIDE 78

Induction Gone Wrong

P(1) → P(2) → P(3) → P(4) → P(5) → P(6) → P(7) → · · · No Base Case.

P(1) → P(2) → P(3) → P(4) → · · ·

False: P(n) : n ≤ n + 1 for all n ≥ 1.

n ≤ n + 1 → n + 1 ≤ n + 2

therefore

P(n) → P(n + 1).

[Every link is proved, but without the base case, you have nothing.]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 15 / 18 Well Ordering Principle →

slide-79
SLIDE 79

Induction Gone Wrong

P(1) → P(2) → P(3) → P(4) → P(5) → P(6) → P(7) → · · · No Base Case.

P(1) → P(2) → P(3) → P(4) → · · ·

False: P(n) : n ≤ n + 1 for all n ≥ 1.

n ≤ n + 1 → n + 1 ≤ n + 2

therefore

P(n) → P(n + 1).

[Every link is proved, but without the base case, you have nothing.] Broken Chain.

P(1) P(2) → P(3) → P(4) → · · ·

False: P(n) : “all balls in any set of n balls are the same color.”

Induction step. Suppose any set of n balls have the same color. Consider any set of n + 1 balls b1, b2, . . . , bn, bn+1. So, b1, b2, . . . , bn have the same color and b2, b3, . . . , bn+1 have the same color. Thus b1, b2, b3, . . . , bn+1 have the same color. P(n) → P(n + 1)?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 15 / 18 Well Ordering Principle →

slide-80
SLIDE 80

Induction Gone Wrong

P(1) → P(2) → P(3) → P(4) → P(5) → P(6) → P(7) → · · · No Base Case.

P(1) → P(2) → P(3) → P(4) → · · ·

False: P(n) : n ≤ n + 1 for all n ≥ 1.

n ≤ n + 1 → n + 1 ≤ n + 2

therefore

P(n) → P(n + 1).

[Every link is proved, but without the base case, you have nothing.] Broken Chain.

P(1) P(2) → P(3) → P(4) → · · ·

False: P(n) : “all balls in any set of n balls are the same color.”

Induction step. Suppose any set of n balls have the same color. Consider any set of n + 1 balls b1, b2, . . . , bn, bn+1. So, b1, b2, . . . , bn have the same color and b2, b3, . . . , bn+1 have the same color. Thus b1, b2, b3, . . . , bn+1 have the same color. P(n) → P(n + 1)?

[A single broken link kills the entire proof.]

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 15 / 18 Well Ordering Principle →

slide-81
SLIDE 81

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-82
SLIDE 82

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-83
SLIDE 83

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering. Let P(1) and P(n) → P(n + 1) be t.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-84
SLIDE 84

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering. Let P(1) and P(n) → P(n + 1) be t. Suppose P(n∗) fails for the smallest counter-example n∗ (well-ordering).

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-85
SLIDE 85

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering. Let P(1) and P(n) → P(n + 1) be t. Suppose P(n∗) fails for the smallest counter-example n∗ (well-ordering).

P(1) → P(2) → P(3) → P(4) → · · · → P(n∗ − 1) → P(n∗) → · · ·

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-86
SLIDE 86

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering. Let P(1) and P(n) → P(n + 1) be t. Suppose P(n∗) fails for the smallest counter-example n∗ (well-ordering).

P(1) → P(2) → P(3) → P(4) → · · · → P(n∗ − 1) → P(n∗) → · · ·

Now how can P(n∗ − 1) → P(n∗) be t?

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-87
SLIDE 87

Well Ordering Principle

Well-ordering Principle. Any non-empty set of natural numbers has a minimum element. Induction follows from well ordering. Let P(1) and P(n) → P(n + 1) be t. Suppose P(n∗) fails for the smallest counter-example n∗ (well-ordering).

P(1) → P(2) → P(3) → P(4) → · · · → P(n∗ − 1) → P(n∗) → · · ·

Now how can P(n∗ − 1) → P(n∗) be t? Any induction proof can also be done using well-ordering.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 16 / 18 Example Well-Ordering Proof →

slide-88
SLIDE 88

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-89
SLIDE 89

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-90
SLIDE 90

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-91
SLIDE 91

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-92
SLIDE 92

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-93
SLIDE 93

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Assume that there is an n ≥ 1 for which n ≥ 2n.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-94
SLIDE 94

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Assume that there is an n ≥ 1 for which n ≥ 2n. Let n∗ be the minimum such counter-example, n∗ ≥ 2n∗.

← well ordering

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-95
SLIDE 95

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Assume that there is an n ≥ 1 for which n ≥ 2n. Let n∗ be the minimum such counter-example, n∗ ≥ 2n∗.

← well ordering

Since 1 < 21, n∗ ≥ 2. Since n∗ ≥ 2, 1

2n∗ ≥ 1 and so,

n∗ − 1 ≥ n∗ − 1

2n∗ = 1 2n∗ ≥ 1 2 × 2n∗ = 2n∗−1.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-96
SLIDE 96

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Assume that there is an n ≥ 1 for which n ≥ 2n. Let n∗ be the minimum such counter-example, n∗ ≥ 2n∗.

← well ordering

Since 1 < 21, n∗ ≥ 2. Since n∗ ≥ 2, 1

2n∗ ≥ 1 and so,

n∗ − 1 ≥ n∗ − 1

2n∗ = 1 2n∗ ≥ 1 2 × 2n∗ = 2n∗−1.

So, n∗ − 1 is a smaller counter example. FISHY!

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-97
SLIDE 97

Example Well-Ordering Proof: n < 2n for n ≥ 1

  • Proof. [Induction] P(n) : n < 2n.

Base case. P(1) is t because 1 < 21.

  • Induction. Assume P(n) is t: n < 2n. and show P(n + 1) is t: n + 1 < 2n+1.

n + 1 ≤ n + n = 2n ≤ 2 × 2n = 2n+1.

Therefore P(n + 1) is t and, by induction, P(n) is t for n ≥ 1.

  • Proof. [Well-ordering] Proof by contradiction.

Assume that there is an n ≥ 1 for which n ≥ 2n. Let n∗ be the minimum such counter-example, n∗ ≥ 2n∗.

← well ordering

Since 1 < 21, n∗ ≥ 2. Since n∗ ≥ 2, 1

2n∗ ≥ 1 and so,

n∗ − 1 ≥ n∗ − 1

2n∗ = 1 2n∗ ≥ 1 2 × 2n∗ = 2n∗−1.

So, n∗ − 1 is a smaller counter example. FISHY! The method of minimum counter-example is very powerful.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 17 / 18 Getting Good at Induction →

slide-98
SLIDE 98

Getting Good at Induction

TINKER PRACTICE

  • Challenge. A circle has 2n distinct points, n are red and n are blue.

Prove that one can start at a blue point and move clockwise always having passed as many blue points as red.

Practice. All exercises and pop-quizzes in chapter 5. Strengthen. Problems in chapter 5.

Creator: Malik Magdon-Ismail Induction: Proving “For All . . . ”: 18 / 18