190 likes | 1.24k Views
Solving Recurrence Relations by Iteration. Lecture 41 Section 8.2 Fri, Apr 13, 2007. Solving Recurrence Relations. Our method will involve two steps. Guess the answer. Verify the guess, using mathematical induction. Guessing the Answer.
E N D
Solving Recurrence Relations by Iteration Lecture 41 Section 8.2 Fri, Apr 13, 2007
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 {an} by • a1 = 2, • an = 2an – 1 + 1, for all n 2. • Find a formula for an. • First few terms: 2, 5, 11, 23, 47, 95, 191.
Example: Do the Arithmetic • Define {an} by • a1 = 2, • an = 2an – 1 + 1, for all n 2. • Find a formula for an. • First few terms: 2, 5, 11, 23, 47, 95, 191. • Compare to: 1, 2, 4, 8, 16, 32, 64.
Example: Do the Arithmetic • Define {an} by • a1 = 2, • an = 2an – 1 + 1, for all n 2. • Find a formula for an. • First few terms: 2, 5, 11, 23, 47, 95, 191. • Compare to: 1, 2, 4, 8, 16, 32, 64. • Guess that an = 32n – 1 + 1.
Example: Postpone the Arithmetic • Define {an} by • a1 = 1, • an = 2an – 1 + 5, for all n 2. • Find a formula for an. • First few terms: 1, 7, 19, 43, 91. • What is an?
Example: Postpone the Arithmetic • Calculate a few terms • a1 = 1. • a2 = 2 1 + 5. • a3 = 22 1 + 2 5 + 5. • a4 = 23 1 + 22 5 + 2 5 + 5. • a5 = 24 1 + 23 5 + 22 5 + 2 5 + 5. • It appears that, in general, • an = 2n – 1 + (2n – 2 + 2n – 3 + … + 1) 5.
Lemma: Geometric Series • Lemma: Let r 1. Then
Example: Postpone the Arithmetic • an = 2n – 1 + (2n – 2 + 2n – 3 + … + 1) 5 = 2n – 1 + (2n – 1 – 1)/(2 – 1) 5 = 2n – 1 + (2n – 1 – 1) 5 = 2n – 1 + 5 2n – 1 – 5 = 6 2n – 1 – 5 = 3 2n – 5.
Example • Define {an} by • a0 = a, • an = ran – 1 + b, for all n 1. • Find a formula for an. • a1 = ra + b. • a2 = r(ra + b) + b = r2a + (rb + b). • a3 = r(r2a + (rb + b)) + b = r3a + (r2b + rb + b).
Example: Future Value of an Annuity • It appears that, in general,
Verifying the Answer • Use mathematical induction to verify the guess.
Solving First-Order Linear Recurrence Relations • A first-order linear recurrence relation with constant coefficients is a recurrence relation of the form an = san – 1 + t, n 1, with initial condition a0 = 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 a0 = u, an = t, for all n 1. • If s = 1, the solution is an= u + nt, for all n 0.
Solving First-Order Linear Recurrence Relations • If s 0 and s 1, then the solution is of the form an = Asn + 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 a0 and a1 and solve the system for A and B. a0 = A + B = u a1 = As + B = su + t
Example • Solve the recurrence relation a0 = 1, an = 2an – 1 + 1, n 1. • Solve the recurrence relation a0 = 1, an = 2an – 1 + 5, n 1.