Fibonacci matrix for different constant values in recurrence relation

179 Views Asked by At

For Fibonacci series we have a recurrence relation $F_n=F_{n-1}+F_{n-2}$.So the initial matrix can be written as $$A=\begin{bmatrix} 1 &1\\ 1 &0 \\ \end{bmatrix}$$ where $a_{11}=F_{n+1}, a_{21}$ and $a_{12}$ are $F_n$ and $a_{22}=F_{n-1}$ We can calculate $n$th Fibonacci by raising this matrix to the power of $n$.

What if the recurrence relation is $F_n=F_{n-1}+4F_{n-2}$ What will the matrix be?

I have a fibonacci recurrence relation as the following: $$F_n= \frac{1}{\sqrt{17}} \bigg(\left(\frac{1+\sqrt{17}}{2}\right)^n - \left(\frac{1-\sqrt{17}}{2}\right)^n\bigg)$$

2

There are 2 best solutions below

1
On

If $x_{n+2}=ax_{n+1}+bx_n$ just put $[a,b]$ as row $1$ and $[1,0]$ as row $2$ for the update. You'll have to take a power of this times a fixed column vector giving the initial values (first value on top of column vector).

Correction (I think): If first two terms are different, I now think first term goes on bottom of initial value column vector, second term on top. Experiment-- try it both ways to make sure which is right.

0
On

These two pictures gives a fair idea on how to create T matric and solve any recurrence relation using matrix exponentiation:

https://ibb.co/k98WdxR

https://ibb.co/9sJLNwX