Logic and Discrete Mathematics Section 6.7 Recurrence Relations and Their Solution Slides version: January 2015
Definition A recurrence relation for a sequence a 0, a 1, a 2,... is a formula giving a n in terms of one or more of the terms preceding it (i.e in terms of a 0, a 1, a 2,..., a n 1 ), for any n greater than some initial integer k. The values of the first few terms of the sequence needed to start computing with the recurrence relation are called the initial conditions.
The Fibonacci sequence Let F 0 = 1, F 1 = 1, F 2 = 2, F 3 = 3, F 4 = 5, etc.
The Fibonacci sequence Let F 0 = 1, F 1 = 1, F 2 = 2, F 3 = 3, F 4 = 5, etc. We find that F n = F n 1 + F n 2 for all n 2. The necessary initial conditions are F 0 = 1, F 1 = 1.
The Fibonacci sequence Let F 0 = 1, F 1 = 1, F 2 = 2, F 3 = 3, F 4 = 5, etc. We find that for all n 2. F n = F n 1 + F n 2 The necessary initial conditions are F 0 = 1, F 1 = 1. This sequence is known as the Fibonacci sequence and the terms of the sequence are known as Fibonacci numbers.
The Lucas Numbers The sequence of Lucas numbers 2, 1, 3, 4, 7, 11,... has the initial conditions L 1 = 2 and L 2 = 1 and the recursion L n = L n 1 + L n 2.
The Lucas Numbers The sequence of Lucas numbers 2, 1, 3, 4, 7, 11,... has the initial conditions L 1 = 2 and L 2 = 1 and the recursion L n = L n 1 + L n 2. Note that this is the same recursion relation as for the Fibonacci numbers.
The Catalan Numbers The sequence of Catalan numbers is given recursively by C n+1 = C 1 C n + C 2 C n 1 + + C i C n+1 i + + C n C 1, with C 0 = C 1 = 1. The first eleven terms are 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796 C n can also be given non-recursively as follows: (2n)! C n+1 = (n + 1)!(n!) = 1 ( ) 2n, n = 0, 1, 2,.... n + 1 n
Significance of The Catalan Numbers (1) The number of ways to cut an (n + 2)-sided polygon into triangles by connecting its corners with n 1 non-intersecting straight line segments is equal to C n. Figure : Dividing the square. Figure : Dividing the pentagon.
Significance of The Catalan Numbers (2) The number of complete binary trees with n leaves is equal to C n 1. One leaf: Two leaves: Three leaves: Four leaves: Figure : Complete binary trees with one, two, three and four leaves
Definitions Definition A recurrence relation of the form a n = c 1 (n)a n 1 +c 2 (n)a n 2 +c 3 (n)a n 3 + + c m (n)a n m +f (n) where c 1, c 2,..., c m and f are functions of n, is called a linear recurrence relation of order m.
Definitions Definition A recurrence relation of the form a n = c 1 (n)a n 1 +c 2 (n)a n 2 +c 3 (n)a n 3 + + c m (n)a n m +f (n) where c 1, c 2,..., c m and f are functions of n, is called a linear recurrence relation of order m. The relation is homogeneous if f (n) = 0 for all n
Definitions Definition A recurrence relation of the form a n = c 1 (n)a n 1 +c 2 (n)a n 2 +c 3 (n)a n 3 + + c m (n)a n m +f (n) where c 1, c 2,..., c m and f are functions of n, is called a linear recurrence relation of order m. The relation is homogeneous if f (n) = 0 for all n The relation has constant coefficients and is of order m when the c i (n) s are all constant and c m 0.
Definitions Definition A recurrence relation of the form a n = c 1 (n)a n 1 +c 2 (n)a n 2 +c 3 (n)a n 3 + + c m (n)a n m +f (n) where c 1, c 2,..., c m and f are functions of n, is called a linear recurrence relation of order m. The relation is homogeneous if f (n) = 0 for all n The relation has constant coefficients and is of order m when the c i (n) s are all constant and c m 0. We consider recurrence relations that have the form a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0.
Characteristic Equation and Roots Definition x m c 1 x m 1 c 2 x m 2 c m = 0 is called the characteristic equation of the recurrence relation a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0.
Characteristic Equation and Roots Definition x m c 1 x m 1 c 2 x m 2 c m = 0 is called the characteristic equation of the recurrence relation a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0. The characteristic equation has m (not necessarily distinct) roots, r 1, r 2, r 3,... r m, referred to as characteristic roots.
Characteristic Equation and Roots Definition x m c 1 x m 1 c 2 x m 2 c m = 0 is called the characteristic equation of the recurrence relation a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0. The characteristic equation has m (not necessarily distinct) roots, r 1, r 2, r 3,... r m, referred to as characteristic roots. These roots may be real or complex.
Characteristic Equation and Roots Definition x m c 1 x m 1 c 2 x m 2 c m = 0 is called the characteristic equation of the recurrence relation a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0. The characteristic equation has m (not necessarily distinct) roots, r 1, r 2, r 3,... r m, referred to as characteristic roots. These roots may be real or complex. As c m 0, they are all different from 0.
Theorem: Solutions Theorem The sequence a n = r n is a solution of the recurrence a n = c 1 a n 1 + c 2 a n 2 + c 3 a n 3 + + c m a n m, c m 0. if and only if r is a root of the characteristic equation x m c 1 x m 1 c 2 x m 2 c m = 0 Hence, for each characteristic root r, a n = r n is a solution. These are called fundamental solutions.
Operations on Solutions Let (a n ) and (b n ) be sequences. Addition of the sequences: (a n ) + (b n ) is the sequence (a n + b n ), i.e. (a 1, a 2, a 3,...) + (b 1, b 2, b 3,...) = (a 1 + b 1, a 2 + b 2, a 3 + b 3,...).
Operations on Solutions Let (a n ) and (b n ) be sequences. Addition of the sequences: (a n ) + (b n ) is the sequence (a n + b n ), i.e. (a 1, a 2, a 3,...) + (b 1, b 2, b 3,...) = (a 1 + b 1, a 2 + b 2, a 3 + b 3,...). A constant multiple, k(a n ), of a sequence (a n ) is k(a n ) = (ka 1, ka 2, ka 3,...).
Theorem: Linear Combinations of Solutions Theorem If (a n ) and (b n ) satisfy a homogeneous linear recurrence relation with constant coefficients, then (a n ) + (b n ) and k(a n ) satisfy the same recurrence relation.
General Solution Distinct Roots Theorem Let the roots r 1, r 2, r 3,..., r m of the characteristic equation be distinct. Then a n = k 1 r n 1 + k 2r n 2 + k 3r n 3 + k mr n m is a general solution of the homogeneous linear recurrence relation, i.e. every solution can be expressed in this form for some choice of constants k 1, k 2, k 3..., k m. I.e. the fundamental solutions of a recurrence relation form a basis of the vector space of solutions of that relation.
Solution Procedure Distinct Roots 1. Write down the characteristic equation for the relation.
Solution Procedure Distinct Roots 1. Write down the characteristic equation for the relation. 2. Find the m roots of the characteristic equation. If the roots are distinct we obtain m fundamental solutions.
Solution Procedure Distinct Roots 1. Write down the characteristic equation for the relation. 2. Find the m roots of the characteristic equation. If the roots are distinct we obtain m fundamental solutions. 3. Take an arbitrary linear combination of the fundamental solutions to obtain a general solution.
Solution Procedure Distinct Roots 1. Write down the characteristic equation for the relation. 2. Find the m roots of the characteristic equation. If the roots are distinct we obtain m fundamental solutions. 3. Take an arbitrary linear combination of the fundamental solutions to obtain a general solution. 4. Using the initial conditions, construct and solve a system of equations to obtain the specific solution.
Examples: Distinct Roots Solve the following recurrence relations: 1. a n = 5a n 1 6a n 2 for n > 2, and with a 1 = 2 and a 2 = 10.
Examples: Distinct Roots Solve the following recurrence relations: 1. a n = 5a n 1 6a n 2 for n > 2, and with a 1 = 2 and a 2 = 10. 2. a n = a n 1 + 12a n 2 for n > 1, and with a 0 = 1 and a 1 = 2.
Examples: Distinct Roots Solve the following recurrence relations: 1. a n = 5a n 1 6a n 2 for n > 2, and with a 1 = 2 and a 2 = 10. 2. a n = a n 1 + 12a n 2 for n > 1, and with a 0 = 1 and a 1 = 2. 3. a n = 4a n 1 + 21a n 2 for for n > 2, and with a 1 = 2 and a 2 = 3.
Complex Roots Theorem If the roots of a characteristic equation of a homogeneous linear recurrence relation of degree two are complex numbers a + bi and a bi (i.e. the roots are complex conjugates) then the general solution of the recurrence relation is given by a n = ρ n (k 1 cos nθ + k 2 sin nθ) where ρ = a 2 + b 2, cos θ = a ρ and sin θ = b ρ.
Complex Roots Examples Solve the following recurrence relation: a n = 2 2a n 1 4a n 2 for n > 1, with a 0 = 1 and a 1 = 2.
Multiplicity of Roots A characteristic root r has multiplicity j if it appears as a root of the characteristic equation x m c 1 x m 1 c 2 x m 2 c m = 0 exactly j times. This is equivalent to (x r) j being a divisor of the polynomial x m c 1 x m 1 c 2 x m 2 c m but (x r) j+1 not being a divisor.
Repeated Roots Fundamental Solutions If r is a characteristic root of multiplicity j, then a n = r n, a n = nr n, a n = n 2 r n,... a n = n j 1 r n are linearly independent and can be taken as fundamental solutions.
Repeated Roots Example Solve the recurrence relation given by a n = 6a n 1 9a n 2 with a 0 = 1 and a 1 = 4.