Solving Recurrence Relations by Iteration Lecture 36 Section 8.2 Mon, Apr 17, 2006
Solving Recurrence Relations Our method will involve two steps. Guess the answer. Verify the guess, using mathematical induction.
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.
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 –
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 ?
Example: Postpone the Arithmetic Calculate a few terms a 1 = 1. a 2 = 2 a 3 = 2 2 a 4 = 2 3 a 5 = 2 4 It appears that, in general, a n = 2 n – 1 + (2 n – n – 3 + … + 1) 5.
Lemma: Geometric Series Lemma: Let r 1. Then
Example: Postpone the Arithmetic a n = 2 n – 1 + (2 n – n – 3 + … + 1) 5 = 2 n – 1 + (2 n – 1 – 1)/(2 – 1) 5 = 2 n – 1 + (2 n – 1 – 1) 5 = 2 n – 2 n – 1 – 5 = 6 2 n – 1 – 5 = 3 2 n – 5.
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.
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.
Verifying the Answer Use mathematical induction to verify the guess.
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.
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.
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.
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.
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
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.