Recurrence Relations
How many binary strings of length avoid two consecutive zeros? Counting them directly by brute force becomes hopeless as grows. Yet a simple observation about how such a string must end changes everything. It turns the problem into arithmetic on small numbers. This is the central move of enumerative combinatorics. Instead of counting a large structure from scratch, express its count using smaller structures of the same kind. A recurrence relation is the equation that records this relationship. An initial condition anchors it to concrete small cases. Together they ensure the equation determines a unique sequence. Recurrence relations matter for an important reason. A huge fraction of counting problems that arise naturally — tilings, binary strings, ways to climb a staircase, subsets without adjacent elements, sequences of parenthesizations — decompose according to "what happens at the last step" or "what happens at the first step." That decomposition is almost always easier to see and prove correct than a closed formula would be. This is because it uses the Sum and Product Rules on a small, structurally clear case split. It does not require a global combinatorial argument. The big picture is this: a recurrence relation, together with initial conditions, is a finite piece of data. It is a difference equation plus a handful of numbers. Together these pin down an infinite sequence completely. This works in the same way that a differential equation with initial conditions pins down a function. Much of the analytic machinery built later in combinatorics (Solving Linear Recurrences, Ordinary Generating Functions) exists for a precise purpose. It converts this implicit recursive description into an explicit closed-form or asymptotic one. This article gives the precise definition of a recurrence relation and of a sequence satisfying one. It builds intuition through a worked "tiling" picture. It proves the fundamental existence-and-uniqueness theorem. This theorem justifies calling recurrence-plus-initial-conditions a complete description of a sequence. The article then works through two genuinely different examples. One is linear, and one comes from a very different combinatorial family. Together they show the technique's reach. It closes with the historical figure most associated with the paradigmatic example, the Fibonacci recurrence. Finally, it points toward the sequences (Catalan numbers) and tools (generating functions) that recurrences feed into.
- A recurrence relation expresses in terms of earlier terms ; initial conditions supply the starting values.
- Finding a recurrence usually means finding a bijective case split on the "last piece" of the combinatorial object being counted.
- A recurrence relation plus enough initial conditions determines the entire sequence uniquely — this is a genuine theorem, proved by induction.
- The order of a recurrence tells you exactly how many initial conditions are needed; too few leaves the sequence undetermined, too many is redundant but not wrong.
- Recurrences are computationally exact but not automatically informative about growth rate or closed form — that is the job of later solving techniques.
- Key idea: Decompose a size- combinatorial structure by what its last (or first) piece can be, then count each case with smaller structures.
Where this lives today
Recurrence relations are the backbone of algorithm analysis in computer science: the running time of a divide-and-conquer algorithm such as merge sort is captured by a recurrence like , and solving such recurrences (via the Master Theorem, itself a descendant of the linear-recurrence machinery) is standard practice in complexity analysis. Dynamic programming, one of the most widely used algorithmic paradigms, is precisely the systematic computation of a sequence (or array) defined by a recurrence relation, evaluated bottom-up from initial conditions exactly as in the existence proof above. In cryptography and pseudorandom number generation, linear feedback shift registers produce bit sequences governed by linear recurrences over finite fields, and the theory of such recurrences (periods, initial states) underlies stream ciphers. In statistics and time series analysis, autoregressive models express each observation as a function of previous observations plus noise — a stochastic analogue of a linear recurrence relation, with initial conditions replaced by a starting distribution. In numerical analysis, recurrence relations generate special functions (Legendre polynomials, Bessel functions, Chebyshev polynomials) far more efficiently than their closed-form definitions, and the initial-value framework here is exactly what guarantees the recursively computed values match the analytically defined functions. In combinatorics itself, recurrences are the natural intermediate step between "a bijective description of a structure" and "an explicit formula or generating function," a bridge fully built in Solving Linear Recurrences, Catalan Numbers, and Ordinary Generating Functions.
Ask the tutor: How do I convert a recurrence relation with initial conditions into a closed-form formula?
Let be a sequence of real (or complex) numbers, indexed by integers for some fixed . A recurrence relation of order for is an equation of the form
where is a fixed function of arguments and is a fixed integer (the order). The relation expresses each term, from index onward, in terms of the immediately preceding terms (and possibly itself).
Initial conditions are prescribed values
for the first terms of the sequence. A sequence satisfies the recurrence relation with these initial conditions if both the initial equalities and the recurrence equation hold for every applicable index. Such a sequence is said to be defined by (or to be a solution of) the recurrence relation and initial conditions. The recurrence relation is called linear if has the form
and linear with constant coefficients if additionally each is a constant not depending on ; it is homogeneous if furthermore .
Intuition
The right mental picture is peeling off the last piece. Suppose you are counting objects of "size " — strings of length , tilings of a strip, subsets of with some property — and every such object of size can be built by taking an object of smaller size and attaching one new piece at the end, in a way that is reversible and covers every case exactly once. Then the count is literally a sum, over the finitely many ways to attach that last piece, of the counts of objects of the corresponding smaller sizes. This is nothing more than the Sum and Product Rules applied to a case split on "what is the last piece," but the case split is what a recurrence is. The classic picture is tiling a board with squares and dominoes. A tiling of length either ends in a square — remove it, and a tiling of length remains — or ends in a domino — remove it, and a tiling of length remains. Every tiling falls into exactly one of these two cases, and every tiling of length or extends uniquely to a tiling of length by appending the corresponding last piece. Hence , the Fibonacci recurrence, with (the empty tiling) and (one square).
Notice what makes this rigorous rather than merely suggestive: the two cases are disjoint (a tiling's last piece is either a square or a domino, never both, never neither) and exhaustive (every tiling has a well-defined last piece), and within each case there is a bijection between tilings of length ending that way and tilings of length (resp. ) — obtained by deleting or restoring the last piece. Whenever a combinatorial family admits such a decomposition, a recurrence follows immediately from the Sum Rule.
Let be an integer, let , let be a function, and let be given constants. Then there exists exactly one sequence such that
and
We prove existence and uniqueness separately, both by strong induction on . The technique is induction with a -term lookback, i.e. strong induction where the inductive step uses the previous values rather than just one.
Existence. We construct a sequence satisfying both the initial conditions and the recurrence, by strong induction on . Base case. For , define . This directly satisfies the required initial conditions by definition. Inductive step. Let , and suppose have already been defined (this is the strong inductive hypothesis; note , so at least the base case values exist, and if then was itself constructed by this same step at an earlier stage). In particular the values are all defined, since . Define
This is a legitimate definition because is a genuine function (single-valued) on its domain, and all arguments are already-defined real numbers. By strong induction, this process defines for every integer , and by construction the initial conditions hold and the recurrence equation holds for every . This proves existence.
Uniqueness. Suppose and are two sequences, both satisfying the same initial conditions and the same recurrence relation. We show for all , by strong induction on . Base case. For , both sequences equal by the initial conditions, so . Inductive step. Let and suppose for every with (strong inductive hypothesis). Since , the recurrence applies to both sequences at index :
Each of lies between and inclusive (because and ), so by the inductive hypothesis for . Since is a single function applied to identical argument tuples , we get . By strong induction, for all , i.e. the two sequences are identical. This proves uniqueness.
∎For a recurrence relation of order as above, exactly initial conditions (values of consecutive terms starting at ) suffice to determine the sequence uniquely, and no proper subset of fewer than consecutive starting values does so in general.
Sufficiency of initial conditions is exactly the existence-and-uniqueness theorem above. For the necessity direction: fixing fewer than , say only (leaving free), one can typically construct two different functions -driven completions — concretely, for the order-2 recurrence with only fixed, both (giving Fibonacci numbers ) and (giving ) yield valid, distinct sequences satisfying the same recurrence and the same partial data. Hence initial values do not pin down a unique sequence in general.
∎Worked examples
Example 1 — Binary strings with no two consecutive zeros (a linear, order-2 recurrence). Let be the number of binary strings of length (over the alphabet ) containing no two consecutive 's, and set (the empty string vacuously has no such pattern). Finding the recurrence. Fix and consider a valid string of length . Split on the last symbol :
- If : then is itself an arbitrary valid string of length (deleting a trailing can never create or destroy a "00" pattern elsewhere), and conversely every valid string of length extends uniquely by appending a . This gives a bijection with valid strings of length : strings.
- If : since two consecutive zeros are forbidden, we must have (this forces ). Then is an arbitrary valid string of length , and conversely every valid string of length extends uniquely to a valid string of length by appending "". This gives a bijection with valid strings of length : strings.
These two cases are disjoint (they differ in the value of ) and exhaustive (every string has ), so by the Sum Rule,
Initial conditions. (empty string). For : both strings "0" and "1" are valid (a single has no consecutive pair), so . Computing. Using :
So there are exactly binary strings of length with no two consecutive 's. As a direct check for a small case: for the valid strings are — that is strings out of total, excluding only ... but wait, we must also exclude any string containing "00" as a substring, not just equal to it. Let's recheck exhaustively: all strings are . Those containing "00" as a substring: (contains "00" twice), (contains "00"), (contains "00"). That excludes strings, leaving valid strings, matching computed from the recurrence — confirming correctness (the illustrative list above was miscounted and the recurrence's value of , verified by this direct enumeration, is the correct one). This sequence is exactly the Fibonacci sequence shifted in index — a first hint of how different combinatorial problems can produce the same recurrence, a phenomenon fully explained once one studies Solving Linear Recurrences.
Example 2 — Counting well-formed expressions built from a binary operation (order dependent on all smaller indices, foreshadowing Catalan numbers). Let , for , denote the number of ways to fully parenthesize a product of symbols using a single binary (non-associative, non-commutative) operation , where counts the trivial "product" of a single symbol (no operation needed). Finding the recurrence. For , any full parenthesization of has, as its outermost operation, exactly one application of splitting the expression into a left block and a right block:
for some unique split point with . The left block is a fully parenthesized product of symbols, and the right block is a fully parenthesized product of symbols; these two sub-parenthesizations can be chosen completely independently of each other. This is a case split on (disjoint because the outermost operation's position is uniquely recoverable from the parenthesization, exhaustive because every parenthesized expression with has some outermost operation), combined with independent choices governed by the Product Rule within each case. Hence
with initial condition . This is not a fixed-order recurrence in the sense of the definition above (each depends on all of , not just a bounded lookback of terms) — a useful reminder that the order- framework, while central, does not capture every recurrence one meets. Existence and uniqueness of the sequence still hold by the identical strong-induction argument (only the base case and the "" become , a function of a variable number of previous terms, and the same induction proof goes through verbatim with replaced by "all smaller indices"). Computing. .
So a product of symbols can be fully parenthesized in exactly ways — for instance is one of them, corresponding to split point on the outermost level and a further split within the left block. These are the Catalan numbers, whose closed form and generating function are developed under Catalan Numbers.
The existence-and-uniqueness theorem requires both the recurrence relation and the full set of initial conditions. To see that the recurrence by itself is not enough, consider the order- linear recurrence
with no initial conditions specified at all. Both of the following sequences satisfy this recurrence for every :
Indeed , , and so on, so genuinely satisfies the same recurrence relation. Yet term by term. Even worse, for any choice of , the resulting sequence satisfies the recurrence, so without initial conditions the "recurrence relation" describes an entire two-parameter family of sequences rather than a single one. This is precisely why the hypothesis " initial conditions are given" cannot be dropped from the theorem: existence is unaffected (some sequence, in fact infinitely many, always satisfies a well-posed recurrence), but uniqueness fails completely. Weakening the hypothesis to "at least one initial condition given" also fails: with only fixed, one free parameter remains, still yielding infinitely many solutions. All consecutive initial values are needed, matching exactly the order of the recurrence.
Scope, edge cases & common traps
| Situation | What to watch for |
|---|---|
| Order of the recurrence | Must match the number of initial conditions supplied; mismatches break uniqueness (see counterexample) |
| Case split for "finding" a recurrence | Cases must be disjoint and exhaustive, and each case must be a genuine bijection with a smaller instance, not just "roughly the same count" |
| Variable-lookback recurrences (e.g. Catalan) | Do not force every recurrence into the fixed order- template; existence/uniqueness still holds via the same induction, adapted |
| Non-constant coefficients or nonlinear | The existence/uniqueness theorem places no linearity assumption on — it holds for arbitrary well-defined , only later solving techniques require linearity |
| Off-by-one indexing | Recheck whether the recurrence's first valid index is or something else; misindexing silently corrupts the initial conditions needed |
The mathematician behind it
Origins · 1 minLeonardo of Pisa (Fibonacci) and how this was discovered
Leonardo of Pisa, known as Fibonacci, was a merchant's son who traveled extensively through the Mediterranean world and encountered the Hindu–Arabic numeral system and Arabic mathematical texts during his travels, particularly in Béjaïa (in present-day Algeria). His book Liber Abaci (1202) introduced this numeral system to a European audience alongside a wealth of practical and recreational arithmetic problems. Among these was the now-famous rabbit-breeding problem, whose solution is the sequence satisfying exactly the order-2 recurrence — the paradigmatic example around which the modern theory of recurrence relations is often first taught, even though Fibonacci himself did not develop a general theory of recurrences.
What is the difference between a recurrence relation and a formula?
A formula (closed form) gives directly as an expression in alone, computable in one step without reference to other terms — e.g. . A recurrence relation instead expresses in terms of previous terms of the same sequence, so computing requires having already computed . Both can define the same sequence: for instance satisfies the recurrence with . Recurrences are often easier to discover from a combinatorial argument, since they only require understanding how a size- object relates to smaller ones, while closed forms often require extra algebraic work (see Solving Linear Recurrences) to extract from the recurrence.
How do I find a recurrence relation for a new counting problem?
Look for a natural way to remove or isolate one "piece" of the object being counted — often the last element, last row, last symbol, or outermost structural feature — such that the remaining piece is itself a smaller instance of the same kind of object. Check three things rigorously: the cases arising from different choices of that piece are disjoint, they are exhaustive (cover every object), and each case is in bijection with objects of some smaller size. Then the Sum Rule (across cases) and Product Rule (within a case, if there are independent sub-choices) combine to give the recurrence, exactly as in the tiling and parenthesization examples above.
Does every recurrence relation have order exactly some fixed k?
No. The definition given here covers fixed-order recurrences, where depends only on the previous terms for a fixed . Many important combinatorial recurrences, such as the Catalan recurrence , have depending on all previous terms, with the number of terms involved growing with . The existence-and-uniqueness argument still applies with minor rewording (strong induction using all smaller indices rather than a fixed lookback window), but such recurrences fall outside the strict order- template.
Why must initial conditions start at consecutive indices from ?
The uniqueness proof by strong induction needs a solid, gap-free base case: to compute for via the recurrence, all of must already be known, and inductively this traces back to needing every one of pinned down with no gaps. If, say, were left unspecified while and were given, the induction could not get started at , since one of its required arguments would be undetermined, and multiple sequences would again satisfy the data.
Is a linear recurrence with constant coefficients always easier to solve than a general one?
Generally yes, in the sense that a full theory (characteristic equations, closed-form solutions) exists specifically for linear recurrences with constant coefficients, developed under Solving Linear Recurrences. Nonlinear recurrences, or ones with coefficients depending on , often have no simple closed form at all, and one falls back on generating functions (Ordinary Generating Functions) or purely numerical/asymptotic analysis. The Catalan recurrence in this article, despite being "only" a sum of products, is already not linear in the constant-coefficient sense (it is a convolution), which is exactly why its closed form requires generating-function techniques rather than the elementary characteristic-root method.
Can a recurrence relation have more than one valid set of initial conditions describing the "same" combinatorial sequence?
No — for a fixed sequence, its values at the first indices are simply whatever they are; there is only one correct set of initial conditions once the combinatorial problem and starting index are fixed. What can vary is the presentation: sometimes a problem is naturally indexed starting at with one small case, sometimes starting at with a different one, and shifting the index changes which numbers count as "the" initial conditions, but does not change the underlying sequence once translated back to a common indexing.