 Recurrence relation

"Difference equation" redirects here. It is not to be confused with differential equation.
In mathematics, a recurrence relation is an equation that recursively defines a sequence, once one or more initial terms are given: each further term of the sequence is defined as a function of the preceding terms.
The term difference equation sometimes (and for the purposes of this article) refers to a specific type of recurrence relation. However, "difference equation" is frequently used to refer to any recurrence relation.
An example of a recurrence relation is the logistic map:
with a given constant r; given the initial term x_{0} each subsequent term is determined by this relation.
Some simply defined recurrence relations can have very complex (chaotic) behaviours, and they are a part of the field of mathematics known as nonlinear analysis.
Solving a recurrence relation means obtaining a closedform solution: a nonrecursive function of n.
Contents
Fibonacci numbers
The Fibonacci numbers are the archetype of a linear, homogeneous recurrence relation with constant coefficients (see below). They are defined using the linear recurrence relation
with seed values:
Explicitly, recurrence yields the equations:
etc.
We obtain the sequence of Fibonacci numbers which begins:
 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
It can be solved by methods described below yielding the closed form expression which involve powers of the two roots of the characteristic polynomial t^{2} = t + 1; the generating function of the sequence is the rational function
Structure
Linear homogeneous recurrence relations with constant coefficients
An order d linear homogeneous recurrence relation with constant coefficients is an equation of the form:
where the d coefficients c_{i} (for all i) are constants.
More precisely, this is an infinite list of simultaneous linear equations, one for each n>d−1. A sequence which satisfies a relation of this form is called a linear recurrence sequence or LRS. There are d degrees of freedom for LRS, i.e., the initial values can be taken to be any values but then the linear recurrence determines the sequence uniquely.
The same coefficients yield the characteristic polynomial (also "auxiliary polynomial")
whose d roots play a crucial role in finding and understanding the sequences satisfying the recurrence. If the roots r_{1}, r_{2}, ... are all distinct, then the solution to the recurrence takes the form
where the coefficients k_{i} 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 n. For instance, if the characteristic polynomial can be factored as (x − r)^{3}, with the same root r occurring three times, then the solution would take the form
 ^{[1]}
Rational generating function
Linear recursive sequences are precisely the sequences whose generating function is a rational function: the denominator is the polynomial obtained from the auxiliary polynomial by reversing the order of the coefficients, and the numerator is determined by the initial values of the sequence.
The simplest cases are periodic sequences, , which have sequence and generating function a sum of geometric series:
More generally, given the recurrence relation:
with generating function
the series is annihilated at a_{d} and above by the polynomial:
That is, multiplying the generating function by the polynomial yields
as the coefficient on x^{n}, which vanishes (by the recurrence relation) for . Thus
so dividing yields
expressing the generating function as a rational function.
The denominator is a transform of the auxiliary polynomial (equivalently, reversing the order of coefficients); one could also use any multiple of this, but this normalization is chosen both because of the simple relation to the auxiliary polynomial, and so that b_{0} = a_{0}.
Relationship to difference equations narrowly defined
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 is written as is defined recursively as
 .
The more restrictive definition of difference equation is an equation composed of a_{n} and its k^{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.)
Linear recurrence relations are difference equations, and conversely; since this is a simple and 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 grids
Singlevariable or onedimensional recurrence relations are about sequences (i.e. functions defined on onedimensional grids). Multivariable or ndimensional recurrence relations are about ndimensional grids. Functions defined on ngrids can also be studied with partial difference equations.^{[2]}
Solving
General methods
For order 1 no theory is needed; the recurrence
has the obvious solution a_{n} = r^{n} with a_{0} = 1 and the most general solution is a_{n} = kr^{n} with a_{0} = k. The characteristic polynomial equated to zero (the characteristic equation) is simply t − r = 0.
Solutions to such recurrence relations of higher order are found by systematic means, often using the fact that a_{n} = r^{n} is a solution for the recurrence exactly when t = r 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 a_{n} = r^{n}? Substituting this guess (ansatz) in the recurrence relation, we find that
 must be true for all n > 1.
Dividing through by r^{n−2}, we get that all these equations reduce to the same thing:
which is the characteristic equation of the recurrence relation. Solve for r to obtain the two roots λ_{1}, λ_{2}: 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 A^{2} + 4B = 0), we have
This is the most general solution; the two constants C and D can be chosen based on two given initial conditions a_{0} and a_{1} to produce a specific solution.
In the case of complex eigenvalues (which also gives rise to complex values for the solution parameters C and D), 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^{[3]}^{:576585}
where
Here E and F (or equivalently, G and δ) are real constants which depend on the initial conditions.
In all cases—real distinct eigenvalues, real duplicated eigenvalues, and complex conjugate eigenvalues—the equation is stable (that is, the variable a converges to a fixed value (specifically, zero)); if and only if both eigenvalues are smaller than one in absolute value. In this secondorder case, this condition on the eigenvalues can be shown^{[4]} to be equivalent to A < 1 − B < 2, which is equivalent to B < 1 and A < 1 − B.
The equation in the above example was homogeneous, in that there was no constant term. If one starts with the nonhomogeneous recurrence
with constant term K, this can be converted into homogeneous form as follows: The steady state is found by setting b_{n} = b_{n−1} = b_{n−2} = b* to obtain
Then the nonhomogeneous 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 secondorder case remains valid for the general n^{th}order case: the equation is stable if and only if all eigenvalues of the characteristic equation are less than one in absolute value.
Solving via linear algebra
Given a linearly recursive sequence, let C be the transpose of the companion matrix of its characteristic polynomial, that is
where . Call this matrix C. Observe that
Determine an eigenbasis v_{1},...,v_{d} corresponding to eigenvalues λ_{1},...,λ_{d}. Then express the seed (the initial conditions of the LRS) as a linear combination of the eigenbasis vectors:
Then it conveniently works out that:
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^{[citation needed]}.
Solving with ztransforms
Certain difference equations, in particular Linear constant coefficient difference equations, can be solved using ztransforms. The ztransforms 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.
Theorem
Given a linear homogeneous recurrence relation with constant coefficients of order d, let p(t) be the characteristic polynomial (also "auxiliary polynomial")
such that each c_{i} corresponds to each c_{i} in the original recurrence relation (see the general form above). Suppose λ is a root of p(t) having multiplicity r. This is to say that (t − λ)^{r} divides p(t). The following two properties hold:
 Each of the r sequences satisfies the recurrence relation.
 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 p(t).
As a result of this theorem a linear homogeneous recurrence relation with constant coefficients can be solved in the following manner:
 Find the characteristic polynomial p(t).
 Find the roots of p(t) counting multiplicity.
 Write a_{n} as a linear combination of all the roots (counting multiplicity as shown in the theorem above) with unknown coefficients b_{i}.

 This is the general solution to the original recurrence relation.

 (q 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 a_{n} from the original recurrence relation used do not have to be contiguous, just d of them are needed (i.e., for an original linear homogeneous recurrence relation of order 3 one could use the values a_{0}, a_{1}, a_{4}). This process will produce a linear system of d equations with d 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 n^{th} derivative of f(x) evaluated at the point a. 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 nonzero at zero) is that:
and more generally
Example: The recurrence relationship for the Taylor series coefficients of the equation:
is given by
or
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 nth derivative of e^{ax} evaluated at 0 is a^{n}
Solving nonhomogeneous recurrence relations
If the recurrence is inhomogeneous, 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 an inhomogeneous recurrence is the method of symbolic differentiation. For example, consider the following recurrence:
This is an inhomogeneous 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 p(n) is the inhomogeneity, then if p(n) is a polynomial with degree r, then this inhomogeneous recurrence can be reduced to a homogeneous recurrence by applying the method of symbolic differencing r times.
Moreover, for the general firstorder linear inhomogeneous recurrence relation with variable coefficient(s) , , there is also a nice method to solve it:^{[5]}
 Let ,
 Then
General linear homogeneous recurrence relations
Many linear homogeneous 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.
Solving a first order rational difference equation
Main article: Rational difference equation
A first order rational difference equation has the form . Such an equation can be solved by writing w_{t} as a nonlinear transformation of another variable x_{t} which itself evolves linearly. Then standard methods can be used to solve the linear difference equation in x_{t}.
Stability
Stability of linear higherorder recurrences
The linear recurrence of order d,
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 firstorder matrix recurrences
Main article: Matrix difference equation
In the firstorder matrix difference equation
with state vector x and transition matrix A, x converges asymptotically to the steady state vector x* if and only if all eigenvalues of the transition matrix A (whether real or complex) have an absolute value which is less than 1.
Stability of nonlinear firstorder recurrences
Consider the nonlinear firstorder recurrence
This recurrence is locally stable, meaning that it converges to a fixed point x* from points sufficiently close to x*, if and only if the slope of f in the neighborhood of x* 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 k for k > 1. Such a cycle is stable, meaning that it attracts a set of initial conditions of positive measure, if the composite function with f appearing k times is locally stable according to the same criterion:
where x* is any point on the cycle.
In a chaotic recurrence relation, the variable x 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 equations
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 h, 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.
Applications
Biology
Some of the bestknown 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. In this context, coupled difference equations are often used to model the interaction of two or more populations. For example, the NicholsonBailey model for a hostparasite interaction is given by
with N_{t} representing the hosts, and P_{t} the parasites, at time t.
Integrodifference equations are a form of recurrence relation important to spatial ecology. These and other difference equations are particularly suited to modeling univoltine populations.
Digital signal processing
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 T is:
 y_{t} = (1 − α)x_{t} + αy_{t − T}
Where x_{t} is the input at time t, y_{t} is the output at time t, and α controls how much of the delayed signal is fed back into the output. From this we can see that
 y_{t} = (1 − α)x_{t} + α((1 − α)x_{t − T} + αy_{t − 2T})
 y_{t} = (1 − α)x_{t} + (α − α^{2})x_{t − T} + α^{2}y_{t − 2T}
etc.
Economics
Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical economics.^{[6]} 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 exogenous variables and lagged endogenous variables. See also time series analysis.
See also
References
 ^ 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.
 ^ Partial difference equations, Sui Sun Cheng, CRC Press, 2003, ISBN 9780415298841
 ^ Chiang, Alpha C., Fundamental Methods of Mathematical Economics, third edition, McGrawHill, 1984.
 ^ Papanicolaou, Vassilis, "On the asymptotic stability of a class of linear difference equations," Mathematics Magazine 69(1), February 1996, 34–43.
 ^ http://faculty.pccu.edu.tw/%7Emeng/Math15.pdf
 ^ Sargent, Thomas J., Dynamic Macroeconomic Theory, Harvard University Press, 1987.
 Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGrawHill, 1990. ISBN 0262032937. Chapter 4: Recurrences, pp. 62–90.
 Ian Jacques. Mathematics for Economics and Business, Fifth Edition. Prentice Hall, 2006. ISBN 0273701959. Chapter 9.1: Difference Equations, pp. 551–568.
 Paul M. Batchelder, An introduction to linear difference equations, Dover Publications, 1967.
 Kenneth S. Miller, Linear difference equations. W.A. Benjamin, 1968.
 Difference and Functional Equations: Exact Solutions at EqWorld – The World of Mathematical Equations.
 Difference and Functional Equations: Methods at EqWorld  The World of Mathematical Equations.
 Applied Econometric time series, Second Edition. Walter Enders.
 Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. Concrete Mathematics: A Foundation for Computer Science, Second Edition. AddisonWesley Professional, 1994. ISBN 0201558025.
 Cull, Paul; Flahive, Mary; and Robson, Robbie. Difference Equations: From Rabbits to Chaos, Springer, 2005, chapter 7; ISBN 0387232346.
External links
Categories: Algebra
 Recurrence relations
 Theory of computation
Wikimedia Foundation. 2010.