Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solving Recurrence Relations by Iteration Lecture 36 Section 8.2 Mon, Apr 17, 2006.

Similar presentations


Presentation on theme: "Solving Recurrence Relations by Iteration Lecture 36 Section 8.2 Mon, Apr 17, 2006."— Presentation transcript:

1 Solving Recurrence Relations by Iteration Lecture 36 Section 8.2 Mon, Apr 17, 2006

2 Solving Recurrence Relations Our method will involve two steps. Guess the answer. Verify the guess, using mathematical induction.

3 Guessing the Answer Write out the first several terms, as many as necessary. Look for a pattern. Two strategies Do the arithmetic. Spot the pattern in the resulting numbers. Postpone the arithmetic. Spot the pattern in the algebraic formulas.

4 Example: Do the Arithmetic Define {a n } by a 1 = 2, a n = 2a n – 1 – 1, for all n  2. Find a formula for a n. First few terms: 2, 3, 5, 9, 17, 33, 65. Compare to: 1, 2, 4, 8, 16, 32, 64. Guess that a n = 2 n – 1 + 1.

5 Example: Postpone the Arithmetic Define {a n } by a 1 = 1, a n = 2a n – 1 + 5, for all n  2. Find a formula for a n. First few terms: 1, 7, 19, 43, 91. What is a n ?

6 Example: Postpone the Arithmetic Calculate a few terms a 1 = 1. a 2 = 2  1 + 5. a 3 = 2 2  1 + 2  5 + 5. a 4 = 2 3  1 + 2 2  5 + 2  5 + 5. a 5 = 2 4  1 + 2 3  5 + 2 2  5 + 2  5 + 5. It appears that, in general, a n = 2 n – 1 + (2 n – 2 + 2 n – 3 + … + 1)  5.

7 Lemma: Geometric Series Lemma: Let r  1. Then

8 Example: Postpone the Arithmetic a n = 2 n – 1 + (2 n – 2 + 2 n – 3 + … + 1)  5 = 2 n – 1 + (2 n – 1 – 1)/(2 – 1)  5 = 2 n – 1 + (2 n – 1 – 1)  5 = 2 n – 1 + 5  2 n – 1 – 5 = 6  2 n – 1 – 5 = 3  2 n – 5.

9 Example: Future Value of an Annuity Define {a n } by a 0 = d, a n = (1 + r)a n – 1 + d, for all n  1. Find a formula for a n. a 1 = (1 + r)d + d. a 2 = (1 + r) 2 d + (1 + r)d + d. a 3 = (1 + r) 3 d + (1 + r) 2 d + (1 + r)d + d.

10 Example: Future Value of an Annuity It appears that, in general, a n = (1 + r) n d + … + (1 + r)d + d = d((1 + r) n + 1 – 1)/((1 + r) – 1) = d((1 + r) n + 1 – 1)/r.

11 Verifying the Answer Use mathematical induction to verify the guess.

12 Verifying the Answer Define {a n } by a 1 = 1, a n = 2a n – 1 + 5, for all n  2. Verify, by induction, the formula a n = 3  2 n – 5, for all n  1.

13 Future Value of an Annuity Verify the formula a n = d((1 + r) n + 1 – 1)/r for all n  0, for the future value of an annuity.

14 Solving First-Order Linear Recurrence Relations A first-order linear recurrence relation is a recurrence relation of the form a n = sa n – 1 + t, n  1, with initial condition a 0 = u, where s, t, and u are real numbers.

15 Solving First-Order Linear Recurrence Relations Theorem: Depending on the value of s, the recurrence relation will have one of the following solutions: If s = 0, the solution is a 0 = u, a n = t, for all n  1. If s = 1, the solution is a n = u + nt, for all n  0. If s  0 and s  1, then the solution is of the form a n = As n + B, for all n  0, for some real numbers A and B.

16 Solving First-Order Linear Recurrence Relations To solve for A and B in the general case, substitute the values of a 1 and a 2 and solve the system for A and B. a 0 = A + B = u a 1 = As + B = su + t

17 Example Solve the recurrence relation a 1 = 1, a n = 2a n – 1 + 5, n  2. Solve the recurrence relation a 0 = d, a n = (1 + r)a n – 1 + d, n  1.


Download ppt "Solving Recurrence Relations by Iteration Lecture 36 Section 8.2 Mon, Apr 17, 2006."

Similar presentations


Ads by Google