Recurrence relation

In mathematics, a recurrence relation is an equation that expresses the nth term of a sequence as a function of the k preceding terms, for some fixed k (independent from n), which is called the order of the relation. Once k initial terms of a sequence are given, the recurrence relation allows computing recursively all terms of the sequence.

Most general results on recurrence relations are about linear recurrences, which are recurrence relations such that the nth term is linear with respect to its preceding terms. Among them, linear recurrences with constant coefficients, and linear recurrences with polynomial coefficients are specially important. In the first case, this is because one can express the general term of the sequence as a closed-form expression of the index of the term. In the second case, this is beause many common elementary and special functions have a Taylor series whose coefficients satisfy such a recurrence relation (see holonomic function).

The concept can be extended to multidimensional arrays, that is, indexed families that are indexed by tuples of natural numbers.


A recurrence relation is an equation that expresses each element of a sequence as a function of the preceding ones. More precisely, in the case where only the immediately preceding element is involved, a recurrence relation has the form




is a function, where X is a set to which the elements of a sequence must belong. For any  , this defines a unique sequence with   as its first element, called the initial value.[1]

It is easy to modify the definition for getting sequences starting from the term of index 1 or higher.

This defines recurrence relation of first order. A recurrence relation of order k has the form


where   is a function that involves k consecutive elements of the sequence. In this case, k initial values are needed for defining a sequence.



The factorial is defined by the recurrence relation


and the initial condition


Logistic mapEdit

An example of a recurrence relation is the logistic map:


with a given constant  ; given the initial term   each subsequent term is determined by this relation.

Solving a recurrence relation means obtaining a closed-form solution: a non-recursive function of  .

Fibonacci numbersEdit

The recurrence of order two satisfied by the Fibonacci numbers is the canonical example of a homogeneous linear recurrence relation with constant coefficients (see below). The Fibonacci sequence is defined using the recurrence


with initial conditions


Explicitly, the recurrence yields the equations



We obtain the sequence of Fibonacci numbers, which begins

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

The recurrence can be solved by methods described below yielding Binet's formula, which involves powers of the two roots of the characteristic polynomial  ; the generating function of the sequence is the rational function


Binomial coefficientsEdit

A simple example of a multidimensional recurrence relation is given by the binomial coefficients  , which count the number of ways of selecting   elements out of a set of   elements. They can be computed by the recurrence relation


with the base cases  . Using this formula to compute the values of all binomial coefficients generates an infinite array called Pascal's triangle. The same values can also be computed directly by a different formula that is not a recurrence, but that requires multiplication and not just addition to compute:  

Relationship to difference equations narrowly definedEdit

Given an ordered sequence   of real numbers: the first difference   is defined as


The second difference   is defined as


which can be simplified to


More generally: the k-th difference of the sequence   written as   is defined recursively as


(The sequence and its differences are related by a binomial transform.) The more restrictive definition of difference equation is an equation composed of   and its  -th differences. (A widely used broader definition treats "difference equation" as synonymous with "recurrence relation". See for example rational difference equation and matrix difference equation.)

Actually, it is easily seen that,


Thus, a difference equation can be defined as an equation that involves  ,  ,   (or equivalently  ,  ,   etc.)

Since difference equations are a very common form of recurrence, some authors use the two terms interchangeably. For example, the difference equation


is equivalent to the recurrence relation


Thus one can solve many recurrence relations by rephrasing them as difference equations, and then solving the difference equation, analogously to how one solves ordinary differential equations. However, the Ackermann numbers are an example of a recurrence relation that do not map to a difference equation, much less points on the solution to a differential equation.

See time scale calculus for a unification of the theory of difference equations with that of differential equations.

Summation equations relate to difference equations as integral equations relate to differential equations.

From sequences to gridsEdit

Single-variable or one-dimensional recurrence relations are about sequences (i.e. functions defined on one-dimensional grids). Multi-variable or n-dimensional recurrence relations are about  -dimensional grids. Functions defined on  -grids can also be studied with partial difference equations.[2]


Solving homogeneous linear recurrence relations with constant coefficientsEdit

Roots of the characteristic polynomialEdit

An order-  homogeneous linear recurrence with constant coefficients is an equation of the form


where the   coefficients   (for all  ) are constants, and  .

A constant-recursive sequence is a sequence satisfying a recurrence of this form. There are   degrees of freedom for solutions to this recurrence, i.e., the initial values   can be taken to be any values but then the recurrence determines the sequence uniquely.

The same coefficients yield the characteristic polynomial (also "auxiliary polynomial" or "companion polynomial")


whose roots play a crucial role in finding and understanding the sequences satisfying the recurrence. If the roots  ,  , ... are all distinct, then each solution to the recurrence takes the form


where the coefficients   are determined in order to fit the initial conditions of the recurrence. When the same roots occur multiple times, the terms in this formula corresponding to the second and later occurrences of the same root are multiplied by increasing powers of  . For instance, if the characteristic polynomial can be factored as  , with the same root   occurring three times, then the solution would take the form


As well as the Fibonacci numbers, other constant-recursive sequences include the Lucas numbers and Lucas sequences, the Jacobsthal numbers, the Pell numbers and more generally the solutions to Pell's equation.

For order 1, the recurrence


has the solution   with   and the most general solution is   with  . The characteristic polynomial equated to zero (the characteristic equation) is simply  .

Solutions to such recurrence relations of higher order are found by systematic means, often using the fact that   is a solution for the recurrence exactly when   is a root of the characteristic polynomial. This can be approached directly or using generating functions (formal power series) or matrices.

Consider, for example, a recurrence relation of the form


When does it have a solution of the same general form as  ? Substituting this guess (ansatz) in the recurrence relation, we find that


must be true for all  .

Dividing through by  , we get that all these equations reduce to the same thing:


which is the characteristic equation of the recurrence relation. Solve for   to obtain the two roots  ,  : these roots are known as the characteristic roots or eigenvalues of the characteristic equation. Different solutions are obtained depending on the nature of the roots: If these roots are distinct, we have the general solution


while if they are identical (when  ), we have


This is the most general solution; the two constants   and   can be chosen based on two given initial conditions   and   to produce a specific solution.

In the case of complex eigenvalues (which also gives rise to complex values for the solution parameters   and  ), the use of complex numbers can be eliminated by rewriting the solution in trigonometric form. In this case we can write the eigenvalues as   Then it can be shown that


can be rewritten as[4]: 576–585 




Here   and   (or equivalently,   and  ) are real constants which depend on the initial conditions. Using


one may simplify the solution given above as


where   and   are the initial conditions and


In this way there is no need to solve for   and  .

In all cases—real distinct eigenvalues, real duplicated eigenvalues, and complex conjugate eigenvalues—the equation is stable (that is, the variable   converges to a fixed value [specifically, zero]) if and only if both eigenvalues are smaller than one in absolute value. In this second-order case, this condition on the eigenvalues can be shown[5] to be equivalent to  , which is equivalent to   and  .

The equation in the above example was homogeneous, in that there was no constant term. If one starts with the non-homogeneous recurrence


with constant term  , this can be converted into homogeneous form as follows: The steady state is found by setting   to obtain


Then the non-homogeneous recurrence can be rewritten in homogeneous form as


which can be solved as above.

The stability condition stated above in terms of eigenvalues for the second-order case remains valid for the general  -th order case: the equation is stable if and only if all eigenvalues of the characteristic equation are less than one in absolute value.

Given a homogeneous linear recurrence relation with constant coefficients of order  , let   be the characteristic polynomial (also "auxiliary polynomial")


such that each   corresponds to each   in the original recurrence relation (see the general form above). Suppose   is a root of   having multiplicity  . This is to say that   divides  . The following two properties hold:

  1. Each of the   sequences   satisfies the recurrence relation.
  2. Any sequence satisfying the recurrence relation can be written uniquely as a linear combination of solutions constructed in part 1 as   varies over all distinct roots of  .

As a result of this theorem a homogeneous linear recurrence relation with constant coefficients can be solved in the following manner:

  1. Find the characteristic polynomial  .
  2. Find the roots of   counting multiplicity.
  3. Write   as a linear combination of all the roots (counting multiplicity as shown in the theorem above) with unknown coefficients  .
    This is the general solution to the original recurrence relation. (  is the multiplicity of λ*)
  4. Equate each   from part 3 (plugging in   into the general solution of the recurrence relation) with the known values   from the original recurrence relation. However, the values   from the original recurrence relation used do not usually have to be contiguous: excluding exceptional cases, just d of them are needed (i.e., for an original homogeneous linear recurrence relation of order 3 one could use the values  ,  ,  ). This process will produce a linear system of   equations with   unknowns. Solving these equations for the unknown coefficients   of the general solution and plugging these values back into the general solution will produce the particular solution to the original recurrence relation that fits the original recurrence relation's initial conditions (as well as all subsequent values   of the original recurrence relation).

The method for solving linear differential equations is similar to the method above—the "intelligent guess" (ansatz) for linear differential equations with constant coefficients is   where   is a complex number that is determined by substituting the guess into the differential equation.

This is not a coincidence. Considering the Taylor series of the solution to a linear differential equation:


it can be seen that the coefficients of the series are given by the  -th derivative of   evaluated at the point  . The differential equation provides a linear difference equation relating these coefficients.

This equivalence can be used to quickly solve for the recurrence relationship for the coefficients in the power series solution of a linear differential equation.

The rule of thumb (for equations in which the polynomial multiplying the first term is non-zero at zero) is that:


and more generally


Example: The recurrence relationship for the Taylor series coefficients of the equation:


is given by




This example shows how problems generally solved using the power series solution method taught in normal differential equation classes can be solved in a much easier way.

Example: The differential equation


has solution


The conversion of the differential equation to a difference equation of the Taylor coefficients is


It is easy to see that the  -th derivative of   evaluated at   is  .

Solving via linear algebraEdit

A linearly recursive sequence   of order  


is identical to


Expanded with   identities of kind  , this  -th order equation is translated into a matrix difference equation system of   first-order linear equations,


Observe that the vector   can be computed by   applications of the companion matrix,  , to the initial state vector,  . Thereby,  -th entry of the sought sequence  , is the top component of  .

Eigendecomposition,   into eigenvalues,  , and eigenvectors,  , is used to compute  . Thanks to the crucial fact that system   time-shifts every eigenvector,  , by simply scaling its components   times,


that is, time-shifted version of eigenvector,  , has components   times larger, the eigenvector components are powers of  ,   and, thus, recurrent homogeneous linear equation solution is a combination of exponential functions,  . The components   can be determined out of initial conditions:


Solving for coefficients,


This also works with arbitrary boundary conditions  , not necessary the initial ones,


This description is really no different from general method above, however it is more succinct. It also works nicely for situations like


where there are several linked recurrences.[6]

Solving with z-transformsEdit

Certain difference equations - in particular, linear constant coefficient difference equations - can be solved using z-transforms. The z-transforms are a class of integral transforms that lead to more convenient algebraic manipulations and more straightforward solutions. There are cases in which obtaining a direct solution would be all but impossible, yet solving the problem via a thoughtfully chosen integral transform is straightforward.

Solving non-homogeneous linear recurrence relations with constant coefficientsEdit

If the recurrence is non-homogeneous, a particular solution can be found by the method of undetermined coefficients and the solution is the sum of the solution of the homogeneous and the particular solutions. Another method to solve a non-homogeneous recurrence is the method of symbolic differentiation. For example, consider the following recurrence:


This is a non-homogeneous recurrence. If we substitute  , we obtain the recurrence


Subtracting the original recurrence from this equation yields


or equivalently


This is a homogeneous recurrence, which can be solved by the methods explained above. In general, if a linear recurrence has the form


where   are constant coefficients and   is the inhomogeneity, then if   is a polynomial with degree  , then this non-homogeneous recurrence can be reduced to a homogeneous recurrence by applying the method of symbolic differencing   times.



is the generating function of the inhomogeneity, the generating function


of the non-homogeneous recurrence


with constant coefficients ci is derived from


If P(x) is a rational generating function,   is also one. The case discussed above, where   is a constant, emerges as one example of this formula, with  . Another example, the recurrence   with linear inhomogeneity, arises in the definition of the schizophrenic numbers. The solution of homogeneous recurrences is incorporated as  .

Solving first-order non-homogeneous recurrence relations with variable coefficientsEdit

Moreover, for the general first-order non-homogeneous linear recurrence relation with variable coefficients:


there is also a nice method to solve it:[7]






If we apply the formula to   and take the limit  , we get the formula for first order linear differential equations with variable coefficients; the sum becomes an integral, and the product becomes the exponential function of an integral.

Solving general homogeneous linear recurrence relationsEdit

Many homogeneous linear recurrence relations may be solved by means of the generalized hypergeometric series. Special cases of these lead to recurrence relations for the orthogonal polynomials, and many special functions. For example, the solution to


is given by


the Bessel function, while


is solved by


the confluent hypergeometric series. Sequences which are the solutions of linear difference equations with polynomial coefficients are called P-recursive. For these specific recurrence equations algorithms are known which find polynomial, rational or hypergeometric solutions.

Solving first-order rational difference equationsEdit

A first order rational difference equation has the form  . Such an equation can be solved by writing   as a nonlinear transformation of another variable   which itself evolves linearly. Then standard methods can be used to solve the linear difference equation in  .


Stability of linear higher-order recurrencesEdit

The linear recurrence of order  ,


has the characteristic equation


The recurrence is stable, meaning that the iterates converge asymptotically to a fixed value, if and only if the eigenvalues (i.e., the roots of the characteristic equation), whether real or complex, are all less than unity in absolute value.

Stability of linear first-order matrix recurrencesEdit

In the first-order matrix difference equation


with state vector   and transition matrix  ,   converges asymptotically to the steady state vector   if and only if all eigenvalues of the transition matrix   (whether real or complex) have an absolute value which is less than 1.

Stability of nonlinear first-order recurrencesEdit

Consider the nonlinear first-order recurrence


This recurrence is locally stable, meaning that it converges to a fixed point   from points sufficiently close to  , if the slope of   in the neighborhood of   is smaller than unity in absolute value: that is,


A nonlinear recurrence could have multiple fixed points, in which case some fixed points may be locally stable and others locally unstable; for continuous f two adjacent fixed points cannot both be locally stable.

A nonlinear recurrence relation could also have a cycle of period   for  . Such a cycle is stable, meaning that it attracts a set of initial conditions of positive measure, if the composite function


with   appearing   times is locally stable according to the same criterion:


where   is any point on the cycle.

In a chaotic recurrence relation, the variable   stays in a bounded region but never converges to a fixed point or an attracting cycle; any fixed points or cycles of the equation are unstable. See also logistic map, dyadic transformation, and tent map.

Relationship to differential equationsEdit

When solving an ordinary differential equation numerically, one typically encounters a recurrence relation. For example, when solving the initial value problem


with Euler's method and a step size  , one calculates the values


by the recurrence


Systems of linear first order differential equations can be discretized exactly analytically using the methods shown in the discretization article.



Some of the best-known difference equations have their origins in the attempt to model population dynamics. For example, the Fibonacci numbers were once used as a model for the growth of a rabbit population.

The logistic map is used either directly to model population growth, or as a starting point for more detailed models of population dynamics. In this context, coupled difference equations are often used to model the interaction of two or more populations. For example, the Nicholson–Bailey model for a host-parasite interaction is given by


with   representing the hosts, and   the parasites, at time  .

Integrodifference equations are a form of recurrence relation important to spatial ecology. These and other difference equations are particularly suited to modeling univoltine populations.

Computer scienceEdit

Recurrence relations are also of fundamental importance in analysis of algorithms.[8][9] If an algorithm is designed so that it will break a problem into smaller subproblems (divide and conquer), its running time is described by a recurrence relation.

A simple example is the time an algorithm takes to find an element in an ordered vector with   elements, in the worst case.

A naive algorithm will search from left to right, one element at a time. The worst possible scenario is when the required element is the last, so the number of comparisons is  .

A better algorithm is called binary search. However, it requires a sorted vector. It will first check if the element is at the middle of the vector. If not, then it will check if the middle element is greater or lesser than the sought element. At this point, half of the vector can be discarded, and the algorithm can be run again on the other half. The number of comparisons will be given by


the time complexity of which will be  .

Digital signal processingEdit

In digital signal processing, recurrence relations can model feedback in a system, where outputs at one time become inputs for future time. They thus arise in infinite impulse response (IIR) digital filters.

For example, the equation for a "feedforward" IIR comb filter of delay   is:


where   is the input at time  ,   is the output at time  , and   controls how much of the delayed signal is fed back into the output. From this we can see that




Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical economics.[10][11] In particular, in macroeconomics one might develop a model of various broad sectors of the economy (the financial sector, the goods sector, the labor market, etc.) in which some agents' actions depend on lagged variables. The model would then be solved for current values of key variables (interest rate, real GDP, etc.) in terms of past and current values of other variables.

See alsoEdit



  1. ^ Jacobson, Nathan , Basic Algebra 2 (2nd ed.), § 0.4. pg 16.
  2. ^ Partial difference equations, Sui Sun Cheng, CRC Press, 2003, ISBN 978-0-415-29884-1
  3. ^ Greene, Daniel H.; Knuth, Donald E. (1982), "2.1.1 Constant coefficients – A) Homogeneous equations", Mathematics for the Analysis of Algorithms (2nd ed.), Birkhäuser, p. 17.
  4. ^ Chiang, Alpha C., Fundamental Methods of Mathematical Economics, third edition, McGraw-Hill, 1984.
  5. ^ Papanicolaou, Vassilis, "On the asymptotic stability of a class of linear difference equations," Mathematics Magazine 69(1), February 1996, 34–43.
  6. ^ Maurer, Stephen B.; Ralston, Anthony (1998), Discrete Algorithmic Mathematics (2nd ed.), A K Peters, p. 609, ISBN 9781568810911.
  7. ^ "Archived copy" (PDF). Archived (PDF) from the original on 2010-07-05. Retrieved 2010-10-19.CS1 maint: archived copy as title (link)
  8. ^ Cormen, T. et al, Introduction to Algorithms, MIT Press, 2009
  9. ^ R. Sedgewick, F. Flajolet, An Introduction to the Analysis of Algorithms, Addison-Wesley, 2013
  10. ^ Stokey, Nancy L.; Lucas, Robert E., Jr.; Prescott, Edward C. (1989). Recursive Methods in Economic Dynamics. Cambridge: Harvard University Press. ISBN 0-674-75096-9.
  11. ^ Ljungqvist, Lars; Sargent, Thomas J. (2004). Recursive Macroeconomic Theory (Second ed.). Cambridge: MIT Press. ISBN 0-262-12274-X.


External linksEdit