若說遞迴關係、差分方程在計算機演算法分析上的重要性容易明白 ,要講它撐起了數學半邊天,怕是匪夷所思︰
義大利的數學家朱塞佩‧皮亞諾 Giuseppe Peano 提出『自然數』之五條公設的系統。用著『未定義』的『基元』數『零 』,以及『後繼數』successor 的概念,打造了一階算術系統,現今稱之為『皮亞諾算術系統』︰
一、 是自然數。
二、 如果 是自然數,則 的後繼數也是自然數。
三、 不是任何自然數的後繼數。
四、 如果兩個自然數的後繼數相等,則這兩個自然數相等。
五、 任何關於自然數的命題,假使證明了這個命題對於自然數 是真的,如果它對自然數 為真時,又可以證明它對 後繼數也真,那麼這個命題對所有的自然數都是真的── 數學歸納法 ──。
於是可以將皮亞諾算術表達成︰此處 代表某數之後繼數
,就是數學歸納法
─── 摘自《λ 運算︰計物數《上》》
這個自然數的集合 可用 遞迴關係給出。若問 ,顯然的 。難到能不是 的嗎?要說因為它的非『均質』 homogeneous 性,故無法直接應用『特徵多項式』 法求取,豈不叫人驚訝!
※ 註︰ 無法化簡問題也。
苟知其理︰
Recurrence relation
In mathematics, a recurrence relation is an equation that recursively defines a sequence or multidimensional array of values, once one or more initial terms are given: each further term of the sequence or array 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.
……
Solving
Solving homogeneous linear recurrence relations with constant coefficients
Roots of the characteristic polynomial
An order-d homogeneous linear recurrence with constant coefficients is an equation of the form
where the d coefficients ci (for all i) are constants.
A constant-recursive sequence is a sequence satisfying a recurrence of this form. There are d degrees of freedom for solutions to this recurrence, i.e., the initial values can be taken to be any values but then the 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 r1, r2, … are all distinct, then each solution to the recurrence takes the form
where the coefficients ki 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
As well as the Fibonacci numbers, other constant-recursive sequences include the Lucas numbers and Lucas sequences, the Jacobsthal numbers, the Pell numbers and more generally the solutions to Pell’s equation.
For order 1, the recurrence
has the solution an = rn with a0 = 1 and the most general solution is an = krn with a0 = 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 an = rn 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.
……
Solving non-homogeneous linear recurrence relations with constant coefficients
If the recurrence is non-homogeneous, 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 non-homogeneous recurrence is the method of symbolic differentiation. For example, consider the following recurrence:
This is an non-homogeneous recurrence. If we substitute n ↦ n+1, 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 non-homogeneous recurrence can be reduced to a homogeneous recurrence by applying the method of symbolic differencing r times.
If
is the generating function of the inhomogeneity, the generating function
of the non-homogeneous recurrence
with constant coefficients ci is derived from
If P(x) is a rational generating function, A(x) is also one. The case discussed above, where pn = K is a constant, emerges as one example of this formula, with P(x) = K/(1−x). Another example, the recurrence } with linear inhomogeneity, arises in the definition of the schizophrenic numbers. The solution of homogeneous recurrences is incorporated as p = P = 0.
且善其工︰
pi@raspberrypi:~ a_{n+2} - a_{n+1} = a_{n+1} -a_nr^2 - 2 r + 1 = 0 = {(r - 1)}^2 a_n = k_1 \cdot 1^n + k_2 \cdot n \cdot 1^n = k_1 + k_2 \cdot n a_{n+1} = a_n + 1 , \ a_0 = 0k_1 + k_2 (n + 1) = k_1 + k_2 \cdot n + 1k_2 = 1a_n = k_1 + na_0 = k_1 + 0 = 0\therefore a_n = nA(x) = \sum_{n=0}^{\infty} a_n x^na_{n+1} = a_n + 1 , \ a_0 = 0\longrightarrow a_{n+1} \cdot x^n = a_n \cdot x^n + 1 \cdot x^n\longrightarrow \sum_{n=0}^{\infty} a_{n+1} x^n = \sum_{n=0}^{\infty} a_n x^n + \sum_{n=0}^{\infty} x^n \longrightarrow \frac{A(x)}{x} = A(x) + \frac{1}{1 - x}\longrightarrow A(x) = \frac{x}{{1-x}^2}\therefore a_n = [n] A(x) = [n] \frac{x}{{1-x}^2} = [n - 1] \frac{1}{{1-x}^2} = n $ 。※ 註︰
太自然反倒費疑猜的哩☆