Linear Recurrences

Chapter 3 • Section 3-4

"Predicting the future, one step at a time. 🔮"

🐇 The Fibonacci Sequence

0, 1, 1, 2, 3, 5, 8, 13, 21, ...

Each number is the sum of the previous two:

$$ F_{k+2} = F_{k+1} + F_k $$

Generate Sequence

0 1

The Matrix Trick

Turning it into a System

We can write the recurrence as a matrix equation $\vec{v}_{k+1} = A \vec{v}_k$:

$$ \begin{bmatrix} F_{k+2} \\ F_{k+1} \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \begin{bmatrix} F_{k+1} \\ F_k \end{bmatrix} $$

Now we can use powers of $A$ to find any term!

Binet's Formula

Using eigenvalues $\lambda = \frac{1 \pm \sqrt{5}}{2}$:

$$ F_k = \frac{1}{\sqrt{5}} \left( \left(\frac{1+\sqrt{5}}{2}\right)^k - \left(\frac{1-\sqrt{5}}{2}\right)^k \right) $$

Derived from $A = PDP^{-1}$!

Example: Solving $x_{k+2} = 5x_{k+1} - 6x_k$

Initial values: $x_0=0, x_1=1$.

  1. Matrix: $A = \begin{bmatrix} 0 & 1 \\ -6 & 5 \end{bmatrix}$.
  2. Eigenvalues: $\lambda^2 - 5\lambda + 6 = 0 \implies (\lambda-2)(\lambda-3)=0$. So $\lambda_1=2, \lambda_2=3$.
  3. Eigenvectors: $\vec{v}_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \vec{v}_2 = \begin{bmatrix} 1 \\ 3 \end{bmatrix}$.
  4. General Solution: $\vec{v}_k = c_1 2^k \vec{v}_1 + c_2 3^k \vec{v}_2$.
  5. Solve for Constants: At $k=0$, $\begin{bmatrix} 0 \\ 1 \end{bmatrix} = c_1 \begin{bmatrix} 1 \\ 2 \end{bmatrix} + c_2 \begin{bmatrix} 1 \\ 3 \end{bmatrix}$. Solution: $c_1=-1, c_2=1$.
  6. Final Formula: $x_k = 3^k - 2^k$.

🧠 Matrix Setup Win $10

For the recurrence $x_{k+1} = 3x_k - 2y_k$ and $y_{k+1} = x_k + y_k$, what is the matrix $A$?

Dynamical Systems

Attractors

If all $|\lambda| < 1$, the system goes to $\vec{0}$.

The origin is a "sink".

Repellers

If all $|\lambda| > 1$, the system explodes away.

The origin is a "source".

Saddle Points

If some $|\lambda| > 1$ and some $|\lambda| < 1$.

🤔 Long Term Behavior Win $20

If eigenvalues are $0.5$ and $0.8$, what happens to $\vec{v}_k$ as $k \to \infty$?