Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients.

Similar presentations


Presentation on theme: "Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients."— Presentation transcript:

1 Chapter 8 Recursion

2 8.3 More Recurrence

3 Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients is a recurrence relation of the form, a k = Aa k-1 + Ba k-2 for all ints k ≥ some fixed int, where A and B are fixed real numbers and B≠0. – This is called a second order because expression is based on the previous two terms (a k-1, a k-2 ). – Its linear a k-1, a k-2 are separate terms of the first order. – Homogenous because are terms are of the same order. – Constant coefficient b/c A and B are fixed real numbers that do not depend on k.

4 Example State whether each is a second-order linear homogenous recurrence relation. a k = 3a k-1 + 2a k-2 b k = b k-1 + b k-2 + b k-3 d k = d 2 k-1 + d k-1 * d k-2 e k = 2e k-2 f k = 2f k-1 + 1

5 Distinct Roots Lemma 8.3.1 – Let A and B be real numbers. A recurrence relation of the form a k = Aa k-1 + Ba k-2 is satisfied by the sequence 1, t, t 2, t 3, …, t n, … where t is non-zero real number if, and only if, t satisfies the equation t 2 – At – B = 0.

6 Characteristic Equation Definition – Given a second-order linear homogenous recurrence relation with constant coefficients: a k = Aa k-1 + Ba k-2 for all ints k≥2, the characteristic equation of the relation is t 2 – At – B = 0

7 Example Use characteristic eq to find solutions to a recurrence problem. – Consider recurrence relation where kth term of a sequence equals the sum of the (k-1)st term plus twice the (k-2) term. a k = a k-1 + 2a k-2 – Find all sequences that satisfy 1, t, t 2, t 3, …, t n, … – Solution t 2 – t - 2 = 0 t 2 – t - 2 = (t – 2)(t + 1), thus the values of t = 2, -1 t can be: 1, 2, 2 2, 2 3, …, 2n OR 1, -1 2, -1 3, … -1 n This example demonstrates how to find two distinct sequences that satisfy a given second-order homogenous recurrence relation with constant coefficients.

8 Single Root Case Consider a k = Aa k-1 + Ba k-2 for ints k≥2, but consider that the characteristic equation t 2 – At – B = 0 has a single root. By Lemma 8.3.1 one sequence that satisfies the relation is: 1, r, r 2, r 3, … r n, … however another is: 0, r, 2r 2, 3r 3, …, nr n To see this observe: t 2 – At – B = (t – r) 2 = t 2 – 2rt – r 2, A=2r B=-r 2 s n = nr n for all ints n≥0 As k-1 + Bs k-2 = A(k -1)r k-1 + B(k -2)r k-2 = 2r(k -1)r k-1 + -r 2 (k -2)r k-2 = 2(k -1)r k - (k -2)r k = (2k – 2 – k + 2) r k = kr k = s k

9 Single Root Lemma 8.3.4 – Let A and B be real numbers and suppose the characteristic eq t 2 – At – B = 0 has a single root r. Then the sequence 1, r 1, r 2, …, r n, … and 0, r, 2r 2, … nr n, … both satisfy the recurrence relation a k = Aa k-1 + Ba k-2 for all ints k≥2

10 Single Root Theorem 8.3.5 – Suppose a sequence satisfies a recurrence relation a k = Aa k-1 + Ba k-2 for some real numbers A and B with B≠0 and for all ints k≥2. If the characteristic eq t 2 – At – B = 0 has a single (real) root r then the sequence a 0, a 1, a 2, … satisfies the explicit formula a n = Cr n + Dnr n where C and D are the real numbers whose values are determined by the values of a 0 and any other known value of the sequence.

11 Example Suppose b 0, b 1, b 2 … satisfies the recurrence relation b k = 4b k-1 – 4b k- 2 for all ints k ≥ 2 with initial conditions b 0 = 1 and b 1 = 3. Find an explicit formula for the sequence. Solution – sequences is of second-order linear homogenous recurrence relation with constant coefficients (A=4 and B=-4). The single-root condition is also met because the characteristic equation t 2 – 4t + 4 = 0 has a single root r = 2 ( (t-2)(t-2) ) – b n = C 2 n + Dn2 n – to find C and D use initial conditions b 0 = 1 = C 2 0 +D(0)2 0 => C = 1 b 1 = 3 = C 2 1 +D(1)2 1 => 2C + 2D = 3 (sub C = 1 from above) 3 = 2(1) + 2D => D = ½ – Hence, b n = 2 n + ½ n2 n for all ints n≥2


Download ppt "Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients."

Similar presentations


Ads by Google