220 likes | 475 Views
Homogeneous Linear Recurrences. To solve such recurrences we must first know how to solve an easier type of recurrence relation:
E N D
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. • an = 2an-1 is homogeneous • an = 2an-1 + 2n-3 - an-3 is not. • bk= 2bk-1 - bk-2 + 4bk-3 + 2is not.
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. • an = 2an-1 is homogeneous • an = 2an-1 + 2n-3 - an-3 is not. • bk= 2bk-1 - bk-2 + 4bk-3 + 2is not.
First Order Homogenous Recurrences Quiz tomorrow from Solving Recurrence Relations Closed Form Solution: Characteristic equation General Solution: Using initial conditions:
Solving Homogenous Recurrences Finding a closed form solution to a recurrence relation. Multiply both sides by Characteristic equation roots
Example continued… The closed form solution is given by: Let be the solution. 1 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
Example continued… By substituting A = 3 and B = -2 in equation 1, we get the final solution in the closed form: Verification Test Data
Example 2 The closed form solution is given by: Using initial conditions:
Solution of Fibonacci Recurrence Solve the quadratic equation: r 2= r +1 r 2- r -1 = 0 to obtain r1 = (1+5)/2 r2 = (1-5)/2 General solution: an = A [(1+5)/2]n +B [(1-5)/2]n Characteristic equation
Fibonacci Recurrence Use initial conditions a0= 0, a1= 1 to find A,B andobtain specific solution. 0=a0= A [(1+5)/2]0+B [(1-5)/2]0 = A +B That is A +B = 0 --- (1) 1=a1= 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 2nd: A = 1/5, B = -1/5 Final answer:
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:
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:
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:
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:
Relationship between Recurrence Relation and Sequences Finding sequences that satisfy a recurrence relation. The given recurrence is satisfied by the following sequences: b0, b1, b2, …. 1, (2)1, (2)2, (2)3 , … 1, (5)1, (5)2, (5)3 , … Characteristic equation Or 1, 2, 4, 8, … 1, 5, 25, 125, …
Verification 1, 2, 4, 8, … 1, 5, 25, 125, …
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.
3rd order Homogenous Recurrences Where A, B, and C are constants to be determined by using boundary conditions. Let r = 0 Characteristic equation (I) Let r = 1 Roots D = 1, D = 2, and D = 3 General Solution: (II)
3rd order Homogenous Recurrences Let r = 2 The solution is not complete. (III) We have to solve (I), (II), and (III) simultaneously for A, B, and C.