Presentation is loading. Please wait.

Presentation is loading. Please wait.

Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence.

Similar presentations


Presentation on theme: "Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence."— Presentation transcript:

1 Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence relation is said to be homogeneous if it is a linear combination of the previous terms of the recurrence without an additional function of n or a constant. a n = 2a n-1 is homogeneous a n = 2a n-1 + 2 n-3 - a n-3 is not. b k = 2b k-1 - b k-2 + 4b k-3 + 2 is not.

2 Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence relation is said to be homogeneous if it is a linear combination of the previous terms of the recurrence without an additional function of n or a constant. a n = 2a n-1 is homogeneous a n = 2a n-1 + 2 n-3 - a n-3 is not. b k = 2b k-1 - b k-2 + 4b k-3 + 2 is not.

3 First Order Homogenous Recurrences Characteristic equation Using initial conditions: General Solution: Closed Form Solution: Quiz tomorrow from Solving Recurrence Relations

4 Solving Homogenous Recurrences Finding a closed form solution to a recurrence relation. Multiply both sides by Characteristic equation roots

5 Example continued… The closed form solution is given by: Where constants A and B are to determined by employing initial conditions. Plug in n = 0 in equation 1 to obtain: Plug in n = 1 in equation 1 to obtain: Adding the two equation, we get 1 Let be the solution.

6 Example continued… By substituting A = 3 and B = -2 in equation 1, we get the final solution in the closed form: Verification Test Data

7 Example 2 The closed form solution is given by: Using initial conditions:

8 Solution of Fibonacci Recurrence Solve the quadratic equation: r 2 = r + 1 r 2 - r - 1 = 0 to obtain r 1 = (1+  5)/2 r 2 = (1-  5)/2 General solution: a n = A [(1+  5)/2] n +B [(1-  5)/2] n Characteristic equation

9 Fibonacci Recurrence Use initial conditions a 0 = 0, a 1 = 1 to find A,B and obtain specific solution. 0=a 0 = A [(1+  5)/2] 0 +B [(1-  5)/2] 0 = A +B That is A +B = 0 --- (1) 1=a 1 = A [(1+  5)/2] 1 +B [(1-  5)/2] 1 = A(1+  5)/2 +B (1-  5)/2 = (A+B )/2 + (A-B )  5/2 That is (A+B )/2 + (A-B )  5/2 = 1 or (A+B ) + (A-B )  5 = 2 -- (2) First equation give B = -A. Plug into 2 nd : A = 1/  5, B = -1/  5 Final answer:

10 Case where the roots are identical Finding a closed form solution to a recurrence relation when the roots are identical. Test Data The closed form solution is given by:

11 Where constants A and B are to determined by employing initial conditions. I Plug in k = 0 in equation 1 to obtain: Plug in k= 1 in equation 1 to obtain:

12 A variation of the previous Example Finding a closed form solution to a recurrence relation when the roots are identical. Test Data The closed form solution is given by:

13 Where constants A and B are to determined by employing initial conditions. I Plug in k = 0 in equation 1 to obtain: Plug in k= 1 in equation 1 to obtain:

14 Relationship between Recurrence Relation and Sequences Finding sequences that satisfy a recurrence relation. Characteristic equation The given recurrence is satisfied by the following sequences: b 0, b 1, b 2, …. 1, (2) 1, (2) 2, (2) 3, … 1, (5) 1, (5) 2, (5) 3, … 1, 2, 4, 8, … 1, 5, 25, 125, … Or

15 Verification 1, 5, 25, 125, … 1, 2, 4, 8, …

16 Practice Problem List first 5 terms of sequence generated by the recurrence. Solve the recurrence in the close form. Step 1: Write characteristic equation. Step 2: Find roots of the characteristic equation. Step 3: Write the general solution. Step 4: Find constants A and B using boundary conditions. Step 5: Substitute constants in the general solution.

17 Solving Recurrences using Spreadsheet

18 3 rd order Homogenous Recurrences Characteristic equation Roots D = 1, D = 2, and D = 3 General Solution: Where A, B, and C are constants to be determined by using boundary conditions. Let r = 0 Let r = 1 (I) (II)

19 3 rd order Homogenous Recurrences Let r = 2 We have to solve (I), (II), and (III) simultaneously for A, B, and C. (III) The solution is not complete.


Download ppt "Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence."

Similar presentations


Ads by Google