Recurrence relation

From Wikipedia, the free encyclopedia

Jump to: navigation, search
"Difference equation" redirects here. It should not be confused with a differential equation.

In mathematics, a recurrence relation is an equation that defines a sequence recursively: each term of the sequence is defined as a function of the preceding terms.

A difference equation is a specific type of recurrence relation.

An example of a recurrence relation is the logistic map:

x_{n+1} = r x_n (1 - x_n) \,

Some simply defined recurrence relations can have very complex (chaotic) behaviours and are sometimes studied by physicists and mathematicians in a field of mathematics known as nonlinear analysis.

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

Contents

[edit] Example: Fibonacci numbers

The Fibonacci numbers are defined using the linear recurrence relation

F_{n} = F_{n-1}+F_{n-2} \,

with seed values:

F_0 = 0 \,
F_1 = 1. \,

Explicitly, recurrence yields the equations:

F_2 = F_1 + F_0 \,
F_3 = F_2 + F_1 \,
F_4 = F_3 + F_2 \,

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 t2 = t + 1; the generating function of the sequence is the rational function t / (1 − tt2).

[edit] Structure

[edit] Linear homogeneous recurrence relations with constant coefficients

An order d \, linear homogeneous recurrence relation with constant coefficients is an equation of the form:

a_n = c_1a_{n-1} + c_2a_{n-2}+\cdots+c_da_{n-d}  \,

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 recursive sequence or LRS. There are d degrees of freedom for LRS, the initial values (initial conditions) a_0,\dots,a_{d-1} 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")

p(t)= t^d - c_1t^{d-1} - c_2t^{d-2}-\cdots-c_{d}\,

whose d roots play a crucial role in finding and understanding the sequences satisfying the recurrence.

[edit] Rational generating function

Linear recursive sequences are precisely the sequences whose generating function is a rational function: the denominator is the auxiliary polynomial (up to a transform), and the numerator is obtained from the seed values.

The simplest case are periodic sequences, an = and, n\geq d, which have sequence a_0,a_1,\dots,a_{d-1},a_0,\dots and generating function a sum of geometric series:


\frac{a_0 + a_1 x^1 + \cdots + a_{d-1}x^{d-1}}{1-x^d} = 
  \left(a_0 + a_1 x^1 + \cdots + a_{d-1}x^{d-1}\right)
+ \left(a_0 + a_1 x^1 + \cdots + a_{d-1}x^{d-1}\right)x^d
+ \cdots.

More generally, given the recurrence relation:

a_n = c_1a_{n-1} + c_2a_{n-2}+\cdots+c_da_{n-d}  \,

with generating function

a_0 + a_1x^1 + a_2 x^2 + \cdots,

the series is annihilated at ad and above by the polynomial:

1- c_1x^1 - c_2 x^2 - \cdots - c_dx^d. \,

That is, multiplying the generating function by the polynomial yields

b_n = a_n - c_1 a_{n-1} - c_2 a_{n-2} - \cdots - c_d a_{n-d} \,

as the coefficient on xn, which vanishes (by the recurrence relation) for n \geq d. Thus

(a_0 + a_1x^1 + a_2 x^2 + \cdots) \cdot (1- c_1x^1 - c_2 x^2 - \cdots - c_dx^d) = (b_0 + b_1x^1 + b_2 x^2 + \cdots + b_{d-1} x^{d-1})

so dividing yields

a_0 + a_1x^1 + a_2 x^2 + \cdots  =
\frac{b_0 + b_1x^1 + b_2 x^2 + \cdots + b_{d-1} x^{d-1}}{1- c_1x^1 - c_2 x^2 - \cdots - c_dx^d},

expressing the generating function as a rational function.

The denominator is xdp(1 / x), 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 b0 = a0.

[edit] Relationship to difference equations

Given a sequence \{a_n\}\, of real numbers: the first difference d(a_n)\, is defined as

a_n - a_{n-1}\,.

The second difference d^2(a_n)\, is defined as

d(a_n) - d(a_{n-1})\,,

which can be simplified to

a_n - 2a_{n-1} + a_{n-2}\,.

More generally: the kth difference d^k\, is defined as

d^{k-1}(a_n) - d^{k-1}(a_{n-1})\,.

A difference equation is an equation composed of a_n\, and its kth differences.

Every recurrence relation can be formulated as a difference equation. Conversely, every difference equation can be formulated as a recurrence relation. Some authors thus use the two terms interchangeably. For example, the difference equation

3d^2(a_n) + 2d(a_n) + 7a_n = 0\,

is equivalent to the recurrence relation

12a_n = 8a_{n-1} - 3a_{n-2}\,

Thus one can solve recurrence relations by rephrasing them as difference equations, and then solving the difference equation, analogously to how one solves ordinary differential equations.

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

[edit] Solving

[edit] General methods

For order 1 no theory is needed; the recurrence

a_{n}=r a_{n-1} \,

has the obvious solution an = rn with a0 = 1 and the most general solution is an = kcn with a0 = k. Note that the characteristic polynomial is simply tr = 0.

Solutions to such recurrence relations of higher order are found by systematic means, often using the fact that an = rn is a solution for the recurrence exactly when t = r is a solution 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

a_{n}=Aa_{n-1}+Ba_{n-2}. \,

When does it have a solution of the form an = rn? Substituting this guess (ansatz) in the recurrence relation, we find that

r^{n}=Ar^{n-1}+Br^{n-2} \, must be true for all n>1.

Dividing through by rn − 2, we get that all these equations reduce to the same thing

r^2=Ar+B, \,
r^2-Ar-B=0. \,

Solve for r to obtain the two roots λ1, λ2. Different solutions are obtained depending on the nature of the roots: If these roots are distinct, we have the general solution

a_n = C\lambda_1^n+D\lambda_2^n \,

while if they are identical (when A2 + 4B = 0), we have

a_n = C\lambda^n+Dn\lambda^n \,

This is the most general solution, the two constants C and D can be chosen freely to produce a solution. If "initial conditions" a0 = a, a1 = b have been given then we can solve (uniquely) for C and D.

[edit] Solving via linear algebra

Given an LRS, one can write down the companion matrix of its characteristic polynomial, then put it in Jordan normal form (which is diagonal if the eigenvalues are distinct). Expressing the seed in terms of the eigenbasis, say

\begin{bmatrix}a_0\\
\vdots\\
a_{d-1}\end{bmatrix} = b_1v_1 + \cdots + b_dv_d

yields

\begin{bmatrix}a_n\\
\vdots\\
a_{n+(d-1)}\end{bmatrix}
= C^n\begin{bmatrix}a_0\\
\vdots\\
a_{d-1}\end{bmatrix}
= C^n(b_1v_1 + \cdots + b_dv_d)
= \lambda_1^nb_1v_1 + \cdots + \lambda_d^n b_dv_d

which is a closed form expression (expand on the first coordinate to obtain a closed form expression for a_n\,).

If the companion matrix is not diagonalizable, then the resulting expression is more complicated, but conceptually the same.

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

an = an − 1bn − 1,.
bn = 2an − 1 + bn − 1,.

Where there are several linked recurrences.

[edit] Solving with z-transforms

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.

[edit] Theorem

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

t^d - c_1t^{d-1} - c_2t^{d-2}-\cdots-c_{d} = 0 \,

such that each c_i \, corresponds to each c_i \, in the original recurrence relation (see the general form above). Suppose \lambda \, is a root of p(t) \, having multiplicity r \,. This is to say that (t-\lambda)^r \, divides p(t) \,. The following two properties hold:

  1. Each of the r \, sequences \lambda^n, n\lambda^n, n^2\lambda^n,\dots,n^{r-1}\lambda^n \, 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 \lambda\, 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:

  1. Find the characteristic polynomial p(t) \,.
  2. Find the roots of p(t) \, counting multiplicity.
  3. Write a_n \, as a linear combination of all the roots (counting multiplicity as shown in the theorem above) with unknown coefficients b_i\,.
a_n = (b_1\lambda_1^n + b_2n\lambda_1^n + b_3n^2\lambda_1^n+\cdots+b_{r}n^{r-1}\lambda_1^n)+\cdots+(b_{d-q+1}\lambda_{*}^n + \cdots + b_{d}n^{q-1}\lambda_{*}^n) \,
This is the general solution to the original recurrence relation.
(Note: q \, is the multiplicity of \lambda_{*} \,)
4. Equate each a_0, a_1, a_2,\dots,a_d \, from part 3 (plugging in n = 0,\dots,d \, into the general solution of the recurrence relation) with the known values a_0, a_1, a_2,\dots,a_d \, from the original recurrence relation. Note, however, that 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 b_1, b_2, b_3,\dots,b_d \, 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 a_0,a_1,a_2,a_3,\dots \, of the original recurrence relation).

Interestingly, 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 e^{\lambda x}\, where \lambda \, is a complex number that is determined by substituting the guess into the differential equation.

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


\sum_{n=0}^{\infin} \frac{f^{(n)}(a)}{n!} (x-a)^{n}

you see 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 non-zero at zero) is that:


y^{[k]} \to  f[n+k]

and more generally


x^m*y^{[k]} \to n(n-1)(n-m+1)f[n+k-m]

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

 (x^2 + 3x -4)y^{[3]} -(3x+1)y^{[2]} + 2y = 0\,

is given by

 n(n-1)f[n+1] + 3nf[n+2] -4f[n+3] -3nf[n+1] -f[n+2]+ 2f[n] = 0\,

or

-4f[n+3] +2nf[n+2] + n(n-4)f[n+1] +2f[n] = 0.\,

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

ay'' + by' +cy = 0\,

has solution

 y=e^{ax}.\,

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

af[n + 2] + bf[n + 1] + cf[n] = 0\,.

It is easy to see that the nth derivative of eax evaluated at 0 is an

[edit] Solving non-homogeneous 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:

a_{n+1} = a_{n} + 1\,

This is an inhomogeneous recurrence. If we substitute n \mapsto n + 1, we obtain the recurrence

a_{n+2} = a_{n+1} + 1\,

Subtracting the original recurrence from this equation yields

a_{n+2} - a_{n+1} = a_{n+1} - a_{n}\,

or equivalently

a_{n+2} = 2 a_{n+1} - a_{n}\,

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

 a_{n+k} = \lambda_{k-1} a_{n+k-1} + \lambda_{k-2} a_{n+k-2} + \cdots + \lambda_1 a_{n+1} + \lambda_0 a_{n} + p(n)

where \lambda_0, \lambda_1, \dots, \lambda_{k-1} 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 differentiation r times.

[edit] General linear homogeneous recurrence relations

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

J_{n+1}=\frac{2n}{z}J_n-J_{n-1}

is given by

J_n=J_n(z) \,,

the Bessel function, while

(b-n)M_{n-1} +(2n-b-z)M_n - nM_{n+1}=0 \,

is solved by

M_n=M(n,b;z) \,

the confluent hypergeometric series.

[edit] 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

y'(t) = f(t,y(t)), \ \ y(t_0)=y_0,

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

y_0=y(t_0), \ \ y_1=y(t_0+h), \ \ y_2=y(t_0+2h), \ \dots

by the recurrence

\, y_{n+1} = y_n + hf(t_n,y_n).

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

[edit] Applications

[edit] Biology

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. 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

N_{t+1} = \lambda N_t e^{-aP_t} \,
P_{t+1} = N_t(1-e^{-aP_t}) \,,

with Nt representing the hosts, and Pt 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.

[edit] 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.

[edit] See also

[edit] Notes


[edit] References

[edit] External links

Personal tools