A recurrence relation is an equation that relates terms of a sequence to other terms of the same sequence, usually at smaller indices. Together with suitable initial conditions, it can define a sequence by successive computation. Recurrence relations express recursion mathematically and are used to describe numerical patterns and analyze algorithms. Solving a recurrence generally means finding an explicit formula or determining how its solutions grow. (discrete.openmathbooks.org)
Definition and initial conditions
A common finite-order form is
where is a specified function and is a fixed positive integer. When genuinely depends on the term steps earlier, the recurrence has order . For this explicit form, specifying determines subsequent terms uniquely, provided every evaluation of is defined. A recurrence without initial conditions normally describes a family of sequences rather than one sequence. (ocw.mit.edu)
For example,
gives . Likewise, gives . These illustrate the distinction between a recursive specification, which refers to previous values, and a closed-form expression, which computes a term directly from its index. A proposed formula can be verified using mathematical induction: check the initial values, then show that the formula satisfies the recurrence. (discrete.openmathbooks.org)
Classification
A recurrence is linear when its sequence terms occur to the first power and are not multiplied together. A linear recurrence of order can be written
It has constant coefficients when the are independent of . It is homogeneous when , and nonhomogeneous otherwise. For a homogeneous linear recurrence, any linear combination of solutions is again a solution. For a nonhomogeneous recurrence, the general solution is a particular solution plus the general solution of the corresponding homogeneous relation. (ocw.mit.edu)
Variable coefficients need not make a recurrence nonlinear. For instance, factorials satisfy , with , which is linear but has a coefficient depending on . By contrast, an expression involving is nonlinear. Thus linearity, coefficient dependence, and homogeneity are separate classification criteria. (ocw.mit.edu)
Characteristic-root method
For a homogeneous linear recurrence with constant coefficients,
substitution of an exponential trial solution leads to the characteristic polynomial
Assuming , if its roots are distinct, the general solution is
The constants are determined from the initial conditions through a system of linear equations. A root of multiplicity instead contributes
The method also accommodates complex roots. (math.libretexts.org)
The Fibonacci sequence is the standard second-order example:
Its characteristic equation is . Writing and , the initial conditions yield
Although this formula contains irrational quantities, it gives integer values at nonnegative integer indices because it satisfies the defining recurrence and initial conditions. (math.libretexts.org)
Generating functions
An ordinary generating function packages a sequence into a power series:
Multiplying a recurrence by and summing over its valid indices converts shifts in the sequence into algebraic operations on . Initial terms must be accounted for separately. The series can be treated formally, so these manipulations need not depend on analytic convergence. (math.libretexts.org)
For the Fibonacci sequence, the recurrence gives
and hence
Factoring the denominator and expanding the resulting fractions using geometric series recovers the explicit formula. More generally, generating functions translate a problem about indexed terms into one about algebraic expressions, after which coefficients are extracted to recover the sequence. (math.libretexts.org)
Algorithm analysis
In computer science, recurrences often describe running time rather than individual numerical sequences. A divide-and-conquer algorithm that creates subproblems of size approximately , with additional work , commonly leads to
Base cases and integer rounding complete the specification. For merge sort, the usual recurrence is , giving running time. Binary search instead gives , resulting in . (ocw.mit.edu)
Methods include repeated expansion, guessing a bound and proving it by induction, and summing work over a recursion tree. The master theorem handles many recurrences of the displayed divide-and-conquer form by comparing with . Its cases have specific growth and regularity conditions; it is not a universal method for arbitrary recurrences. In algorithm analysis, such complexity bounds are often more useful than exact formulas, because they characterize growth while suppressing implementation-dependent constants. (live.ocw.mit.edu)