Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction.

Similar presentations


Presentation on theme: "Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction."— Presentation transcript:

1 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. You might be wondering at this point, “What’s mathematical induction?” I’m so glad you asked!

2 Mixed Recursion: Sec. 8.4 Mathematical Induction Mathematical induction is a technique often used for proving formulas that involve counting numbers (1, 2, 3, …). This technique requires two steps.

3 Mixed Recursion: Sec. 8.4 Mathematical Induction Step 1: Prove that the formula works for a specific case—typically for the number 1. Step 2: Assume the formula works for some number, k. Based on that assumption, show that it also works for k + 1.

4 Mixed Recursion: Sec. 8.4 Mathematical Induction If you can show that the formula works for a specific case, and that if it works for one natural number it will work for the next natural number, then you have proven that the formula will work for all natural numbers.

5 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. a.What initial step is necessary? First we must show that the formula works for a specific case, such as for n = 1. M 1 = 2 1 – 1 = 2 – 1 = 1 This tells us that having one disc should require one move, which is true.

6 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. b. The proof assumes that the formula works for a puzzle with k disks and then attempts to prove the formula must also work for a puzzle with k + 1 disks. Rewrite the assumption and goal of the induction proof in terms of the formula.

7 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. b. Write the assumption and the goal. Assumption: M k = 2 k – 1 Goal: M k+1 = 2 k+1 – 1

8 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. c. Show how the proof is completed by applying the recurrence relation. We know the recurrence relation is M n = 2M n Apply that recursion to our assumption.

9 Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction. c. Show how the proof is completed by applying the recurrence relation. Assumption: M k = 2 k – 1 Applying our recursion: M k+1 = 2(2 k – 1) + 1

10 Mixed Recursion: Sec. 8.4 Exercise 3. c. Show how the proof is completed by applying the recurrence relation. Goal: M k+1 = 2 k+1 – 1 So far we have: M k+1 = 2(2 k – 1) + 1 Distribute the first 2: M k+1 = 2(2 k ) + 2(-1) + 1 = 2 k+1 – M k+1 = 2 k+1 – 1  Our Goal!

11 Mixed Recursion: Sec. 8.4 Exercise 7. To help him finish his final year of college, Sam took out a loan of $5,000. At the end of the first year after he graduated, there was a $4,500 balance, and at the end of the second year, $3,950 remained. The amount of money left at the end of n years can be modeled by the mixed recurrence relation t n = at n-1 + b. a. The information stated above is summarized in the following table:

12 Mixed Recursion: Sec. 8.4 Exercise 7. Please note there is a mistake in the book. The answers in the back of the book for this problem would be correct if t 2 were 3,950, instead of 3,900. We’ll proceed with the values given in the table, and our answers will be different from those in the back of the book.

13 Mixed Recursion: Sec. 8.4 Exercise 7. a. Use the general form of a mixed recurrence relation and the data in the table to write a system of equations. Solve for a and b. What is the recurrence relation for the amount of money in Sam’s account after n years? General form: t n = at n-1 + b For n = 1: 4,500 = a(5,000) + b For n = 2: 3,900 = a(4,500) + b

14 Mixed Recursion: Sec. 8.4 Exercise 7. a. What is the recurrence relation for the amount of money in Sam’s account after n years? For n = 1: 4,500 = a(5,000) + b For n = 2: 3,900 = a(4,500) + b We can solve this using matrices: X =

15 Mixed Recursion: Sec. 8.4 Exercise 7. a. What is the recurrence relation for the amount of money in Sam’s account after n years? X = X = X X = So for the balance: t n = 1.2t n-1 – 1,500

16 Mixed Recursion: Sec. 8.4 Exercise 7. a. What is the recurrence relation for the amount of money in Sam’s account after n years? We could also solve this by looking at the ratio of successive 1 st differences:

17 Mixed Recursion: Sec. 8.4 Exercise 7. a. What is the recurrence relation for the amount of money in Sam’s account after n years? Multiply 1.2 times the first balance of 5,000 and we get 6,000. From there we need to subtract 1,500 in order to get to the second balance of 4,500. Thus, t n = 1.2t n

18 Mixed Recursion: Sec. 8.4 Exercise 7. b. What will be the balance owed on the loan at the end of the third year? The fourth year? Recurrence relation: t n = 1.2t n-1 – 1,500 End of second year: t 2 = $3,900 End of third year: t 3 = 1.2(3,900) – 1,500 = $3,180 End of fourth year: t 4 = 1.2(3,180) – 1,500 = $2,316

19 Mixed Recursion: Sec. 8.4 Exercise 7. c. What is the rate of interest on this loan? t n = 1.2t n-1 – 1,500 The value of a, which in this case is 1.2, tells us the interest rate. Take that value and subtract 1, which gives us.2, and then multiply by 100 to get the percent..2(100) = 20% interest

20 Mixed Recursion: Sec. 8.4 Exercise 7. d. Find the fixed point for this recurrence relation. What is the significance of this amount of money? t n = 1.2t n-1 – 1,500 x = 1.2x – 1,500 Subtract x from each side, and add 1,500 to each side. 1,500 =.2x Divide each side by.2, or multiply each side by 5. 7,500 = x If the original balance were $7,500, the loan would never be paid off. The $1,500 payment each year would exactly cover the interest.

21 Mixed Recursion: Sec. 8.4 Exercise 8. Suppose a college’s tuition over the past 3 years has risen from $8,000 to $8,700 to the present cost of $9,435. Use a mixed recurrence relation of the form t n = at n-1 + b to predict next year’s tuition.

22 Mixed Recursion: Sec. 8.4 Exercise 8. Use a mixed recurrence relation of the form t n = at n-1 + b to predict next year’s tuition. Multiply 8,000 by 1.05 to get 8,400. We need to add 300 to reach the year 2 value of 8,700. So our recurrence relation is t n = 1.05t n This leads us to predict next year’s tuition as 1.05(9,435) + 300, or $10,


Download ppt "Mixed Recursion: Sec. 8.4 Exercise 3. The closed-form formula for the Towers of Hanoi problem, M n = 2 n – 1, can be proved by mathematical induction."

Similar presentations


Ads by Google