Solving Linear Recurrences With Characteristic Roots
A technique for turning a recursive definition — where each term depends on the ones before it — into a closed-form formula you can evaluate directly, without stepping through every prior term.
Prerequisites: Mathematical Induction, Sequences and Series Convergence
An interviewer gives you a recurrence like with , , and asks for . You could compute nineteen steps by hand, but there's a faster route: find a formula for directly, plug in , and you're done. That formula-finding trick is the characteristic-root method, and it turns almost any interview recurrence into a two-line algebra problem.
The idea: guess a geometric form
A linear recurrence says each term is a fixed linear combination of the previous few terms, like . The trick is to guess that the solution looks like a geometric sequence, for some constant , and see what has to satisfy. Substituting into and dividing through by gives the characteristic equation:
In plain English: this is an ordinary quadratic whose roots are exactly the values of for which satisfies the recurrence on its own. If the quadratic has two distinct roots and , the general solution is a mix of both geometric sequences, , and the two unknown weights and are pinned down by the two starting values you were given.
Worked example: the recurrence above
For , the characteristic equation is , which factors as , giving roots , . So the general solution is
Use the starting values to solve for and . At : . At : . Substituting into the second equation gives , so , meaning and . The closed form is . Check it: ✓, ✓. Now is a one-line calculation instead of twenty steps of substitution.
Repeated roots
If the quadratic has a repeated root (discriminant zero), the second independent solution isn't again — it's . The general solution becomes . This matters because a naive guess of collapses to a single unknown and can't match two independent starting values.
What this means in practice
Beyond puzzle recurrences, this is the exact machinery behind analyzing algorithm running times (a recurrence like describes naive Fibonacci recursion) and behind discrete-time models of compounding processes with memory, like a portfolio rule that blends this period's and last period's signal. Whenever you see "each term depends linearly on the last one or two terms," reach for the characteristic equation instead of grinding through the recursion by hand.
For a linear recurrence , form the characteristic equation . Distinct roots give a closed form ; fit and using the given starting values.
The largest-magnitude root eventually dominates the sequence's growth rate — a fast way to sanity-check whether a sequence grows, shrinks, or oscillates without computing a single term.
Related concepts
Practice in interviews
Further reading
- Graham, Knuth, Patashnik, Concrete Mathematics, ch. 7