[学习笔记] 二阶常系数线性齐次递推式的通项公式

  • 参考 liuzibujian的博客。

问题

  • 给出递推式 f n = a f n − 1 + b f n − 2 f_n = a f_{n - 1} + b f_{n - 2} fn=afn1+bfn2,已知 f 0 , f 1 f_0, f_1 f0,f1,求 f n f_n fn 的通项公式。

结论

  • x 1 , x 2 x_1, x_2 x1,x2 为方程 x 2 − a x − b = 0 x^2 - ax - b = 0 x2axb=0 的两根(可以为复数)。
    • x 1 ≠ x 2 x_1 \neq x_2 x1=x2 f n = A x 1 n + B x 2 n f_n = Ax_1^n + Bx_2^n fn=Ax1n+Bx2n
    • x 1 = x 2 x_1 = x_2 x1=x2 f n = ( A + B n ) x 1 n f_n = (A + Bn)x_1^n fn=(A+Bn)x1n
  • 其中 A , B A,B A,B 可以根据 f 0 , f 1 f_0, f_1 f0,f1 列方程组解出。

证明

  • 由于博主的水平原因只能先这么写了
  • 尝试把递推式表示成等比数列的形式:
    f n − x 1 f n − 1 = x 2 ( f n − 1 − x 1 f n − 2 ) f n = ( x 1 + x 2 ) f n − 1 − x 1 x 2 f n − 2 \begin{aligned} f_n - x_1 f_{n - 1} &= x_2(f_{n - 1} - x_1f_{n-2})\\ f_n &= (x_1 + x_2) f_{n - 1} - x_1x_2 f_{n - 2} \\ \end{aligned} fnx1fn1fn=x2(fn1x1fn2)=(x1+x2)fn1x1x2fn2
  • 可以列出一个方程组:
    { x 1 + x 2 = a x 1 x 2 = − b \begin{cases} x_1 + x_2 = a\\ x_1 x_2 = -b\\ \end{cases} {x1+x2=ax1x2=b
  • 由韦达定理得, x 1 , x 2 x_1,x_2 x1,x2 是方程 x 2 − a x − b = 0 x^2 - ax - b = 0 x2axb=0 的两根。
  • c = f 1 − x 1 f 0 c = f_1 - x_1f_0 c=f1x1f0,可列出 n n n 个方程:
    { f 1 − x 1 f 0 = c f 2 − x 1 f 1 = c x 2 f 3 − x 1 f 2 = c x 2 2 … f n − x 1 f n − 1 = c x 2 n − 1 \begin{cases} f_1 - x_1 f_0 &= c \\ f_2 - x_1 f_1 &= c x_2 \\ f_3 - x_1 f_2 &= c x_2^2 \\ &…\\ f_n - x_1 f_{n - 1} &= c x_2 ^{n - 1} \\ \end{cases} f1x1f0f2x1f1f3x1f2fnx1fn1=c=cx2=cx22=cx2n1
  • 将第 i i i 个方程乘上 x 1 n − i x_1^{n - i} x1ni,然后将所有方程相加,得到:
    f n − x 1 n f 0 = c x 1 n − 1 ∑ i = 0 n − 1 ( x 2 x 1 ) i \begin{aligned} f_n - x_1^n f_0 = cx_1^{n - 1} \sum \limits_{i = 0}^{n - 1}\left(\frac{x_2}{x_1}\right)^{i}\\ \end{aligned} fnx1nf0=cx1n1i=0n1(x1x2)i
  • x 1 = x 2 x_1 = x_2 x1=x2
    f n − x 1 n f 0 = c n x 1 n − 1 f n = c n x 1 n − 1 + x 1 n f 0 f n = ( f 0 + c x 1 n ) x 1 n \begin{aligned} f_n - x_1^n f_0 &= cnx_1^{n - 1}\\ f_n &= cnx_1^{n - 1} + x_1^nf_0\\ f_n &= \left(f_0 + \frac{c}{x_1} n \right) x_1^n \\ \end{aligned} fnx1nf0fnfn=cnx1n1=cnx1n1+x1nf0=(f0+x1cn)x1n
  • 此时 A = f 0 , B = c x 1 A = f_0, B = \frac{c}{x_1} A=f0,B=x1c
  • x 1 ≠ x 2 x_1 \neq x_2 x1=x2,由等比数列求和得
    f n − x 1 n f 0 = c x 1 n − 1 ( x 2 x 1 ) n − 1 x 2 x 1 − 1 f n = c x 2 n − x 1 n x 2 − x 1 + x 1 n f 0 f n = ( f 0 − c x 2 − x 1 ) x 1 n + c x 2 − x 1 x 2 n \begin{aligned} f_n - x_1^n f_0 &= cx_1^{n - 1} \frac{\left( \frac{x_2}{x_1}\right)^{n} - 1}{\frac{x_2}{x_1} - 1}\\ f_n &= c \frac{x_2^n - x_1^n}{x_2 - x_1} + x_1^n f_0 \\ f_n &= \left(f_0 - \frac{c}{x_2 - x_1} \right)x_1^n + \frac{c}{x_2 - x_1}x_2^n\\ \end{aligned} fnx1nf0fnfn=cx1n1x1x21(x1x2)n1=cx2x1x2nx1n+x1nf0=(f0x2x1c)x1n+x2x1cx2n
  • 此时 A = f 0 − c x 2 − x 1 , B = c x 2 − x 1 A = f_0 - \frac{c}{x_2 - x_1}, B = \frac{c}{x_2 - x_1} A=f0x2x1c,B=x2x1c
  • 证毕。

你可能感兴趣的:(学习笔记,线性代数)