Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Recurrence relation

From Wikipedia, the free encyclopedia
(Redirected fromDifference equation)
Pattern defining an infinite sequence of numbers

Inmathematics, arecurrence relation is anequation according to which then{\displaystyle n}th term of asequence of numbers is equal to some combination of the previous terms. Often, onlyk{\displaystyle k} previous terms of the sequence appear in the equation, for a parameterk{\displaystyle k} that is independent ofn{\displaystyle n}; this numberk{\displaystyle k} is called theorder of the relation. If the values of the firstk{\displaystyle k} numbers in the sequence have been given, the rest of the sequence can be calculated by repeatedly applying the equation.

Inlinear recurrences, thenth term is equated to alinear function of thek{\displaystyle k} previous terms. A famous example is the recurrence for theFibonacci numbers,Fn=Fn1+Fn2{\displaystyle F_{n}=F_{n-1}+F_{n-2}}where the orderk{\displaystyle k} is two and the linear function merely adds the two previous terms. This example is alinear recurrence with constant coefficients, because the coefficients of the linear function (1 and 1) are constants that do not depend onn.{\displaystyle n.} For these recurrences, one can express the general term of the sequence as aclosed-form expression ofn{\displaystyle n}. As well,linear recurrences with polynomial coefficients depending onn{\displaystyle n} are also important, because many commonelementary functions andspecial functions have aTaylor series whose coefficients satisfy such a recurrence relation (seeholonomic function).

Solving a recurrence relation means obtaining aclosed-form solution: a non-recursive function ofn{\displaystyle n}.

The concept of a recurrence relation can be extended tomultidimensional arrays, that is,indexed families that are indexed bytuples ofnatural numbers.

Definition

[edit]

Arecurrence relation is an equation that expresses each element of asequence 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=φ(n,un1)forn>0,{\displaystyle u_{n}=\varphi (n,u_{n-1})\quad {\text{for}}\quad n>0,}

where

φ:N×XX{\displaystyle \varphi :\mathbb {N} \times X\to X}

is a function, whereX is a set to which the elements of a sequence must belong. For anyu0X{\displaystyle u_{0}\in X}, this defines a unique sequence withu0{\displaystyle u_{0}} as its first element, called theinitial 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 offirst order. A recurrence relation oforderk has the form

un=φ(n,un1,un2,,unk)fornk,{\displaystyle u_{n}=\varphi (n,u_{n-1},u_{n-2},\ldots ,u_{n-k})\quad {\text{for}}\quad n\geq k,}

whereφ:N×XkX{\displaystyle \varphi :\mathbb {N} \times X^{k}\to X} is a function that involvesk consecutive elements of the sequence.In this case,k initial values are needed for defining a sequence.

Examples

[edit]

Factorial

[edit]

Thefactorial is defined by the recurrence relation

n!=n(n1)!forn>0,{\displaystyle n!=n\cdot (n-1)!\quad {\text{for}}\quad n>0,}

and the initial condition

0!=1.{\displaystyle 0!=1.}

This is an example of alinear recurrence with polynomial coefficients of order 1, with the simple polynomial (inn)

n{\displaystyle n}

as its only coefficient.

Logistic map

[edit]

An example of a recurrence relation is thelogistic map defined by

xn+1=rxn(1xn),{\displaystyle x_{n+1}=rx_{n}(1-x_{n}),}

for a given constantr.{\displaystyle r.} The behavior of the sequence depends dramatically onr,{\displaystyle r,} but is stable when the initial conditionx0{\displaystyle x_{0}} varies.

Fibonacci numbers

[edit]

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

Fn=Fn1+Fn2{\displaystyle F_{n}=F_{n-1}+F_{n-2}}

withinitial conditions

F0=0{\displaystyle F_{0}=0}
F1=1.{\displaystyle F_{1}=1.}

Explicitly, the recurrence yields the equations

F2=F1+F0{\displaystyle F_{2}=F_{1}+F_{0}}
F3=F2+F1{\displaystyle F_{3}=F_{2}+F_{1}}
F4=F3+F2{\displaystyle 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, ...

The recurrence can be solved by methods described below yieldingBinet's formula, which involves powers of the two roots of the characteristic polynomialt2=t+1{\displaystyle t^{2}=t+1}; thegenerating function of the sequence is therational function

t1tt2.{\displaystyle {\frac {t}{1-t-t^{2}}}.}

Binomial coefficients

[edit]

A simple example of a multidimensional recurrence relation is given by thebinomial coefficients(nk){\displaystyle {\tbinom {n}{k}}}, which count the ways of selectingk{\displaystyle k} elements out of a set ofn{\displaystyle n} elements.They can be computed by the recurrence relation

(nk)=(n1k1)+(n1k),{\displaystyle {\binom {n}{k}}={\binom {n-1}{k-1}}+{\binom {n-1}{k}},}

with the base cases(n0)=(nn)=1{\displaystyle {\tbinom {n}{0}}={\tbinom {n}{n}}=1}. Using this formula to compute the values of all binomial coefficients generates an infinite array calledPascal's triangle. The same values can also be computed directly by a different formula that is not a recurrence, but usesfactorials, multiplication and division, not just additions:

(nk)=n!k!(nk)!.{\displaystyle {\binom {n}{k}}={\frac {n!}{k!(n-k)!}}.}

The binomial coefficients can also be computed with a uni-dimensional recurrence:

(nk)=(nk1)(nk+1)/k,{\displaystyle {\binom {n}{k}}={\binom {n}{k-1}}(n-k+1)/k,}

with the initial value(n0)=1{\textstyle {\binom {n}{0}}=1} (The division is not displayed as a fraction for emphasizing that it must be computed after the multiplication, for not introducing fractional numbers).This recurrence is widely used in computers because it does not require to build a table as does the bi-dimensional recurrence, and does not involve very large integers as does the formula with factorials (if one uses(nk)=(nnk),{\textstyle {\binom {n}{k}}={\binom {n}{n-k}},} all involved integers are smaller than the final result).

Difference operator and difference equations

[edit]

Thedifference operator is anoperator that mapssequences to sequences, and, more generally,functions to functions. It is commonly denotedΔ,{\displaystyle \Delta ,} and is defined, infunctional notation, as

(Δf)(x)=f(x+1)f(x).{\displaystyle (\Delta f)(x)=f(x+1)-f(x).}

It is thus a special case offinite difference.

When using the index notation for sequences, the definition becomes

(Δa)n=an+1an.{\displaystyle (\Delta a)_{n}=a_{n+1}-a_{n}.}

The parentheses aroundΔf{\displaystyle \Delta f} andΔa{\displaystyle \Delta a} are generally omitted, andΔan{\displaystyle \Delta a_{n}} must be understood as the term of indexn in the sequenceΔa,{\displaystyle \Delta a,} and notΔ{\displaystyle \Delta } applied to the elementan.{\displaystyle a_{n}.}

Givensequencea=(an)nN,{\displaystyle a=(a_{n})_{n\in \mathbb {N} },} thefirst difference ofa isΔa.{\displaystyle \Delta a.}

Thesecond difference isΔ2a=(ΔΔ)a=Δ(Δa).{\displaystyle \Delta ^{2}a=(\Delta \circ \Delta )a=\Delta (\Delta a).} A simple computation shows that

Δ2an=an+22an+1+an.{\displaystyle \Delta ^{2}a_{n}=a_{n+2}-2a_{n+1}+a_{n}.}

More generally: thekth difference is defined recursively asΔk=ΔΔk1,{\displaystyle \Delta ^{k}=\Delta \circ \Delta ^{k-1},} and one has

Δkan=t=0k(1)t(kt)an+kt.{\displaystyle \Delta ^{k}a_{n}=\sum _{t=0}^{k}(-1)^{t}{\binom {k}{t}}a_{n+k-t}.}

This relation can be inverted, giving

an+k=an+(k1)Δan++(kk)Δk(an).{\displaystyle a_{n+k}=a_{n}+{k \choose 1}\Delta a_{n}+\cdots +{k \choose k}\Delta ^{k}(a_{n}).}

Adifference equation of orderk is an equation that involves thek first differences of a sequence or a function, in the same way as adifferential equation of orderk relates thek firstderivatives of a function.

The two above relations allow transforming a recurrence relation of orderk into a difference equation of orderk, and, conversely, a difference equation of orderk into recurrence relation of orderk. Each transformation is theinverse 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Δ2an+2Δan+7an=0{\displaystyle 3\Delta ^{2}a_{n}+2\Delta a_{n}+7a_{n}=0}

is equivalent to the recurrence relation

3an+2=4an+18an,{\displaystyle 3a_{n+2}=4a_{n+1}-8a_{n},}

in the sense that the two equations are satisfied by the same sequences.

As it is equivalent for a sequence to satisfy a recurrence relation or to be the solution of a difference equation, the use of the term "difference equation" is not limited to equations using a difference operator,[2][3] and the two terms "recurrence relation" and "difference equation" can be used interchangeably.[4] SeeRational difference equation,Linear constant-coefficient difference equation andMatrix difference equation for examples of using "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 asintegral equations relate to differential equations. Seetime scale calculus for a unification of the theory of difference equations with that of differential equations.

From sequences to grids

[edit]

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 aboutn{\displaystyle n}-dimensional grids. Functions defined onn{\displaystyle n}-grids can also be studied with partial difference equations.[5]

Solving

[edit]

Solving linear recurrence relations with constant coefficients

[edit]
Main article:Linear recurrence with constant coefficients

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

[edit]

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

an+1=fnan+gn,fn0,{\displaystyle a_{n+1}=f_{n}a_{n}+g_{n},\qquad f_{n}\neq 0,}

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

an+1fnan=gn{\displaystyle a_{n+1}-f_{n}a_{n}=g_{n}}
an+1k=0nfkfnank=0nfk=gnk=0nfk{\displaystyle {\frac {a_{n+1}}{\prod _{k=0}^{n}f_{k}}}-{\frac {f_{n}a_{n}}{\prod _{k=0}^{n}f_{k}}}={\frac {g_{n}}{\prod _{k=0}^{n}f_{k}}}}
an+1k=0nfkank=0n1fk=gnk=0nfk{\displaystyle {\frac {a_{n+1}}{\prod _{k=0}^{n}f_{k}}}-{\frac {a_{n}}{\prod _{k=0}^{n-1}f_{k}}}={\frac {g_{n}}{\prod _{k=0}^{n}f_{k}}}}

Let

An=ank=0n1fk,{\displaystyle A_{n}={\frac {a_{n}}{\prod _{k=0}^{n-1}f_{k}}},}

Then

An+1An=gnk=0nfk{\displaystyle A_{n+1}-A_{n}={\frac {g_{n}}{\prod _{k=0}^{n}f_{k}}}}
m=0n1(Am+1Am)=AnA0=m=0n1gmk=0mfk{\displaystyle \sum _{m=0}^{n-1}(A_{m+1}-A_{m})=A_{n}-A_{0}=\sum _{m=0}^{n-1}{\frac {g_{m}}{\prod _{k=0}^{m}f_{k}}}}
ank=0n1fk=A0+m=0n1gmk=0mfk{\displaystyle {\frac {a_{n}}{\prod _{k=0}^{n-1}f_{k}}}=A_{0}+\sum _{m=0}^{n-1}{\frac {g_{m}}{\prod _{k=0}^{m}f_{k}}}}
an=(k=0n1fk)(A0+m=0n1gmk=0mfk){\displaystyle a_{n}=\left(\prod _{k=0}^{n-1}f_{k}\right)\left(A_{0}+\sum _{m=0}^{n-1}{\frac {g_{m}}{\prod _{k=0}^{m}f_{k}}}\right)}

If we apply the formula toan+1=(1+hfnh)an+hgnh{\displaystyle a_{n+1}=(1+hf_{nh})a_{n}+hg_{nh}} and take the limith0{\displaystyle h\to 0}, we get the formula for first orderlinear 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 relations

[edit]

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

Jn+1=2nzJnJn1{\displaystyle J_{n+1}={\frac {2n}{z}}J_{n}-J_{n-1}}

is given by

Jn=Jn(z),{\displaystyle J_{n}=J_{n}(z),}

theBessel function, while

(bn)Mn1+(2nb+z)MnnMn+1=0{\displaystyle (b-n)M_{n-1}+(2n-b+z)M_{n}-nM_{n+1}=0}

is solved by

Mn=M(n,b;z){\displaystyle M_{n}=M(n,b;z)}

theconfluent hypergeometric series. Sequences which are the solutions oflinear difference equations with polynomial coefficients are calledP-recursive. For these specific recurrence equations algorithms are known which findpolynomial,rational orhypergeometric solutions.

Solving general non-homogeneous linear recurrence relations with constant coefficients

[edit]

Furthermore, for the general non-homogeneous linear recurrence relation with constant coefficients, one can solve it based on variation of parameter.[7]

Solving first-order rational difference equations

[edit]
Main article:Rational difference equation

A first order rational difference equation has the formwt+1=awt+bcwt+d{\displaystyle w_{t+1}={\tfrac {aw_{t}+b}{cw_{t}+d}}}. Such an equation can be solved by writingwt{\displaystyle w_{t}} as a nonlinear transformation of another variablext{\displaystyle x_{t}} which itself evolves linearly. Then standard methods can be used to solve the linear difference equation inxt{\displaystyle x_{t}}.

Stability

[edit]

Stability of linear higher-order recurrences

[edit]

The linear recurrence of orderd{\displaystyle d},

an=c1an1+c2an2++cdand,{\displaystyle a_{n}=c_{1}a_{n-1}+c_{2}a_{n-2}+\cdots +c_{d}a_{n-d},}

has thecharacteristic equation

λdc1λd1c2λd2cdλ0=0.{\displaystyle \lambda ^{d}-c_{1}\lambda ^{d-1}-c_{2}\lambda ^{d-2}-\cdots -c_{d}\lambda ^{0}=0.}

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

Stability of linear first-order matrix recurrences

[edit]
Main article:Matrix difference equation

In the first-order matrix difference equation

[xtx]=A[xt1x]{\displaystyle [x_{t}-x^{*}]=A[x_{t-1}-x^{*}]}

with state vectorx{\displaystyle x} and transition matrixA{\displaystyle A},x{\displaystyle x} converges asymptotically to the steady state vectorx{\displaystyle x^{*}} if and only if all eigenvalues of the transition matrixA{\displaystyle A} (whether real or complex) have anabsolute value which is less than 1.

Stability of nonlinear first-order recurrences

[edit]

Consider the nonlinear first-order recurrence

xn=f(xn1).{\displaystyle x_{n}=f(x_{n-1}).}

This recurrence islocally stable, meaning that itconverges to a fixed pointx{\displaystyle x^{*}} from points sufficiently close tox{\displaystyle x^{*}}, if the slope off{\displaystyle f} in the neighborhood ofx{\displaystyle x^{*}} is smaller thanunity in absolute value: that is,

|f(x)|<1.{\displaystyle |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 continuousf two adjacent fixed points cannot both be locally stable.

A nonlinear recurrence relation could also have a cycle of periodk{\displaystyle k} fork>1{\displaystyle k>1}. Such a cycle is stable, meaning that it attracts a set of initial conditions of positive measure, if the composite function

g(x):=fff(x){\displaystyle g(x):=f\circ f\circ \cdots \circ f(x)}

withf{\displaystyle f} appearingk{\displaystyle k} times is locally stable according to the same criterion:

|g(x)|<1,{\displaystyle |g'(x^{*})|<1,}

wherex{\displaystyle x^{*}} is any point on the cycle.

In achaotic recurrence relation, the variablex{\displaystyle 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 alsologistic map,dyadic transformation, andtent map.

Relationship to differential equations

[edit]

When solving anordinary differential equationnumerically, one typically encounters a recurrence relation. For example, when solving theinitial value problem

y(t)=f(t,y(t)),  y(t0)=y0,{\displaystyle y'(t)=f(t,y(t)),\ \ y(t_{0})=y_{0},}

withEuler's method and a step sizeh{\displaystyle h}, one calculates the values

y0=y(t0),  y1=y(t0+h),  y2=y(t0+2h), {\displaystyle y_{0}=y(t_{0}),\ \ y_{1}=y(t_{0}+h),\ \ y_{2}=y(t_{0}+2h),\ \dots }

by the recurrence

yn+1=yn+hf(tn,yn),tn=t0+nh{\displaystyle \,y_{n+1}=y_{n}+hf(t_{n},y_{n}),t_{n}=t_{0}+nh}

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

Applications

[edit]

Mathematical biology

[edit]

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

Thelogistic 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 morepopulations. For example, theNicholson–Bailey model for a host-parasite interaction is given by

Nt+1=λNteaPt{\displaystyle N_{t+1}=\lambda N_{t}e^{-aP_{t}}}
Pt+1=Nt(1eaPt),{\displaystyle P_{t+1}=N_{t}(1-e^{-aP_{t}}),}

withNt{\displaystyle N_{t}} representing the hosts, andPt{\displaystyle P_{t}} the parasites, at timet{\displaystyle t}.

Integrodifference equations are a form of recurrence relation important to spatialecology. These and other difference equations are particularly suited to modelingunivoltine populations.

Computer science

[edit]

Recurrence relations are also of fundamental importance inanalysis of algorithms.[8][9] If analgorithm 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 withn{\displaystyle n} 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 isn{\displaystyle n}.

A better algorithm is calledbinary 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{\displaystyle c_{1}=1}
cn=1+cn/2{\displaystyle c_{n}=1+c_{n/2}}

thetime complexity of which will beO(log2(n)){\displaystyle O(\log _{2}(n))}.

Digital signal processing

[edit]

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

For example, the equation for a "feedforward" IIRcomb filter of delayT{\displaystyle T} is:

yt=(1α)xt+αytT,{\displaystyle y_{t}=(1-\alpha )x_{t}+\alpha y_{t-T},}

wherext{\displaystyle x_{t}} is the input at timet{\displaystyle t},yt{\displaystyle y_{t}} is the output at timet{\displaystyle t}, andα{\displaystyle \alpha } controls how much of the delayed signal is fed back into the output. From this we can see that

yt=(1α)xt+α((1α)xtT+αyt2T){\displaystyle y_{t}=(1-\alpha )x_{t}+\alpha ((1-\alpha )x_{t-T}+\alpha y_{t-2T})}
yt=(1α)xt+(αα2)xtT+α2yt2T{\displaystyle y_{t}=(1-\alpha )x_{t}+(\alpha -\alpha ^{2})x_{t-T}+\alpha ^{2}y_{t-2T}}

etc.

Economics

[edit]
See also:time series analysis andsimultaneous equations model

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, realGDP, etc.) in terms of past and current values of other variables.

See also

[edit]

References

[edit]

Footnotes

[edit]
  1. ^Jacobson, Nathan, Basic Algebra 2 (2nd ed.), § 0.4. pg 16.
  2. ^S. Barnard and J. M. Child,Higher Algebra (1936) page 369. "An equation of the formaun + bun−1 + cun−2 + ... + kun−r = l is called alinear difference equation."
  3. ^C. R. Wylie,Advanced Engineering Mathematics (1960) page 167. "However, in the study of difference equations we do not ordinarily consider equations of the formf(Δ)y = 𝜙(x) ... but rather equations of the formf(E)y = 𝜙(x)" where Δ is the difference operator andE is ashift operator.
  4. ^J. Bradley,Introduction to Discrete Mathematics (1988) page 266. "Older texts on this topic tend to talk primarily about difference equations; newer ones talk about recurrence equations or relations. This reflects an important change in mathematical thinking since the 1950s; difference equations are primarily seen as an approximation of differential equations, a calculus topic. Recurrence equations are seen as an important topic in their own right. The shift in names suggests the growing recognition of the importance of discrete mathematics."
  5. ^Partial difference equations, Sui Sun Cheng, CRC Press, 2003,ISBN 978-0-415-29884-1
  6. ^"Archived copy"(PDF).Archived(PDF) from the original on 2010-07-05. Retrieved2010-10-19.{{cite web}}: CS1 maint: archived copy as title (link)
  7. ^Solution of Nonhomogeneous Linear Recurrence Relations with Constant Coefficient based on Variation of Parameter, Haoran Han, 2025
  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.

Bibliography

[edit]

External links

[edit]
International
National
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=Recurrence_relation&oldid=1333742476#difference_equation"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp