Presentation is loading. Please wait.

Presentation is loading. Please wait.

3.5 Recurrence Relations.

Similar presentations


Presentation on theme: "3.5 Recurrence Relations."— Presentation transcript:

1 3.5 Recurrence Relations

2 Terms that refer to previous terms to define the next term is called recursive.
The recursive formula is called recurrence relation. Information about the beginning sequence is called the initial condition or conditions.

3 The recurrence relation below recursively defines the sequence 4, 7, 10, 13 ...
An = A n with initial condition A1 =4 The recurrence relation below defines the Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, 21….. fn = f n-1 + fn with initial conditions f1 = f2 = 1

4 A technique for finding an explicit formula for a sequence defined by a recurrence relation is backtracking. An explicit formula allows direct computation of any term for a sequence.

5 In order to find a5, we need to determine a2, a3 and a4
In order to find a5, we need to determine a2, a3 and a4. an = 2an-1 where a1 = 3 a2= 2a2-1 a2= 2a1 a2=2(3) = 6 a3= 2a3-1 a3= 2a2 a3=2(6) = 12 a4= 2a4-1 a4= 2a3 a4=2(12) = 24 a5= 2a5-1 a5= 2a4 a5=2(24) = 48 The result is sequence 3, 6, 12, 24, 48

6 Backtracking method The Backtracking method is a method to determine an explicit formula an = 2an-1 a2= 2an-1 a3= 2(2an-2) a4= 2*2(2an-3) a5= 2*2*2(2an-4) We see patterns emerging When n = 2 we have 21 When n = 3 we have 22 When n = 4 we have 23 When n = 5 we have 24 Part of the explicit formula is: 2n-1

7 a2 =21 * 3 = 6 a3 =22 * 3 = 12 a4 =23 * 3 = 24 a5 =24 * 3 = 48 Explicit formula result: an = 2 n-1 * 3 Now we can determine that a5 = 24 * 3 = 48

8 A recurrence relation is a linear homogeneous relation of degree k.
Linear: The right hand side is a sum of weighted previous terms of the sequence. Homogeneous: No terms appears on the right hand side that are not multiples of a previous term. Of degree k: the recurrence goes back k terms. Cn =(-2)Cn degree 1 (1 term) f n = f n-1 + f n degree 2 (2 terms) LHS RHS an = r1a n-1 + r2an-2 +…+rkan-k The terms are built the same way and each additional term refers to the previous term.

9 Backtracking doesn’t always work for solving a recurrence relation We have the Characteristic equation to use as an explicit formula.

10 an = 4an-1 + 5an-2 initial values: a1 = 2 and a2 = 6 Characteristic Equation: x2 = 4x + 5 We want the equation to equal zero. x2- 4x - 5= 0 (what two numbers when added = -4 and when multiplied = -5? Answer: -5 and 1) (x-5)(x+1) = 0 5 – 5 = 0 and = 0 x = 5 and -1 = x S1 = 5 S2 = -1 Formula: An = US1n + VS2n a1 = 2 = U(5)1 + V(-1)1 a2= 6 = U(5) 2 + V(-1) 2

11 a1 = 2 = U(5)1 + V(-1)1 a2= 6 = U(5) 2 + V(-1) 2 Solve for U 2 = 5U – V 6 = 25U + V 8 = 30U (1/30)8 = 30U(1/30) 4/15 = U

12 Solve for V (we know what U is now (4/15))
a1 = 2 = U(5)1 + V(-1)1 2 = 5(4/15)-V 2 = 20/15 – V + V 2 = 20/15 – V +V 2 + V = 20/15 V = 20/ V = 4/3 – 2 V = -2/3

13 An = US1n + VS2n S1 = S2 = -1 U = 4/ V = -2/3 An = 4/15(5)n + -2/3(-1)n

14 To check your answer a1 = 2 a2= 6 An = 4/15(5)n + -2/3(-1)n a1 = 2 = 4/15(5)1 + -2/3(-1)1 20/ /15 = 30/15 = 2 OR a2= 6 =4/15(5)2 + -2/3(-1) 2 100/ /3 100/ /15 = 90/15 = 6


Download ppt "3.5 Recurrence Relations."

Similar presentations


Ads by Google