|
|
Line 1: |
Line 1: |
| {{redirect-distinguish|Difference equation|differential equation}}
| | I'm Chantal (31) from Quoiba, Australia. <br>I'm learning Chinese literature at a local university and I'm just about to graduate.<br>I have a part time job in a the office.<br><br>Also visit my webpage; Fifa 15 Coin Generator - [http://myhotfb.com/node/134 myhotfb.com] - |
| In [[mathematics]], a '''recurrence relation''' is an [[equation]] that [[recursion|recursively]] defines a [[sequence]], once one or more initial terms are given: each further term of the sequence is defined as a [[Function (mathematics)|function]] of the preceding terms.
| |
| | |
| The term '''[[#Relationship_to_difference_equations_narrowly_defined|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]]:
| |
| | |
| :<math>x_{n+1} = r x_n (1 - x_n),</math>
| |
| | |
| with a given constant ''r''; given the initial term ''x''<sub>0</sub> each subsequent term is determined by this relation.
| |
| | |
| Some simply defined recurrence relations can have very complex ([[chaos theory|chaotic]]) behaviours, and they are a part of the field of mathematics known as [[Nonlinearity|nonlinear analysis]].
| |
| | |
| Solving a recurrence relation means obtaining a [[closed-form solution]]: a non-recursive function of ''n''.
| |
| | |
| == Fibonacci numbers ==
| |
| The [[Fibonacci number]]s are the archetype of a linear, homogeneous recurrence relation with constant coefficients (see below). They are defined using the linear recurrence relation
| |
| | |
| :<math>F_n = F_{n-1}+F_{n-2}</math>
| |
| | |
| with seed values:
| |
| | |
| :<math>F_0 = 0</math>
| |
| :<math>F_1 = 1</math>
| |
| | |
| Explicitly, recurrence yields the equations:
| |
| :<math>F_2 = F_1 + F_0</math>
| |
| :<math>F_3 = F_2 + F_1</math>
| |
| :<math>F_4 = F_3 + F_2</math>
| |
| 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 [[Binet formula|closed-form expression]] which involve powers of the two roots of the characteristic polynomial ''t''<sup>2</sup> = ''t'' + 1; the [[generating function]] of the sequence is the [[rational function]]
| |
| : <math>\frac{t}{1-t-t^2}.</math>
| |
| | |
| == Structure ==
| |
| | |
| ===Linear homogeneous recurrence relations with constant coefficients===
| |
| An order ''d'' '''linear homogeneous recurrence relation with constant coefficients''' is an equation of the form
| |
| | |
| :<math>a_n = c_1a_{n-1} + c_2a_{n-2}+\cdots+c_da_{n-d},</math>
| |
| | |
| where the ''d'' coefficients ''c<sub>i</sub>'' (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 (statistics)|degrees of freedom]] for LRS, i.e., the initial values <math>a_0,\dots,a_{d-1}</math> 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")
| |
| | |
| :<math>p(t)= t^d - c_1t^{d-1} - c_2t^{d-2}-\cdots-c_{d}</math>
| |
| whose ''d'' roots play a crucial role in finding and understanding the sequences satisfying the recurrence. If the roots ''r''<sub>1</sub>, ''r''<sub>2</sub>, ... are all distinct, then the solution to the recurrence takes the form
| |
| :<math>a_n = k_1 r_1^n + k_2 r_2^n + \cdots + k_d r_d^n,</math>
| |
| where the coefficients ''k<sub>i</sub>'' 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'')<sup>3</sup>, with the same root ''r'' occurring three times, then the solution would take the form
| |
| :<math>a_n = k_1 r^n + k_2 n r^n + k_3 n^2 r^n.</math><ref>{{citation|contribution=2.1.1 Constant coefficients – A) Homogeneous equations|title=Mathematics for the Analysis of Algorithms|first1=Daniel H.|last1=Greene|first2=Donald E.|last2=Knuth|author2-link=Donald Knuth| edition=2nd| publisher=Birkhäuser |page=17 | year=1982}}.</ref>
| |
| | |
| === 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, <math>a_n = a_{n-d}, n\geq d</math>, which have sequence <math>a_0,a_1,\dots,a_{d-1},a_0,\dots</math> and generating function a sum of geometric series:
| |
| :<math>\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 + \left(a_0 + a_1 x^1 + \cdots + a_{d-1}x^{d-1}\right)x^{2d} + \cdots.</math>
| |
| | |
| More generally, given the recurrence relation:
| |
| :<math>a_n = c_1a_{n-1} + c_2a_{n-2}+\cdots+c_da_{n-d}</math>
| |
| with generating function
| |
| | |
| :<math>a_0 + a_1x^1 + a_2 x^2 + \cdots,</math>
| |
| | |
| the series is annihilated at ''a<sub>d</sub>'' and above by the polynomial:
| |
| | |
| :<math>1- c_1x^1 - c_2 x^2 - \cdots - c_dx^d.</math>
| |
| | |
| That is, multiplying the generating function by the polynomial yields
| |
| | |
| :<math>b_n = a_n - c_1 a_{n-1} - c_2 a_{n-2} - \cdots - c_d a_{n-d}</math>
| |
| | |
| as the coefficient on <math>x^n</math>, which vanishes (by the recurrence relation) for ''n'' ≥ ''d''. Thus
| |
| | |
| :<math>\left (a_0 + a_1x^1 + a_2 x^2 + \cdots \right ) \left (1- c_1x^1 - c_2 x^2 - \cdots - c_dx^d \right) = \left (b_0 + b_1x^1 + b_2 x^2 + \cdots + b_{d-1} x^{d-1} \right )</math>
| |
| | |
| so dividing yields
| |
| | |
| :<math>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},</math>
| |
| | |
| expressing the generating function as a rational function.
| |
| | |
| The denominator is <math>x^d p\left(x^{-1}\right),</math> 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 <math>b_0 = a_0</math>.
| |
| | |
| === Relationship to difference equations narrowly defined ===
| |
| Given an ordered [[sequence]] <math>\left\{a_n\right\}_{n=1}^\infty</math> of [[real numbers]]: the '''first difference''' <math>\Delta(a_n)</math> is defined as
| |
| | |
| :<math>\Delta(a_n) = a_{n+1} - a_n\,</math>.
| |
| | |
| The '''second difference''' <math>\Delta^2(a_n)</math> is defined as
| |
| | |
| :<math>\Delta^2(a_n) = \Delta(a_{n+1}) - \Delta(a_n)</math>,
| |
| | |
| which can be simplified to
| |
| | |
| :<math>\Delta^2(a_n) = a_{n+2} - 2a_{n+1} + a_n</math>.
| |
| | |
| More generally: the '''''k''<sup>th</sup> difference''' of the sequence ''a<sub>n</sub>'' is written as <math>\Delta^k(a_n)</math> is defined recursively as
| |
| | |
| :<math>\Delta^k(a_n) = \Delta^{k-1}(a_{n+1}) - \Delta^{k-1}(a_n)=\sum_{t=0}^k \binom{k}{t} (-1)^t a_{n+k-t}</math>.
| |
| | |
| (The sequence and its differences are related by a [[binomial transform]].) The more restrictive definition of '''difference equation''' is an equation composed of ''a<sub>n</sub>'' and its ''k''<sup>th</sup> 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
| |
| | |
| :<math>3\Delta^2(a_n) + 2\Delta(a_n) + 7a_n = 0</math>
| |
| | |
| is equivalent to the recurrence relation
| |
| | |
| :<math>3a_{n+2} = 4a_{n+1} - 8a_n</math>
| |
| | |
| 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 number]]s 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 equation]]s relate to difference equations as [[integral equation]]s relate to differential equations.
| |
| | |
| ====From sequences to grids====
| |
| 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-dimensional grids. Functions defined on n-grids can also be studied with '''partial difference equations'''.<ref>[http://books.google.com/books?id=1klnDGelHGEC Partial difference equations], Sui Sun Cheng, CRC Press, 2003, ISBN 978-0-415-29884-1</ref>
| |
| | |
| == Solving ==
| |
| | |
| === General methods ===
| |
| For order 1, the recurrence
| |
| :<math>a_{n}=r a_{n-1}</math>
| |
| has the solution ''a<sub>n</sub>'' = ''r<sup>n</sup>'' with ''a''<sub>0</sub> = 1 and the most general solution is ''a<sub>n</sub>'' = ''kr<sup>n</sup>'' with ''a''<sub>0</sub> = ''k''. The characteristic polynomial equated to zero (the [[Characteristic polynomial|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<sub>n</sub>'' = ''r<sup>n</sup>'' 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 function]]s ([[formal power series]]) or matrices.
| |
| | |
| Consider, for example, a recurrence relation of the form
| |
| | |
| :<math>a_{n}=Aa_{n-1}+Ba_{n-2}.</math>
| |
| | |
| When does it have a solution of the same general form as ''a<sub>n</sub>'' = ''r<sup>n</sub>''? Substituting this guess ([[ansatz]]) in the recurrence relation, we find that
| |
| | |
| :<math>r^{n}=Ar^{n-1}+Br^{n-2}</math>
| |
| | |
| must be true for '''all''' ''n'' > 1.
| |
| | |
| Dividing through by ''r''<sup>''n''−2</sup>, we get that all these equations reduce to the same thing:
| |
| | |
| :<math>r^2=Ar+B,</math>
| |
| :<math>r^2-Ar-B=0,</math>
| |
| | |
| which is the characteristic equation of the recurrence relation. Solve for ''r'' to obtain the two roots ''λ''<sub>1</sub>, ''λ''<sub>2</sub>: these roots are known as the [[characteristic root]]s 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
| |
| | |
| :<math>a_n = C\lambda_1^n+D\lambda_2^n</math>
| |
| | |
| while if they are identical (when ''A''<sup>2</sup> + 4''B'' = 0), we have
| |
| | |
| :<math>a_n = C\lambda^n+Dn\lambda^n</math>
| |
| | |
| This is the most general solution; the two constants ''C'' and ''D'' can be chosen based on two given initial conditions ''a''<sub>0</sub> and ''a''<sub>1</sub> 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 <math>\lambda_1, \lambda_2 = \alpha \pm \beta i.</math> Then it can be shown that
| |
| | |
| :<math>a_n = C\lambda_1^n+D\lambda_2^n</math>
| |
| | |
| can be rewritten as<ref>Chiang, Alpha C., ''Fundamental Methods of Mathematical Economics'', third edition, McGraw-Hill, 1984.</ref>{{rp|576–585}}
| |
| | |
| :<math>a_n = 2 M^n \left( E \cos(\theta n) + F \sin(\theta n)\right) = 2 G M^n \cos(\theta n - \delta),</math>
| |
| | |
| where
| |
| | |
| :<math>\begin{array}{lcl}
| |
| M = \sqrt{\alpha^2+\beta^2} & \cos (\theta) =\tfrac{\alpha}{M} & \sin( \theta) = \tfrac{\beta}{M} \\
| |
| C,D = E \mp F i & & \\
| |
| G = \sqrt{E^2+F^2} & \cos (\delta ) = \tfrac{E}{G} & \sin (\delta )= \tfrac{F}{G}
| |
| \end{array}</math>
| |
| | |
| Here ''E'' and ''F'' (or equivalently, ''G'' and δ) are real constants which depend on the initial conditions. Using
| |
| :<math>\lambda_1+\lambda_2=2 \alpha = A,</math>
| |
| :<math>\lambda_1 \cdot \lambda_2=\alpha^2+\beta^2=-B,</math>
| |
| | |
| one may simplify the solution given above as
| |
| | |
| :<math>a_n = (-B)^{\frac{n}{2}} \left( E \cos(\theta n) + F \sin(\theta n)\right),</math>
| |
| | |
| where ''a''<sub>1</sub> and ''a''<sub>2</sub> are the initial conditions and
| |
| | |
| :<math>\begin{align}
| |
| E &=\frac{-A a_1 + a_2}{B} \\
| |
| F &=-i \frac{A^2 a_1 - A a_2 +2 a_1 B}{B \sqrt{A^2+4B}} \\
| |
| \theta &=a\cos \left (\frac{A}{2 \sqrt{-B}} \right )
| |
| \end{align}</math>
| |
| | |
| In this way there is no need to solve for λ<sub>1</sub> and λ<sub>2</sub>.
| |
| | |
| In all cases—real distinct eigenvalues, real duplicated eigenvalues, and complex conjugate eigenvalues—the equation is [[stability theory|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 second-order case, this condition on the eigenvalues can be shown<ref>Papanicolaou, Vassilis, "On the asymptotic stability of a class of linear difference equations," ''Mathematics Magazine'' 69(1), February 1996, 34–43.</ref> 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 differential equation|homogeneous]], in that there was no constant term. If one starts with the non-homogeneous recurrence
| |
| | |
| :<math>b_{n}=Ab_{n-1}+Bb_{n-2}+K</math>
| |
| | |
| with constant term ''K'', this can be converted into homogeneous form as follows: The [[steady state]] is found by setting ''b<sub>n</sub>'' = ''b''<sub>''n''−1</sub> = ''b''<sub>''n''−2</sub> = ''b''* to obtain
| |
| | |
| :<math> b^{*} = \frac{K}{1-A-B}.</math>
| |
| | |
| Then the non-homogeneous recurrence can be rewritten in homogeneous form as
| |
| | |
| :<math>[b_n - b^*]=A[b_{n-1}-b^*]+B[b_{n-2}-b^*],</math>
| |
| | |
| 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 ''n''<sup>th</sup>-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===
| |
| A linearly recursive sequence y of order n
| |
| | |
| :<math>y_{n+k} - c_{n-1}y_{n-1+k} - c_{n-2}y_{n-2+k} + \cdots - c_{0}y_{k} = 0</math>
| |
| | |
| is identical to
| |
| | |
| :<math>y_{n} = c_{n-1}y_{n-1} + c_{n-2}y_{n-2} + \cdots +c_{0}y_{0}.</math>
| |
| | |
| Expanded with n-1 identities of kind <math>y_{n-k} = y_{n-k},</math> this n-th order equation is translated into a system of n first order linear equations,
| |
| | |
| :<math>\vec y_{n} = \begin{bmatrix}y_n\\y_{n-1}\\ \vdots \\ y_1 \end{bmatrix} = \begin{bmatrix}-c_{n-1} & -c_{n-2} & \cdots & -c_{0} \\ 1 & 0 & \cdots &0\\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 0\end{bmatrix}\begin{bmatrix}y_{n-1} \\y_{n-2} \\ \vdots \\ y_0 \end{bmatrix} = C\ \vec y_{n-1} = C^n \vec y_0.</math>
| |
| | |
| Observe that the vector <math>\vec y_n</math> can be computed by ''n'' applications of the [[companion matrix]], C, to the initial state vector, <math>y_0</math>. Thereby, n-th entry of the sought sequence y, is the top component of <math>\vec y_n, y_n = \vec y_n[n]</math>.
| |
| | |
| [[Eigendecomposition of a matrix#Example| Eigendecomposition]], <math>\vec y_n = \vec C^n\, \vec y_0 = c_1\,\lambda_1^n\,\vec e_1 + c_2\,\lambda_2^n\,\vec e_2 + \cdots + c_n\,\lambda_n^n\,\vec e_n</math> into eigenvalues, <math>\lambda_1, \lambda_2, \ldots, \lambda_n</math>, and eigenvectors, <math>\vec e_1, \vec e_2, \ldots, \vec e_n</math>, is used to compute <math>\vec y_n.</math> Thanks to the crucial fact that system ''C'' time-shifts every eigenvector, ''e'', by simply scaling its components ''λ'' times,
| |
| | |
| :<math>C\,\vec e_i = \lambda_i \vec e_i = C \begin{bmatrix}e_{i,n} \\e_{i,n-1} \\ \vdots \\ e_{i,1}\end{bmatrix} = \begin{bmatrix}\lambda_i\,e_{i,n} \\ \lambda_i\,e_{i,n-1} \\ \vdots \\ \lambda_i\,e_{i,1}\end{bmatrix}</math>
| |
| | |
| that is, time-shifted version of eigenvector,''e'', has components ''λ'' times larger, the eighenvector components are powers of ''λ'', <math>\vec e_i = \begin{bmatrix}\lambda_i^{n-1} & \cdots & \lambda_i^2 & \lambda_i & 1\end{bmatrix}^T,</math> and, thus, recurrent linear homogenous equation solution is a combination of exponential functions, <math>\vec y_n = \sum_1^n {c_i\,\lambda_i^n\,\vec e_i}</math>. The components <math>c_i</math> can be determined out of initial conditions:
| |
| | |
| :<math>\vec y_0 = \begin{bmatrix}y_{0}\\ y_{-1} \\ \vdots\\ y_{-n+1}\end{bmatrix} = \sum_{i=1}^n {c_i\,\lambda_i^0\,\vec e_i} = \begin{bmatrix}\vec e_1 & \vec e_2 & \cdots & \vec e_n\end{bmatrix}\,\begin{bmatrix}c_1 \\ c_2 \\ \cdots \\ c_n\end{bmatrix} = E\, \begin{bmatrix}c_1 \\ c_2 \\ \cdots \\ c_n\end{bmatrix}</math>
| |
| | |
| Solving for coefficients,
| |
| | |
| :<math>\begin{bmatrix}c_1 \\ c_2 \\ \cdots \\ c_n\end{bmatrix} = E^{-1} \vec y_0 = \begin{bmatrix}\lambda_1^{n-1} & \lambda_2^{n-1} & \cdots & \lambda_n^{n-1} \\ \vdots & \vdots & \ddots & \vdots \\ \lambda_1 & \lambda_2 & \cdots & \lambda_n \\ 1 & 1 & \cdots & 1\end{bmatrix}^{-1}\,\begin{bmatrix}y_{0}\\ y_{-1} \\ \vdots\\ y_{-n+1}\end{bmatrix}.</math>
| |
| | |
| This also works with arbitrary boundary conditions <math>\underbrace{y_a, y_b, \ldots}_\text{n}</math>, not necessary the initial ones,
| |
| | |
| :<math>\begin{bmatrix}y_a \\ y_b \\ \vdots\end{bmatrix} = \begin{bmatrix}\vec y_a[n] \\ \vec y_b[n] \\ \vdots\end{bmatrix} = \begin{bmatrix}\sum_{i=1}^n {c_i\,\lambda_i^a\,\vec e_i[n]} \\ \sum_{i=1}^n {c_i\,\lambda_i^b\,\vec e_i[n]} \\ \vdots\end{bmatrix} =\begin{bmatrix}\sum_{i=1}^n {c_i\,\lambda_i^a\,\lambda_i^{n-1}} \\ \sum_{i=1}^n {c_i\,\lambda_i^b\,\lambda_i^{n-1}} \\ \vdots\end{bmatrix} = </math>
| |
| | |
| :<math> = \begin{bmatrix}\sum {c_i\,\lambda_i^{a+n-1}} \\ \sum {c_i\,\lambda_i^{b+n-1}} \\ \vdots\end{bmatrix} = \begin{bmatrix}\lambda_1^{a+n-1} & \lambda_2^{a+n-1} & \cdots & \lambda_n^{a+n-1} \\ \lambda_1^{b+n-1} & \lambda_2^{b+n-1} & \cdots & \lambda_n^{b+n-1} \\ \vdots & \vdots & \ddots & \vdots \end{bmatrix}\,\begin{bmatrix}c_1 \\ c_2 \\ \vdots \\ c_n\end{bmatrix}.</math>
| |
| | |
| This description is really no different from general method above, however it is more succinct. It also works nicely for situations like
| |
| :<math>\begin{cases}
| |
| a_n =a_{n-1}-b_{n-1}\\
| |
| b_n =2a_{n-1}+b_{n-1}.
| |
| \end{cases}
| |
| </math>
| |
| where there are several linked recurrences {{Citation needed|date=June 2010}}.
| |
| | |
| ===Solving with z-transforms===
| |
| Certain difference equations - in particular, [[Z-transform#Linear constant-coefficient difference equation|linear constant coefficient]] difference equations - can be solved using [[z-transform]]s. The ''z''-transforms are a class of [[integral transform]]s 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")
| |
| | |
| :<math>t^d - c_1t^{d-1} - c_2t^{d-2}-\cdots-c_{d} = 0 \,</math>
| |
| | |
| such that each ''c<sub>i</sub>'' corresponds to each ''c<sub>i</sub>'' 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''−λ)<sup>''r''</sup> divides ''p''(''t''). The following two properties hold:
| |
| | |
| # Each of the ''r'' sequences <math>\lambda^n, n\lambda^n, n^2\lambda^n,\dots,n^{r-1}\lambda^n</math> 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<sub>n</sub>'' as a linear combination of all the roots (counting multiplicity as shown in the theorem above) with unknown coefficients ''b<sub>i</sub>''.
| |
| | |
| ::<math>a_n = \left (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 \right )+\cdots+ \left (b_{d-q+1}\lambda_{*}^n + \cdots + b_{d}n^{q-1}\lambda_{*}^n \right )</math>
| |
| | |
| :This is the general solution to the original recurrence relation. (''q'' is the multiplicity of λ<sub>*</sub>)
| |
| | |
| :4. Equate each <math>a_0, a_1, \dots,a_d</math> from part 3 (plugging in ''n'' = 0, ..., ''d'' into the general solution of the recurrence relation) with the known values <math>a_0, a_1, \dots,a_d</math> from the original recurrence relation. However, the values ''a<sub>n</sub>'' 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 linear homogeneous recurrence relation of order 3 one could use the values ''a''<sub>0</sub>, ''a''<sub>1</sub>, ''a''<sub>4</sub>). This process will produce a linear system of ''d'' equations with ''d'' unknowns. Solving these equations for the unknown coefficients <math>b_1, b_2, \dots,b_d </math> 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 <math>a_0,a_1,a_2,\dots</math> 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 ''e''<sup>λ''x''</sup> 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:
| |
| | |
| :<math>\sum_{n=0}^\infin \frac{f^{(n)}(a)}{n!} (x-a)^n</math>
| |
| | |
| it can be seen that the coefficients of the series are given by the ''n''<sup>th</sup> 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:
| |
| | |
| :<math>y^{[k]} \to f[n+k]</math>
| |
| and more generally
| |
| :<math>x^m*y^{[k]} \to n(n-1)(n-m+1)f[n+k-m]</math>
| |
| | |
| '''Example:''' The recurrence relationship for the Taylor series coefficients of the equation:
| |
| | |
| :<math> (x^2 + 3x -4)y^{[3]} -(3x+1)y^{[2]} + 2y = 0</math>
| |
| | |
| is given by
| |
| | |
| :<math> n(n-1)f[n+1] + 3nf[n+2] -4f[n+3] -3nf[n+1] -f[n+2]+ 2f[n] = 0</math>
| |
| | |
| or
| |
| | |
| :<math>-4f[n+3] +2nf[n+2] + n(n-4)f[n+1] +2f[n] = 0.</math>
| |
| | |
| 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
| |
| | |
| :<math>ay'' + by' +cy = 0</math>
| |
| | |
| has solution
| |
| | |
| :<math> y=e^{ax}.</math>
| |
| | |
| The conversion of the differential equation to a difference equation of the Taylor coefficients is
| |
| | |
| :<math>af[n + 2] + bf[n + 1] + cf[n] = 0.</math>
| |
| | |
| It is easy to see that the ''n''th derivative of ''e''<sup>''ax''</sup> evaluated at 0 is ''a''<sup>''n''</sup>
| |
| | |
| ===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:
| |
| | |
| :<math>a_{n+1} = a_{n} + 1</math>
| |
| | |
| This is an inhomogeneous recurrence. If we substitute ''n'' ↦ ''n''+1, we obtain the recurrence
| |
| | |
| :<math>a_{n+2} = a_{n+1} + 1</math>
| |
| | |
| Subtracting the original recurrence from this equation yields
| |
| | |
| :<math>a_{n+2} - a_{n+1} = a_{n+1} - a_n</math>
| |
| | |
| or equivalently
| |
| | |
| :<math>a_{n+2} = 2 a_{n+1} - a_n</math>
| |
| | |
| This is a homogeneous recurrence which can be solved by the methods explained above. In general, if a linear recurrence has the form
| |
| | |
| :<math> 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) </math>
| |
| | |
| where <math>\lambda_0, \lambda_1, \dots, \lambda_{k-1}</math> 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.
| |
| | |
| If
| |
| :<math>P(x) = \sum_{n=0}^\infty p_n x^n</math>
| |
| is the generating function of the inhomogeneity, the generating function
| |
| :<math>A(x) = \sum_{n=0}^\infty a(n) x^n</math>
| |
| of the inhomogeneous recurrence
| |
| :<math> a_n = \sum_{i=1}^s c_i a_{n-i}+p_n,\quad n\ge n_r,</math>
| |
| with constant coefficients {{math|c<sub>i</sub>}} is derived from
| |
| :<math> \left (1-\sum_{i=1}^sc_ix^i \right )A(x)=P(x)+\sum_{n=0}^{n_r-1}[a_n-p_n]x^n-\sum_{i=1}^s c_ix^i\sum_{n=0}^{n_r-i-1}a_nx^n.</math>
| |
| If ''P''(''x'') is a rational generating function, ''A''(''x'') is also one. The case discussed above, where ''p<sub>n</sub>'' = ''K'' is a constant, emerges as one example of this formula, with ''P''(''x'') = ''K''/(1−''x''). The solution of homogeneous recurrences is incorporated as ''p'' = ''P'' = 0.
| |
| | |
| Moreover, for the general first-order linear inhomogeneous recurrence relation with variable coefficient(s)
| |
| | |
| :<math>a_{n+1} = f_n a_n + g_n, \qquad f_n \neq 0,</math>
| |
| there is also a nice method to solve it:<ref>http://faculty.pccu.edu.tw/%7Emeng/Math15.pdf</ref>
| |
| :<math>a_{n+1} - f_n a_n = g_n</math>
| |
| :<math>\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}</math>
| |
| :<math>\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}</math>
| |
| | |
| Let
| |
| :<math>A_n = \frac{a_n}{\prod_{k=0}^{n-1} f_k},</math>
| |
| Then
| |
| :<math>A_{n+1} - A_n = \frac{g_n}{\prod_{k=0}^n f_k}</math>
| |
| :<math>\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}</math>
| |
| :<math>\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}</math>
| |
| :<math>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)</math>
| |
| | |
| ===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 function]]s. For example, the solution to
| |
| | |
| :<math>J_{n+1}=\frac{2n}{z}J_n-J_{n-1}</math>
| |
| | |
| is given by
| |
| | |
| :<math>J_n=J_n(z), \,</math>
| |
| | |
| the [[Bessel function]], while
| |
| | |
| :<math>(b-n)M_{n-1} +(2n-b-z)M_n - nM_{n+1}=0 \,</math>
| |
| | |
| is solved by
| |
| | |
| :<math>M_n=M(n,b;z) \,</math>
| |
| | |
| the [[confluent hypergeometric series]].
| |
| | |
| ===Solving a first order rational difference equation===
| |
| {{Main|Rational difference equation}}
| |
| | |
| A first order rational difference equation has the form <math>w_{t+1} = \tfrac{aw_t+b}{cw_t+d}</math>. Such an equation can be solved by writing <math>w_t</math> as a nonlinear transformation of another variable <math>x_t</math> which itself evolves linearly. Then standard methods can be used to solve the linear difference equation in <math>x_t</math>.
| |
| | |
| ==Stability==
| |
| | |
| ===Stability of linear higher-order recurrences===
| |
| The linear recurrence of order ''d'',
| |
| | |
| :<math>a_n = c_1a_{n-1} + c_2a_{n-2}+\dots+c_da_{n-d}, \, </math>
| |
| | |
| has the [[Characteristic polynomial|characteristic equation]]
| |
| | |
| :<math>\lambda^d - c_1 \lambda^{d-1} - c_2 \lambda^{d-2} - \dots - c_d \lambda^0 =0. \, </math>
| |
| | |
| The recurrence is [[Stability theory|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 (mathematics)|unity]] in absolute value.
| |
| | |
| ===Stability of linear first-order matrix recurrences===
| |
| {{Main|Matrix difference equation}}
| |
| | |
| In the first-order matrix difference equation
| |
| | |
| :<math>[x_t - x^*] = A[x_{t-1}-x^*]\,</math>
| |
| | |
| 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 first-order recurrences===
| |
| Consider the nonlinear first-order recurrence
| |
| | |
| :<math>x_n=f(x_{n-1}).</math>
| |
| | |
| This recurrence is [[stability theory|locally stable]], meaning that it [[limit of a sequence|converges]] to a fixed point ''x''* from points sufficiently close to ''x''*, if the slope of ''f'' in the neighborhood of ''x''* is smaller than [[unity (mathematics)|unity]] in absolute value: that is,
| |
| | |
| : <math>| f' (x^*) | < 1. \, </math>
| |
| | |
| 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
| |
| | |
| :<math>g(x) := f \circ f \circ \cdot \cdot \cdot \circ f(x)</math>
| |
| | |
| with ''f'' appearing ''k'' times is locally stable according to the same criterion:
| |
| | |
| : <math>| g' (x^*) | < 1,</math>
| |
| | |
| where ''x''* is any point on the cycle.
| |
| | |
| In a [[chaos theory|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]] [[numerical ordinary differential equations|numerically]], one typically encounters a recurrence relation. For example, when solving the [[initial value problem]]
| |
| | |
| :<math>y'(t) = f(t,y(t)), \ \ y(t_0)=y_0,</math>
| |
| | |
| with [[Euler's method]] and a step size ''h'', one calculates the values
| |
| | |
| :<math>y_0=y(t_0), \ \ y_1=y(t_0+h), \ \ y_2=y(t_0+2h), \ \dots</math>
| |
| | |
| by the recurrence
| |
| | |
| :<math>\, y_{n+1} = y_n + hf(t_n,y_n). </math>
| |
| | |
| 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 best-known difference equations have their origins in the attempt to model [[population]] dynamics. For example, the [[Fibonacci number]]s 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
| |
| | |
| :<math>N_{t+1} = \lambda N_t e^{-aP_t} \,</math>
| |
| :<math>P_{t+1} = N_t(1-e^{-aP_t}), \,</math>
| |
| | |
| with ''N''<sub>''t''</sub> representing the hosts, and ''P''<sub>''t''</sub> the parasites, at time ''t''.
| |
| | |
| [[Integrodifference equation]]s are a form of recurrence relation important to spatial [[ecology]]. These and other difference equations are particularly suited to modeling [[voltinism|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 filter]]s.
| |
| | |
| For example, the equation for a "feedforward" IIR [[comb filter]] of delay ''T'' is:
| |
| | |
| :<math>y_t = (1 - \alpha) x_t + \alpha y_{t - T}</math>
| |
| | |
| Where <math>x_t</math> is the input at time ''t'', <math>y_t</math> 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
| |
| | |
| :<math>y_t = (1 - \alpha) x_t + \alpha ((1-\alpha) x_{t-T} + \alpha y_{t - 2T})</math>
| |
| :<math>y_t = (1 - \alpha) x_t + (\alpha-\alpha^2) x_{t-T} + \alpha^2 y_{t - 2T})</math>
| |
| | |
| etc.
| |
| | |
| ===Economics===
| |
| Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical economics.<ref>Sargent, Thomas J., ''Dynamic Macroeconomic Theory'', Harvard University Press, 1987.</ref> 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 [[exogeny|exogenous variables]] and lagged [[endogeneity (economics)|endogenous]] variables. See also [[time series analysis]].
| |
| | |
| ===Computer Science===
| |
| | |
| Recurrence relations are also of fundamental importance in [[Analysis of algorithms|Analysis of Algorithms]].<ref>Cormen, T. et al, ''Introduction to Algorithms'', MIT Press, 2009</ref><ref>R. Sedgewick, F. Flajolet, ''An Introduction to the Analysis of Algorithms'', Addison-Wesley, 2013</ref> If an [[algorithm]] is designed so that it will break a problem into smaller subproblems, its running time is described by a recurrence relation.
| |
| | |
| A simple example is the time an algorithm takes to search an element in an ordered vector with <math>n</math> 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 <math>n</math>.
| |
| | |
| A better algorithm is called [[Binary search algorithm|binary search]]. 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
| |
| | |
| :<math>c_1=1</math>
| |
| :<math>c_n=1+c_{n/2}</math>
| |
| | |
| which will be close to <math>\log_2(n)</math>.
| |
| | |
| ==See also==
| |
| {{colbegin}}
| |
| *[[Iterated function]]
| |
| *[[Matrix difference equation]]
| |
| *[[Orthogonal polynomials]]
| |
| *[[Recursion]]
| |
| *[[Recursion (computer science)]]
| |
| *[[Lagged Fibonacci generator]]
| |
| *[[Master theorem]]
| |
| *[[Circle points segments proof]]
| |
| *[[Continued fraction]]
| |
| *[[Time scale calculus]]
| |
| *[[Integrodifference equation]]
| |
| * [[Combinatorial principles]]
| |
| *[[Infinite impulse response]]
| |
| {{colend}}
| |
| | |
| == References ==
| |
| {{reflist}}
| |
| * {{cite book|first1=Paul M. | last1=Batchelder
| |
| |title=An introduction to linear difference equations
| |
| |year=1967
| |
| |publisher=Dover Publications
| |
| }}
| |
| * {{cite book|first1=Kenneth S. | last1=Miller
| |
| |title=Linear difference equations
| |
| |year=1968 | publisher=W. A. Benjamin
| |
| }}
| |
| * {{cite book| first1=Alfred | last1=Brousseau
| |
| |title=Linear Recursion and Fibonacci Sequences
| |
| |year=1971
| |
| |publisher=Fibonacci Association
| |
| |url=http://www.fq.math.ca/linear.html
| |
| }}
| |
| * [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]]. ''[[Introduction to Algorithms]]'', Second Edition. MIT Press and McGraw-Hill, 1990. ISBN 0-262-03293-7. Chapter 4: Recurrences, pp. 62–90.
| |
| *{{cite book| first1=Ronald L. | last1=Graham |
| |
| first2=Donald E. | last2=Knuth
| |
| |first3=Oren | last3=Patashnik
| |
| |title=[[Concrete Mathematics]]: A Foundation for Computer Science
| |
| |edition=2
| |
| |publisher=Addison-Welsey
| |
| |year=1994 |isbn=0-201-55802-5
| |
| }}
| |
| *{{cite book |year=2010 | url=http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP000338.html
| |
| |first1=Walter |last1=Enders
| |
| |title=Applied Econometric Times Series
| |
| |edition=3
| |
| }}
| |
| *{{cite book| first1=Paul | last1=Cull | first2=Mary | last2=Flahive
| |
| |first3=Robbie | last3=Robson
| |
| |title=Difference Equations: From Rabbits to Chaos
| |
| |publisher=Springer | year=2005 | isbn=0-387-23234-6 }} chapter 7.
| |
| * {{cite book| first1=Ian | last1=Jacques
| |
| |title=Mathematics for Economics and Business
| |
| |edition=Fifth
| |
| |publisher=Prentice Hall
| |
| |year=2006
| |
| |isbn=0-273-70195-9
| |
| |pages=551–568
| |
| }} Chapter 9.1: Difference Equations.
| |
| * {{cite web| first1=Andrei D. | last1=Polyanin
| |
| |title=Difference and Functional Equations: Exact Solutions
| |
| |url=http://eqworld.ipmnet.ru/en/solutions/fe.htm}} at EqWorld - The World of Mathematical Equations.
| |
| * {{cite web| first1=Andrei D. | last1=Polyanin
| |
| |title=Difference and Functional Equations: Methods
| |
| |url=http://eqworld.ipmnet.ru/en/education/edu-fe.htm}} at EqWorld - The World of Mathematical Equations.
| |
| | |
| == External links ==
| |
| * {{springer|title=Recurrence relation|id=p/r080150}}
| |
| * {{MathWorld | urlname= RecurrenceEquation | title= Recurrence Equation}}
| |
| * {{cite web |first1= John H. |last1=Mathews |url=http://math.fullerton.edu/mathews/c2003/ZTransformDEMod.html
| |
| |title= Homogeneous Difference Equations}}
| |
| * [http://books.google.com/books?id=pOBXUoVZ9EEC&pg=PA95&lpg=PA95&dq=%22difference+equation%22+%22recurrence+relation%22&source=web&ots=1kZStOrPh5&sig=VYKkC__C9AfmfrhjFhhLg_Q5YPk&hl=en&sa=X&oi=book_result&resnum=5&ct=result Introductory Discrete Mathematics]
| |
| * {{cite web |title= OEIS Index Rec|url=http://oeis.org/wiki/Index_to_OEIS:_Section_Rec}} [[OEIS]] index to a few thousand examples of linear recurrences, sorted by order (number of terms) and signature (vector of values of the constant coefficients)
| |
| | |
| [[Category:Algebra]]
| |
| [[Category:Recurrence relations| ]]
| |
| [[Category:Theory of computation]]
| |