Recurrence Relations
371 words
2 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Recurrence Relations ## 3.1 Intuition: Defining Sequences Recursively A recurrence defines each term of a sequence in terms of previous terms. The Fibonacci numbers $F_n = F_{n-1} + F_{n-2}$ are the most famous example.

Recurrence Relations
3.1 Intuition: Defining Sequences Recursively
A recurrence defines each term of a sequence in terms of previous terms. The Fibonacci numbers Fn=Fn−1+Fn−2 are the most famous example.
🔑 Key Insight: Many counting problems naturally yield recurrence relations.
3.2 Linear Homogeneous Recurrences
Form: an=c1an−1+c2an−2+⋯+ckan−k
Characteristic equation: rk−c1rk−1−c2rk−2−⋯−ck=0
Solution:
- Distinct roots r1,…,rk: an=α1r1n+⋯+αkrkn
- Repeated root r with multiplicity m: (α1+α2n+⋯+αmnm−1)rn
Example: Fibonacci
Fn=Fn−1+Fn−2, F0=0, F1=1 Characteristic: r2−r−1=0⟹r=21±5 Fn=51(ϕn−(−ϕ)−n) where ϕ=21+5
3.3 Non-Homogeneous Recurrences
Form: an=c1an−1+⋯+ckan−k+f(n)
Solution = homogeneous solution + particular solution.
Example: an=2an−1+3, a0=1
Homogeneous: an(h)=α⋅2n Particular: Try constant c: c=2c+3⟹c=−3 General: an=α⋅2n−3, a0=1⟹α=4 Solution: an=4⋅2n−3=2n+2−3
✅ Practice Questions
Q1: Solve an=3an−1−2an−2, a0=1, a1=2.
Solutionr2−3r+2=0⟹r=1,2 an=α⋅1n+β⋅2n=α+β⋅2n a0=α+β=1, a1=α+2β=2⟹β=1,α=0 an=2n Q2: Solve an=4an−1−4an−2, a0=0, a1=2. Solutionr2−4r+4=0⟹(r−2)2=0, repeated root r=2. an=(α+βn)⋅2n a0=α=0, a1=(0+β)⋅2=2⟹β=1 an=n⋅2n Join Discord PreviousPigeonhole & Inclusion-ExclusionNextRecurrence Applications