DISCRETE MATH • RECURRENCE RELATIONS

Solve linear recurrences by iteration/expansion

Unroll a recurrence step by step to discover its closed-form solution and verify it by induction.

Historical Context & Motivation

Recurrence relations—equations that define each term of a sequence in terms of previous terms—are among the oldest structures in mathematics. Long before the formal language of discrete mathematics existed, mathematicians encountered sequences whose patterns demanded systematic methods for extracting explicit, closed-form expressions. The method of iteration (also called expansion or unrolling) is perhaps the most intuitive of all such techniques: substitute the recurrence into itself repeatedly until a pattern emerges, then collapse the pattern into a formula. Despite its conceptual simplicity, this approach has powered discoveries from Fibonacci's rabbit counting to the analysis of divide-and-conquer algorithms.

1202
Fibonacci's Liber Abaci
Leonardo of Pisa introduces the rabbit-growth sequence F(n) = F(n−1) + F(n−2), one of the earliest recorded recurrence relations in Western mathematics, solved by direct enumeration.
1718
De Moivre's Generating Functions
Abraham de Moivre develops generating-function techniques and derives the closed form of the Fibonacci sequence, complementing iterative reasoning with algebraic machinery.
1821
Cauchy's Formal Treatment
Augustin-Louis Cauchy formalizes difference equations and their solutions, placing the study of linear recurrences on rigorous analytic foundations.
1965
Knuth and Algorithm Analysis
Donald Knuth's The Art of Computer Programming popularizes the use of recurrence relations—and iterative expansion in particular—to analyze the running time of recursive algorithms such as merge sort.

The central question this lesson addresses is deceptively simple: given a recurrence relation and an initial condition, how can we repeatedly substitute the defining rule into itself to reveal a summation or product pattern, then express the result as a closed-form formula that depends only on n and the initial value? Mastering this technique builds the intuition that underpins more advanced methods such as the characteristic-root technique and the Master Theorem.

Core Principles & Definitions

Before diving into the mechanics of iteration, it is essential to formalize several foundational ideas. A recurrence relation defines a sequence {an} by expressing each term an as a function of one or more preceding terms and, possibly, of n itself. When the relation is linear (no products or powers of previous terms) and involves a constant number of predecessors, it is called a linear recurrence with constant coefficients—precisely the class most amenable to the iteration method.

1

Recurrence Relation

An equation that defines aₙ in terms of aₙ₋₁, aₙ₋₂, …, and possibly n. It requires initial/boundary conditions to yield a unique sequence.
2

Closed-Form Solution

An explicit formula for aₙ that depends only on n (and constants), containing no recursive references. The goal of every solving technique.
3

Iteration (Expansion)

Repeatedly substituting the recurrence into itself—replacing aₙ₋₁ by its own definition, then aₙ₋₂, and so on—until the base case is reached and a summation pattern appears.
4

Telescoping & Summation

After enough substitutions the expanded form collapses into a recognizable summation (geometric series, arithmetic series, etc.) that can be evaluated using known formulas.
5

Verification by Induction

Once a candidate closed form is guessed via iteration, mathematical induction provides a rigorous proof that the formula holds for all n ≥ n₀.
KEY TAKEAWAY
Think of a recurrence relation like a set of nested Russian dolls. Each doll (term) is defined by the one inside it (the previous term). Iteration is the process of opening every doll until you reach the solid innermost piece (the initial condition). Laying out all the layers side by side reveals the overall structure—a summation pattern you can evaluate in one shot.

Visual Explanation — Unrolling a Recurrence

The following diagram illustrates the iteration process for a first-order linear recurrence of the form an = c · an−1 + f(n). Each row represents one substitution step: the recursive term is replaced by its own definition, and the non-homogeneous part f(n) accumulates as a growing sum. The leftmost column tracks the multiplicative coefficient applied to the initial condition a0, while the right side displays the accumulated summation terms.

Each row replaces the recursive term with its definition. After n substitutions the initial condition a₀ is reached, producing a summation over all accumulated f-terms weighted by powers of c.

Observe how each step introduces one more term in the growing summation and simultaneously increases the exponent on the coefficient c that multiplies the initial condition. The pattern stabilizes after exactly n substitutions, at which point the recurrence has been fully unrolled to the base case. Recognizing this summation pattern—and evaluating it using known series formulas—is the crux of the iteration method.

Mathematical Framework

We now formalize the iteration procedure for first-order linear recurrences. Consider the general first-order linear recurrence with constant coefficient c and a forcing function f(n).

FIRST-ORDER LINEAR RECURRENCE
aₙ = c · aₙ₋₁ + f(n), n ≥ 1, a₀ given
c is a constant multiplier, f(n) is a function of n (the non-homogeneous term), and a₀ is the initial condition.

Iteration proceeds by replacing the recursive call on the right-hand side with its own definition. After one substitution we obtain an = c(c · an−2 + f(n−1)) + f(n) = c² · an−2 + c · f(n−1) + f(n). Continuing for k substitutions yields the following intermediate form.

AFTER k SUBSTITUTIONS
aₙ = cᵏ · aₙ₋ₖ + Σ (j=0 to k−1) cʲ · f(n − j)
k ranges from 1 to n. Each substitution peels off one layer of the recursion, converting a recursive reference into a summation term.

Setting k = n reaches the base case a₀, and we obtain the general closed form.

GENERAL CLOSED FORM
aₙ = cⁿ · a₀ + Σ (j=0 to n−1) cʲ · f(n − j)
The first term cⁿ · a₀ is the homogeneous contribution; the summation is the particular contribution from f(n). If f(n) = 0 (homogeneous case), aₙ = cⁿ · a₀.
💡 Geometric Series Shortcut
When f(n) is a constant d, the summation becomes d · Σ (j=0 to n−1) cʲ. If c ≠ 1 this is a geometric series equal to d · (cⁿ − 1)/(c − 1). If c = 1, the sum equals d · n. These two cases cover a large fraction of textbook problems.

Common Forms & Classification

Not every recurrence looks identical, so it is helpful to classify the most common first-order forms and the summations they produce upon iteration. The table below catalogues four archetypes: the homogeneous case, the constant-forcing case, the linear-forcing case, and the exponential-forcing case. Each row shows the recurrence, the expanded summation obtained after full iteration, and the resulting closed form.

Common first-order linear recurrence archetypes and their closed forms after iteration.
TypeRecurrenceExpanded SummationClosed Form (c ≠ 1)
Homogeneousaₙ = c · aₙ₋₁cⁿ · a₀cⁿ · a₀
Constant forcingaₙ = c · aₙ₋₁ + dcⁿ · a₀ + d · Σ cʲcⁿ · a₀ + d(cⁿ − 1)/(c − 1)
Linear forcingaₙ = c · aₙ₋₁ + ncⁿ · a₀ + Σ (n−j)·cʲRequires splitting into two geometric sums
Exponential forcingaₙ = c · aₙ₋₁ + rⁿcⁿ · a₀ + Σ cʲ · rⁿ⁻ʲcⁿ · a₀ + rⁿ · (1 − (c/r)ⁿ)/(1 − c/r) if c ≠ r
This decision flowchart guides you from the general recurrence form through a series of yes/no questions to the appropriate closed-form formula. The green-bordered boxes show the final results.

The flowchart above provides a systematic way to navigate the iteration result. In practice, the critical skill is recognizing the summation produced by the expansion and matching it to a known formula. Most frequently, you will encounter geometric series (when f(n) is constant or exponential) or arithmetic-geometric hybrid sums (when f(n) is polynomial).

Worked Example

Let us solve the recurrence an = 3an−1 + 2 with initial condition a₀ = 1 using the iteration method.

Solving aₙ = 3aₙ₋₁ + 2, a₀ = 1
1
Step 1 — Write the recurrence and expand one levelStarting from the definition: aₙ = 3aₙ₋₁ + 2. Replace aₙ₋₁ with its own definition: aₙ₋₁ = 3aₙ₋₂ + 2. Substituting: aₙ = 3(3aₙ₋₂ + 2) + 2 = 3²·aₙ₋₂ + 3·2 + 2 = 9aₙ₋₂ + 6 + 2.
aₙ = 9aₙ₋₂ + 8
2
Step 2 — Expand a second level and identify the patternReplace aₙ₋₂ using aₙ₋₂ = 3aₙ₋₃ + 2: aₙ = 9(3aₙ₋₃ + 2) + 8 = 27aₙ₋₃ + 18 + 8 = 3³·aₙ₋₃ + 2(3² + 3¹ + 3⁰). After k expansions the pattern is: aₙ = 3ᵏ · aₙ₋ₖ + 2·Σ(j=0 to k−1) 3ʲ.
Pattern: aₙ = 3ᵏ · aₙ₋ₖ + 2 · (3ᵏ − 1)/(3 − 1)
3
Step 3 — Set k = n to reach the base caseWhen k = n we reach a₀ = 1: aₙ = 3ⁿ · a₀ + 2 · (3ⁿ − 1)/2 = 3ⁿ · 1 + (3ⁿ − 1). The geometric series Σ(j=0 to n−1) 3ʲ = (3ⁿ − 1)/(3 − 1) = (3ⁿ − 1)/2.
aₙ = 3ⁿ + 3ⁿ − 1 = 2 · 3ⁿ − 1
4
Step 4 — Verify with small valuesCheck: a₀ = 2·3⁰ − 1 = 2 − 1 = 1 ✓. a₁ = 3(1) + 2 = 5; formula gives 2·3¹ − 1 = 6 − 1 = 5 ✓. a₂ = 3(5) + 2 = 17; formula gives 2·3² − 1 = 18 − 1 = 17 ✓. a₃ = 3(17) + 2 = 53; formula gives 2·3³ − 1 = 54 − 1 = 53 ✓.
Closed form verified: aₙ = 2 · 3ⁿ − 1
📐 Proof by Induction
Although spot-checking confirms the formula, a formal proof by induction is the gold standard. Base case: a₀ = 2·3⁰ − 1 = 1 ✓. Inductive step: assume aₖ = 2·3ᵏ − 1. Then aₖ₊₁ = 3(2·3ᵏ − 1) + 2 = 2·3ᵏ⁺¹ − 3 + 2 = 2·3ᵏ⁺¹ − 1 ✓. By the principle of mathematical induction the closed form holds for all n ≥ 0.

Strengths, Limitations & Comparisons

The iteration method is one of several techniques available for solving recurrence relations. Understanding its strengths and limitations relative to alternatives helps you choose the right tool for a given problem. Below we compare iteration with the characteristic-root method, generating functions, and the Master Theorem.

Comparison of recurrence-solving techniques.
CriterionIteration / ExpansionCharacteristic RootsGenerating Functions
Intuition requiredLow — purely mechanical substitutionMedium — requires solving polynomial equationsHigh — algebraic manipulation of formal power series
Best suited forFirst-order and simple divide-and-conquer recurrencesConstant-coefficient homogeneous recurrences of any orderComplex non-homogeneous and combinatorial recurrences
Handles non-constant coefficients?Limited — works when a product pattern emergesNo — requires constant coefficientsYes, in many cases
Produces rigorous proof?No — produces a conjecture; needs induction to proveYes — via the general theory of linear recurrencesYes — via formal algebraic identity
Ease of learningVery easy — no prerequisites beyond summation formulasModerate — requires polynomial factoringDifficult — requires comfort with power series
🔧 WHEN TO USE ITERATION
Iteration is the Swiss Army knife of recurrence solving: it is portable, easy to use, and works well for most first-order problems. But just as a Swiss Army knife cannot replace a full machine shop, iteration becomes cumbersome for higher-order recurrences (e.g., Fibonacci) where characteristic roots or generating functions provide a more elegant path. Use iteration first to build intuition, then graduate to more powerful tools as complexity demands.

Connection to Advanced Theory

The iteration technique does not exist in isolation; it directly connects to several deeper ideas in discrete mathematics and computer science. In algorithm analysis, the recurrences that arise from divide-and-conquer algorithms—such as T(n) = aT(n/b) + f(n)—are routinely solved by a form of iteration called recursion-tree expansion, which is essentially the iteration method applied to a recurrence with a multiplicative argument reduction instead of a subtractive one. The Master Theorem itself was originally motivated by iterating such recurrences and observing recurring patterns in the resulting sums.

How iteration concepts generalize to advanced topics.
Concept from IterationAdvanced Generalization
Repeated substitution until base caseRecursion-tree method for divide-and-conquer recurrences (T(n) = aT(n/b) + f(n))
Geometric series from constant-coefficient unrollingMaster Theorem cases (comparing f(n) growth to n^(log_b a))
Conjecture-then-verify-by-induction workflowSubstitution method for recurrence proofs
Summation of cʲ · f(n−j) termsDiscrete convolution; connection to generating-function multiplication

Perhaps the most elegant connection is to generating functions. The summation Σ cʲ · f(n−j) produced by iteration is, in fact, a discrete convolution. In the generating-function framework, convolution corresponds to multiplication of two formal power series. This means that the entire iteration procedure—substitution, accumulation, and evaluation—can be compressed into a single algebraic identity in the world of generating functions. Gaining comfort with iteration thus provides the conceptual scaffolding for the more abstract machinery you will encounter in advanced combinatorics courses.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why the iteration method produces a summation term alongside a power of the coefficient multiplied by the initial condition. Why does the method naturally yield a conjecture rather than a proof?
PROBLEM 2BASIC CALCULATION
Solve the recurrence aₙ = 2aₙ₋₁ + 1, a₀ = 0, by iteration. Express your answer in closed form.
PROBLEM 3INTERMEDIATE
Find a closed form for aₙ = 2aₙ₋₁ + 3ⁿ, a₀ = 5, using the iteration method.
PROBLEM 4APPLIED
A computer program processes a task of size n by splitting it into one sub-task of size n−1 and doing n units of extra work. This gives T(n) = T(n−1) + n with T(0) = 0. Use iteration to find T(n) in closed form and interpret the result in terms of algorithm efficiency.
PROBLEM 5CRITICAL THINKING
Consider the non-constant-coefficient recurrence aₙ = n · aₙ₋₁ with a₀ = 1. Apply the iteration technique to find the closed form. Then explain why the standard first-order linear framework (aₙ = c · aₙ₋₁ + f(n) with constant c) does not directly apply, yet iteration still works.

Summary & Review

The iteration/expansion method solves a recurrence relation by repeatedly substituting the defining rule into itself until the initial condition is reached. For the first-order linear form aₙ = c · aₙ₋₁ + f(n), full expansion yields aₙ = cⁿ · a₀ + Σ cʲ · f(n−j), where the summation is evaluated using geometric series or related formulas. The result is a closed-form conjecture that should be verified by mathematical induction.

Key special cases include the homogeneous case (f(n) = 0, yielding aₙ = cⁿ · a₀), the constant-forcing case (f(n) = d, producing a geometric sum), and the exponential-forcing case (f(n) = rⁿ). This method is the conceptual foundation for the recursion-tree method in algorithm analysis and connects to generating functions via discrete convolution.

Varsity Tutors • Discrete Math • Solve linear recurrences by iteration/expansion