In mathematics, a recurrence relation is an equation according to which the
n
k
k
n
k
k
In linear recurrences, the th term is equated to a linear function of the
k
k
n.
n
n
Solving a recurrence relation means obtaining a closed-form solution: a non-recursive function of
n
The concept of a recurrence relation 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
un=\varphi(n,un-1) for n>0,
\varphi:N x X\toX
u0\inX
u0
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 has the form
un=\varphi(n,un-1,un-2,\ldots,un-k) for n\gek,
where
\varphi:N x Xk\toX
The factorial is defined by the recurrence relation
n!=n ⋅ (n-1)! for n>0,
0!=1.
n
An example of a recurrence relation is the logistic map defined by
xn+1=rxn(1-xn),
for a given constant
r.
r,
x0
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
Fn=Fn-1+Fn-2
with initial conditions
F0=0
F1=1.
Explicitly, the recurrence yields the equations
F2=F1+F0
F3=F2+F1
F4=F3+F2
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
t2=t+1
t | |
1-t-t2 |
.
A simple example of a multidimensional recurrence relation is given by the binomial coefficients
\tbinom{n}{k}
k
n
\binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k},
\tbinom{n}{0}=\tbinom{n}{n}=1
\binom{n}{k}= | n! |
k!(n-k)! |
.
The binomial coefficients can also be computed with a uni-dimensional recurrence:
\binomnk=\binomn{k-1}(n-k+1)/k,
The is an operator that maps sequences to sequences, and, more generally, functions to functions. It is commonly denoted
\Delta,
(\Deltaf)(x)=f(x+1)-f(x).
When using the index notation for sequences, the definition becomes
(\Deltaa)n=an+1-an.
\Deltaf
\Deltaa
\Deltaan
\Deltaa,
\Delta
an.
a=(an)n\in,
\Deltaa.
The is
\Delta2a=(\Delta\circ\Delta)a=\Delta(\Deltaa).
\Delta2an=an+2-2an+1+an.
More generally: the th difference is defined recursively as
\Deltak=\Delta\circ\Deltak-1,
\Deltakan=
k | |
\sum | |
t=0 |
(-1)t\binom{k}{t}an+k-t.
This relation can be inverted, giving
an+k=an+{k\choose1}\Deltaan+ … +{k\choosek}
k(a | |
\Delta | |
n). |
A of order is an equation that involves the first differences of a sequence or a function, in the same way as a differential equation of order relates the first derivatives of a function.
The two above relations allow transforming a recurrence relation of order into a difference equation of order, and, conversely, a difference equation of order into recurrence relation of order . Each transformation is the inverse of the other, and the sequences that are solution of the difference equation are exactly those that satisfies the recurrence relation.
For example, the difference equation
3\Delta2an+2\Deltaan+7an=0
3an+2=4an+1-8an,
As it is equivalent for a sequence to satisfy a recurrence relation or to be the solution of a difference equation, the two terms "recurrence relation" and "difference equation" are sometimes used interchangeably. See Rational difference equation and Matrix difference equation for example of uses of "difference equation" instead of "recurrence relation"
Difference equations resemble differential equations, and this resemblance is often used to mimic methods for solving differentiable equations to apply to solving difference equations, and therefore recurrence relations.
Summation equations relate to difference equations as integral equations relate to differential equations. See time scale calculus for a unification of the theory of difference equations with that of differential equations.
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
n
n
See main article: Linear recurrence with constant coefficients.
Moreover, for the general first-order non-homogeneous linear recurrence relation with variable coefficients:
an+1=fnan+gn, fn ≠ 0,
an+1-fnan=gn
an+1 | |||||||||
|
-
fnan | |||||||||
|
=
gn | |||||||||
|
an+1 | |||||||||
|
-
an | |||||||||
|
=
gn | |||||||||
|
Let
An=
an | |||||||||
|
,
An+1-An=
gn | |||||||||
|
n-1 | |
\sum | |
m=0 |
(Am+1-Am)=An-A0=
n-1 | |
\sum | |
m=0 |
gm | |||||||||
|
an | |||||||||
|
=A0+
n-1 | |
\sum | |
m=0 |
gm | |||||||||
|
an=
n-1 | |
\left(\prod | |
k=0 |
fk\right)\left(A0+
n-1 | |
\sum | |
m=0 |
gm | |||||||||
|
\right)
If we apply the formula to
an+1=(1+hfnh)an+hgnh
h\to0
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
Jn+1=
2n | |
z |
Jn-Jn-1
is given by
Jn=Jn(z),
the Bessel function, while
(b-n)Mn-1+(2n-b+z)Mn-nMn+1=0
is solved by
Mn=M(n,b;z)
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.
See main article: Rational difference equation.
A first order rational difference equation has the form
wt+1=\tfrac{awt+b}{cwt+d}
wt
xt
xt
The linear recurrence of order
d
an=c1an-1+c2an-2+ … +cdan-d,
has the characteristic equation
λd-c1λd-1-c2λd-2- … -cdλ0=0.
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.
See main article: Matrix difference equation.
In the first-order matrix difference equation
[xt-x*]=A[xt-1-x*]
with state vector
x
A
x
x*
A
Consider the nonlinear first-order recurrence
xn=f(xn-1).
This recurrence is locally stable, meaning that it converges to a fixed point
x*
x*
f
x*
|f'(x*)|<1.
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
k>1
g(x):=f\circf\circ … \circf(x)
with
f
k
|g'(x*)|<1,
where
x*
In a chaotic recurrence relation, the variable
x
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(t0)=y0,
with Euler's method and a step size
h
y0=y(t0), y1=y(t0+h), y2=y(t0+2h), ...
by the recurrence
yn+1=yn+hf(tn,yn),tn=t0+nh
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
Nt+1=λNt
-aPt | |
e |
Pt+1=
-aPt | |
N | |
t(1-e |
),
with
Nt
Pt
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.
Recurrence relations are also of fundamental importance in analysis of algorithms.[4] [5] 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
n
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
n
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
c1=1
cn=1+cn/2
the time complexity of which will be
O(log2(n))
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
yt=(1-\alpha)xt+\alphayt,
where
xt
t
yt
t
\alpha
yt=(1-\alpha)xt+\alpha((1-\alpha)xt-T+\alphayt)
yt=(1-\alpha)xt+(\alpha-\alpha2)xt-T+\alpha2yt
etc.
See also: time series analysis and simultaneous equations model. Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical economics.[6] [7] 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.