01 / 20
\( a_n \)
\( r^k = 0 \)

Linear Recurrences
Characteristic Equations

Learn to solve recurrence relations by converting them into polynomial equations and finding closed-form solutions.

Discrete Math

What Is a Recurrence Relation?

A recurrence relation defines each term of a sequence using previous terms. Instead of a direct formula, it gives a recursive rule:

Our goal: find a closed-form formula \( a_n = f(n) \) that gives any term directly without computing all previous terms.

Linear Homogeneous Recurrences

We focus on linear homogeneous recurrences with constant coefficients. The general form of order \( k \) is:

Linear
Each \( a_{n-i} \) appears to the first power only
Homogeneous
No extra term: right side is only multiples of previous \( a \) terms
Constant Coefficients
The multipliers \( c_i \) do not depend on \( n \)

Why Does This Matter?

Recurrences appear everywhere in computer science and mathematics. Solving them lets us analyze algorithm runtime, count combinatorial objects, and model growth processes.

Algorithms
Merge sort, Fibonacci heaps, and dynamic programming all produce recurrences
Counting
Tiling problems, paths on grids, and derangements follow recursive patterns
Modeling
Population dynamics and financial growth use recurrence relations

The Key Insight: Try \( a_n = r^n \)

The magic trick: guess that the solution has the form \( a_n = r^n \) for some constant \( r \). Substituting into the recurrence turns it into a polynomial equation.

RECURRENCE
\( a_n = c_1a_{n-1} + c_2a_{n-2} \)
SUBSTITUTE
\( r^n = c_1r^{n-1} + c_2r^{n-2} \)
DIVIDE BY \( r^{n-2} \)
\( r^2 = c_1r + c_2 \)
CHARACTERISTIC EQUATION
\( r^2 - c_1r - c_2 = 0 \)
Solve for \( r_1, r_2 \)

The Characteristic Equation

More generally, for an order-\( k \) recurrence \( a_n = c_1 a_{n-1} + \cdots + c_k a_{n-k} \), the characteristic equation is:

Distinct vs Repeated Roots

For a second-order recurrence, the characteristic equation is quadratic with two roots. The solution form depends on whether those roots are distinct or repeated:

Case 1: Distinct Roots
If \( r_1 \neq r_2 \), the general solution is: $$ a_n = A\,r_1^n + B\,r_2^n $$ where \( A, B \) are constants determined by initial conditions.
Case 2: Repeated Root
If \( r_1 = r_2 = r_0 \), the general solution is: $$ a_n = (A + Bn)\,r_0^n $$ The extra factor of \( n \) is needed for a second independent solution.

How to Solve: Step by Step

1
Write the characteristic equation. From \( a_n = c_1 a_{n-1} + c_2 a_{n-2} \), form \( r^2 - c_1 r - c_2 = 0 \).
2
Solve for the roots \( r_1, r_2 \) using factoring or the quadratic formula.
3
Write the general solution. Distinct roots: \( a_n = Ar_1^n + Br_2^n \). Repeated root: \( a_n = (A + Bn)r_0^n \).
4
Apply initial conditions. Plug in \( a_0 \) and \( a_1 \) to create a system of two equations in \( A \) and \( B \).
5
Solve for \( A \) and \( B \). Substitute back to get the final closed-form formula.

Example 1: Distinct Roots

1
Characteristic equation: \( r^2 - 5r + 6 = 0 \)
2
Factor: \( (r - 2)(r - 3) = 0 \), so \( r_1 = 2 \) and \( r_2 = 3 \)
3
General solution: \( a_n = A \cdot 2^n + B \cdot 3^n \)

Example 1: Finding \( A \) and \( B \)

We have \( a_n = A \cdot 2^n + B \cdot 3^n \). Now apply the initial conditions:

4
\( n = 0 \): \( A \cdot 1 + B \cdot 1 = 1 \) gives \( A + B = 1 \)
5
\( n = 1 \): \( 2A + 3B = 4 \)
6
Solve: From \( A = 1 - B \), substitute: \( 2(1 - B) + 3B = 4 \) gives \( B = 2 \), \( A = -1 \)

Example 2: Repeated Root

1
Characteristic equation: \( r^2 - 6r + 9 = 0 \)
2
Factor: \( (r - 3)^2 = 0 \), so \( r_0 = 3 \) is a repeated root
3
General solution: \( a_n = (A + Bn) \cdot 3^n \)
4
\( n = 0 \): \( A = 1 \). \( n = 1 \): \( (1 + B) \cdot 3 = 6 \) gives \( B = 1 \).

Example 3: The Fibonacci Sequence

1
Characteristic equation: \( r^2 - r - 1 = 0 \)
2
Quadratic formula: \( r = \frac{1 \pm \sqrt{5}}{2} \). The roots are \( r_1 = \varphi = \frac{1+\sqrt{5}}{2} \) (the golden ratio) and \( r_2 = \hat{\varphi} = \frac{1-\sqrt{5}}{2} \).
3
After solving for \( A, B \): the famous Binet's formula: $$ F_n = \frac{1}{\sqrt{5}}\left(\varphi^n - \hat{\varphi}^n\right) $$

Visualizing the Solution

The closed-form solution is a combination of exponential functions. For \( a_n = -2^n + 2 \cdot 3^n \) from Example 1:

n
\( a_n \)
0 50 100 150 200 250 0 1 2 3 4 5 1 4 14 46 146
\( a_n = -2^n + 2 \cdot 3^n \)

Homogeneous vs Non-Homogeneous

Homogeneous Non-Homogeneous
Form \( a_n = c_1 a_{n-1} + c_2 a_{n-2} \) \( a_n = c_1 a_{n-1} + c_2 a_{n-2} + f(n) \)
Extra term None \( f(n) \) (e.g., \( 3^n \), \( n^2 \), constant)
Method Characteristic equation alone Characteristic eq. + particular solution
This lesson ✓ Covered Not yet

Common Mistakes

✕ Wrong Sign in Characteristic Eq.
From \( a_n = 5a_{n-1} - 6a_{n-2} \), writing \( r^2 - 5r - 6 = 0 \) instead of \( r^2 - 5r + 6 = 0 \). Move all terms to one side carefully.
✕ Using Distinct-Root Formula for Repeated Root
When \( r_1 = r_2 \), writing \( A r^n + B r^n \) collapses to one term. You need the \( (A + Bn)r^n \) form.
✕ Forgetting Initial Conditions
The general solution has infinitely many possibilities. Without plugging in \( a_0 \) and \( a_1 \), you cannot determine \( A \) and \( B \).

Summary Reference

Scenario Roots General Solution
Two distinct real roots \( r_1 \neq r_2 \) \( A r_1^n + B r_2^n \)
One repeated real root \( r_1 = r_2 = r_0 \) \( (A + Bn) r_0^n \)
Complex conjugate roots \( r = \alpha \pm \beta i \) \( \rho^n(A\cos n\theta + B\sin n\theta) \)

Question 1 of 5

What is the characteristic equation for the recurrence \( a_n = 7a_{n-1} - 10a_{n-2} \)?

Question 2 of 5

The characteristic equation \( r^2 - 5r + 6 = 0 \) factors as \( (r-2)(r-3) = 0 \). What is the general solution?

Question 3 of 5

For the recurrence \( a_n = 4a_{n-1} - 4a_{n-2} \), the characteristic equation is \( r^2 - 4r + 4 = 0 \). What form does the general solution take?

Question 4 of 5

Given \( a_n = A \cdot 2^n + B \cdot 5^n \) with \( a_0 = 3 \) and \( a_1 = 8 \), what system of equations do you solve for \( A \) and \( B \)?

Question 5 of 5

The Fibonacci recurrence \( F_n = F_{n-1} + F_{n-2} \) has characteristic roots \( \varphi = \frac{1+\sqrt{5}}{2} \) and \( \hat\varphi = \frac{1-\sqrt{5}}{2} \). As \( n \to \infty \), which term dominates?