21
Strong Induction ICS 6D Sandy Irani

Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Strong Induction

ICS 6D Sandy Irani

Page 2: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Proof: Base case n = 0: h0 = (1/2)·50 - 2·0 – (5/2) = (1/2)-(5/2) = -2

Page 3: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Inductive Step: For k ≥ 0, if hk = (1/2)·5k – 2k – (5/2) then hk+1 = (1/2)·5k+1 – 2(k+1) – (5/2) hk+1= 5hk + 8(k+1) Recurrence relation defining the sequence

= 5((1/2)·5k – 2k – (5/2)) + 8(k+1) By the inductive hypothesis

= (1/2) 5 ·5k – 10k – (25/2) + 8k + 8 = (1/2) 5 ·5k – 10k – (25/2) + 8k + 8 = (1/2)·5k+1 – 2k – (9/2) = (1/2)·5k+1 – 2k – (4/2) – (5/2) = (1/2)·5k+1 – 2(k + 1) – (5/2)

Page 4: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Bound on Fibonacci Sequence

• f0 = 1 • f1 = 1 • fn = fn-1 + fn-2, for n ≥ 2

– Equivalently: fk+1 = fk + fk-1, for k ≥ 1

Theorem: for n ≥ 0, fn ≤ 2n

Inductive Step: For k ≥ 1, if fk ≤ 2k, then fk+1 ≤ 2k+1

Page 5: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Strong Induction for Bound on Fibonacci Sequence

• Base case: – f0 ≤ 20

– f1 ≤ 21

– Inductive Step: For k ≥ 1, • If: f0 ≤ 20 and f1 ≤ 21 and ….and fk ≤ 2k • then fk+1 ≤ 2k+1

Page 6: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Theorem: for n ≥ 0, fn ≤ 2n

• Base case: – f0 ≤ 20

– f1 ≤ 21

– Inductive Step: For k ≥ 1, • If fj ≤ 2j for any j in the range from 0 through k. • then fk+1 ≤ 2k+1

Page 7: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Principle of Strong Induction.

• Let P(n) be a statement that is parameterized by natural numbers n.

• Let a and b be constants, with a ≤ b. • If the following two conditions are true:

– P(a) and P(a +1)…and P(b) – For k ≥ b, [P(a) ˄ P(a +1) ˄… ˄ P(k)] → P(k +1)

• Equivalently: For k ≥ b, if P(j) is true for any j in the range from a through k, then P(k +1) is true.

• Then P(n) is true for all n ≥ a.

Page 8: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Principle of Strong Induction.

• Example a = 3, b = 6 – Base case: prove P(3), P(4), P(5) and P(6) – For k ≥ 6, if P(j) is true for any j in the range from

3 through k, then P(k+1) is true.

Page 9: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Strong vs. Weak Induction Weak Induction Strong Induction

Page 10: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Strong Induction Example: Buying Stamps

• Suppose that you can buy any number of 3-cent or 7-cent stamps. Show that you can buy exactly n-cents worth of stamps for any n ≥ 12.

• P(n): can buy n-cents worth of stamps by purchasing a combination of 3-cent and 7-cent stamps. – P(17) – P(11)

Page 11: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Strong Induction Example: Buying Stamps

• Base case: – P(12) (Can buy 12 cents worth of stamps by

buying a combination of 3-cent and 7-cent stamps).

– P(13) – P(14)

Page 12: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Induction step: – For k ≥ 14, assume that you can buy j cents worth of

stamps for any j in the range from 12 through k. We will show that it is possible to buy k+1 cents worth of stamps.

– Since k ≥ 14, k-2 ≥ 12.

• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true.

– Buy k-2 cents worth of stamps then buy one additional 3-

cent stamp. The value of the stamps is

k-2 + 3 = k+1

– Therefore, we can buy k+1 worth of stamps by purchasing only 3-cent or 7-cent stamps.

Page 13: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• What if we only had two values in the base case?

Page 14: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Chocolate Bar Theorem

• Rectangular chocolate bar consists of n squares. Can break along any horizontal or vertical line. How many breaks to break the chocolate bar into n separate squares? ( Call this number B(n) )

Page 15: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Fact: Exactly n-1 breaks to break the chocolate bar into n squares. ( B(n) = n-1 )

• Proof: • Base case: n = 1. No breaks necessary.

• B(1) = 0 = 1-1 • Inductive step:

• Suppose that for k ≥ 1, a chocolate bar with j squares requires j-1 breaks for any j in the range from 1 through k.

• Then a chocolate bar with k+1 squares requires k breaks.

• Take a chocolate bar with k+1 squares and break it into two pieces with k1 and k2 squares

Page 16: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Break the bar with k+1 squares into two pieces with k1 and k2 squares: k1 + k2 = k+1 • 1 ≤ k1 ≤ k • 1 ≤ k2 ≤ k

Page 17: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Sum of Powers of 2

• Theorem: Every positive integer can be written as a sum of distinct powers of 2.

n = 2j1 + 2j2 + … + 2jm

(the j1,…,jm are distinct)

17 = 31 = 22 =

Page 18: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

Odd and Even integers

• If n is even, n = 2m for some integer m.

• If n is odd, n = 2m+1 for some integer m.

Page 19: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Base case: – n = 1: 1 = 20

– n = 2: 2 = 21

• Inductive step: – For k ≥ 2, if every j in the range from 1 through k

can be written as a sum of distinct powers of 2. • then k+1 can be written as a sum of distinct powers of 2.

Page 20: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Case 1: k+1 is even – k+1 = 2m for some integer m. – Need to show that 1 ≤ m ≤ k

Page 21: Strong Inductionirani/w17-6D/BoardNotes/06_StrongInductionPost.pdf• k-2 falls in the range 12…k, so by the induction hypothesis, P(k-2) is true. – Buy k-2 cents worth of stamps

• Case 1: k+1 is odd – k+1 = 2m+1 for some integer m. – Need to show that 1 ≤ m ≤ k