0:00 / 0:00

Linear Dynamical Systems and Recurrence Relations

A linear dynamical system in two variables is given by:
{xn+1=axn+bynyn+1=cxn+dyn\left\{ \begin{array}{l} x_{n+1}=\colorOne a x_n+ \colorOne b y_n\\ y_{n+1}=\colorOne cx_n+ \colorOne d y_n \end{array} \right.
Letting vn=[xnyn]\vec v_n=\begin{bmatrix} x_n\\ y_n \end{bmatrix} and A=[abcd]A=\begin{bmatrix} \colorOne a& \colorOne b\\ \colorOne c& \colorOne d \end{bmatrix}, the system can be expressed in matrix form as:
vn+1=Avn\boxed{\quad \vec{v}_{n+1}=A\vec{v}_n \quad}
Notice the pattern as we find each successive state vector:
v1=Av0v2=Av1=A(Av0)=A2v0v3=Av2=A(A2v0)=A3v0vn=Avn1=A(An1v0)=Anv0\begin{array}{llllllll} \vec v_1 &=& A\vec v_0\\[0.5em] \vec v_2 &=& A\vec v_1 &=& A(A\vec v_0) &=& A^2 \vec v_0\\[0.5em] \vec v_3 &=& A\vec v_2 &=& A(A^2\vec v_0) &=& A^3 \vec v_0\\[0.5em] \vdots\\[0.5em] \colorTwo{\bm{\vec v_n }}&=& A\vec v_{n-1} &=& A(A^{n-1}\vec v_0) &=& \colorTwo{\bm{A^n \vec v_0}}\\[0.5em] \end{array}
Therefore, we can always find vn\vec v_n by calculating:
vn=Anv0or:   vn=PDnP1v0\boxed{\quad \begin{aligned} \vec v_n &= \colorOne{A^n}\vec v_0\\[0.5em] \text{or:}\ \ \ \vec v_n &= \colorOne{PD^nP^{-1}}\vec v_0 \end{aligned} \quad}

PAGE BREAK
Steps
Here is how we will find a solution vn\vec v_nto the dynamical system vn+1=Avn\vec v_{n+1}=A\vec v_n given initial conditions x0x_0 and y0y_0:
  1. Diagonalize AA by finding PP and DD such that D=P1APD = P^{-1}AP.
  2. Use the matrix power formula: An=PDnP1A^n=PD^nP^{−1}.
  3. Simplify the expression vn=Anv0\vec v_n=A^n \vec v_0 , where v0=[x0y0]\vec v_0= \begin{bmatrix} x_0 \\ y_0 \end{bmatrix}.
PAGE BREAK

Recurrence Relations

A recurrence relation defines elements of a sequence based on previous elements:
xn+2=cxn+dxn+1,x0=a,  x1=b\colorTwo{x_{n+2} = c x_n + d x_{n+1}}, \quad \colorFive{x_0=a,\ \ x_1=b}
We can treat recurrence relations of this form as linear dynamical systems by setting yn=xn+1\boxed{\colorOne{y_n=x_{n+1}}}.
Note: The initial condition can be written as:
v0=[x0y0]=[x0x1]=[ab]\colorFive{\vec v_0 } = \begin{bmatrix} x_{0}\\ \colorOne{y_{0}}\\ \end{bmatrix} = \begin{bmatrix} x_{0}\\ \colorOne{x_{1}}\\ \end{bmatrix} = \begin{bmatrix} \colorFive a\\ \colorFive b\\ \end{bmatrix}
Wize Tip
To set up a dynamical system, start by writing {xn+1=yn+1=\left\{ \begin{array}{l} x_{n+1}= \dots\\ y_{n+1}= \dots \end{array} \right. and go from there!

{xn+1=ynyn+1=xn+2    {xn+1=0xn+1ynyn+1=cxn+dxn+1    {xn+1=0xn+1ynyn+1=cxn+dyn    [xn+1yn+1]vn+1=[01cd]A[xnyn]vn\begin{aligned} & \left\{ \begin{array}{l} \colorOne{x_{n+1} = y_n}\\ y_{n+1}= \colorTwo{x_{n+2}} \end{array} \right.\\[2em] \quad \implies \quad &\left\{ \begin{array}{l} x_{n+1} = 0x_n + 1y_n\\ y_{n+1} = \colorTwo{c x_n + d x_{n+1}} \end{array} \right.\\[2em] \quad \implies \quad &\left\{ \begin{array}{l} x_{n+1} = 0x_n + 1y_n\\ y_{n+1} = \colorTwo{c x_n + d}\colorOne{y_n} \end{array} \right.\\[2em] \quad \implies \quad &\underbrace{ \begin{bmatrix} x_{n+1}\\ y_{n+1}\\ \end{bmatrix}}_{\normalsize \vec v_{n+1}} = \underbrace{ \begin{bmatrix} 0 & 1\\ c & d \end{bmatrix}}_{\normalsize A} \underbrace{ \begin{bmatrix} x_{n}\\ y_{n}\\ \end{bmatrix}}_{\normalsize \vec v_{n}} \end{aligned}
PAGE BREAK
Example
Rewrite the following recurrence relation as a linear dynamical system:
xn+2=2xn+1+xn,x0=2,  x1=3{x_{n+2} = -2x_{n+1} + x_n}, \quad x_0 = 2, \ \ x_1=3
Let yn=xn+1y_n = x_{n+1}. Then {xn+1=yn=0xn+1yn=0xn+1ynyn+1=xn+2=1xn2xn+1=1xn2yn    A=[0112]\left\{ \begin{array}{lcrclcl} x_{n+1} &=& y_n &=& 0x_n + 1 y_n &=& 0x_n + 1 y_n\\[0.5em] y_{n+1} &=& x_{n+2} &=& 1 x_n -2 x_{n+1} &=& 1 x_n -2 y_n \end{array} \right. \quad\implies\quad A= \begin{bmatrix} 0 & 1\\ 1 & -2 \end{bmatrix}.
The initial condition is v0=[x0y0]=[x0x1]=[23]\vec v_0 = \begin{bmatrix} x_{0}\\ y_{0}\\ \end{bmatrix} = \begin{bmatrix} x_{0}\\ x_1\\ \end{bmatrix} = \begin{bmatrix} 2\\ 3\\ \end{bmatrix}.
Putting it all together, we obtain the matrix equation vn=Anv0\vec v_{n} = A^n \vec v_0.
Now we can solve this linear dynamical system using the same steps as before!
0:00 / 0:00

Example: Linear Dynamical Systems

Consider the linear dynamical system given by
xn+1=2xn+ynyn+1=xn+2yn\begin{array}{l}x_{n+1}=2x_n+y_n\\y_{n+1}=x_n+2y_n\end{array}
with initial conditions x0=1x_0 = 1, y0=2y_0 = 2. Find solutions to this system for general nn and for n=3n = 3.
The matrix representing this system is A=[2112]A=\begin{bmatrix}2 & 1\\1 & 2\end{bmatrix}.
Writing vn=[xnyn]\vec v_n = \begin{bmatrix} x_n\\ y_n\\ \end{bmatrix} , we have the system vn+1=Avn\vec v_{n+1} = A \vec v_n with initial condition v0=[12]\vec v_0 = \begin{bmatrix} 1\\ 2\\ \end{bmatrix} .
In order to find the eigenvalues of AA, we solve the following equation:
0=det(λIA)=det[λ211λ2]=(λ2)2(1)2=λ24λ+41=λ24λ+3=(λ1)(λ3)\begin{aligned} 0={\rm det}(\lambda I-A)={\rm det}\begin{bmatrix}\lambda-2&-1\\-1&\lambda-2\end{bmatrix} &=(\lambda-2)^2-(-1)^ 2\\[0.5em] &=\lambda^2-4\lambda+4-1\\[0.5em] &=\lambda^2-4\lambda+3\\[0.5em] &=(\lambda-1)(\lambda-3) \end{aligned}
Then the eigenvalues are λ1=1\lambda_1 = 1 and λ2=3\lambda_2=3, giving D=[λ100λ2]=[1003]D=\begin{bmatrix} \colorOne{\lambda_1} & 0\\0 & \colorTwo{\lambda_2}\end{bmatrix} = \begin{bmatrix} \colorOne1 & 0\\ 0 & \colorTwo 3 \end{bmatrix}.
Now let's find the corresponding eigenvectors.
For λ1=1\colorOne{\lambda_1 = 1}, we need to solve the homogeneous equation (IA)X=0(I - A)X=0:
[1111]R2R1R2[1100]\left[\begin{array}{rr} -1&-1\\ -1&-1 \end{array}\right] \underrightarrow{R_2-R_1\to R_2} \left[\begin{array}{rr} -1&-1\\ 0&0 \end{array}\right]
From here it is clear that the solution is any vector of the form [tt]=t[11]\begin{bmatrix}-t\\t\end{bmatrix}=t\begin{bmatrix}-1\\1\end{bmatrix}.
This gives the basic eigenvector for λ1=1\colorOne{\lambda_1 = 1} as x1=[11]\colorOne{ \vec x_1 = \begin{bmatrix} -1\\ 1 \end{bmatrix} }.
For λ2=3\colorTwo{\lambda_2 = 3}, we need to solve the homogeneous equation (3IA)X=0(3I - A)X=0:
[1111]R2+R1R2[1100]\left[\begin{array}{rr} 1&-1\\ -1&1 \end{array}\right] \underrightarrow{R_2+R_1\to R_2} \left[\begin{array}{rr} 1&-1\\ 0&0 \end{array}\right]
From here it is clear that the solution is any vector of the form [tt]=t[11]\begin{bmatrix}t\\t\end{bmatrix}=t\begin{bmatrix}1\\1\end{bmatrix}.
This gives the basic eigenvector for λ2=3\colorTwo{\lambda_2 = 3} as x2=[11]\colorTwo{\vec x_2 = \begin{bmatrix} 1\\ 1 \end{bmatrix}}.
Then the matrix PP is given by P=[x1x2]=[1111]P=\begin{bmatrix} \colorOne{\vec x_1}& \colorTwo{\vec x_2} \end{bmatrix} = \begin{bmatrix} \colorOne{-1}&\colorTwo 1\\ \colorOne 1&\colorTwo 1 \end{bmatrix}.
Now we can compute P1=12[1111]=12[1111]P^{-1} =-\dfrac{1}{2}\begin{bmatrix}1&-1\\-1&-1\end{bmatrix} =\dfrac{1}{2}\begin{bmatrix}-1&1\\1&1\end{bmatrix}.
Recalling that the initial condition is v0=[12]\vec v_0 = \begin{bmatrix} 1\\ 2 \end{bmatrix} , we can write the formula vn=Anv0\vec v_n = A^n \vec v_0:
vn=PDnP1v0[xnyn]=[1111][1003]n12[1111][12]=[1111][1003n]12[1111][12]=  [13n13n]12[1111][12]=12[1+3n1+3n1+3n1+3n][12]=12[1+33n1+33n]=12[1+3n+11+3n+1]\begin{array}{ccl} \vec v_n &=& PD^nP^{-1} \vec v_0 \\[0.5em] \begin{bmatrix}x_n\\y_n\end{bmatrix} &=& \begin{bmatrix}-1&1\\1&1\end{bmatrix} \begin{bmatrix}1 & 0\\0 & 3\end{bmatrix}^n \dfrac{1}{2} \begin{bmatrix}-1&1\\1&1\end{bmatrix} \begin{bmatrix}1\\2\end{bmatrix}\\[1.8em] &=& \underbrace{ \begin{bmatrix}-1&1\\1&1\end{bmatrix} \begin{bmatrix}1 & 0\\0 & 3^n\end{bmatrix}} \dfrac{1}{2}\begin{bmatrix}-1&1\\1&1\end{bmatrix} \begin{bmatrix}1\\2\end{bmatrix}\\[1.8em] &=& \quad\ \ \begin{bmatrix}-1&3^n\\1&3^n\end{bmatrix} \dfrac{1}{2}\begin{bmatrix}-1&1\\1&1\end{bmatrix} \begin{bmatrix}1\\2\end{bmatrix}\\[1.8em] &=& \dfrac{1}{2} \begin{bmatrix}1+3^n&-1+3^n\\-1+3^n&1+3^n\end{bmatrix} \begin{bmatrix}1\\2\end{bmatrix}\\[1.8em] &=& \dfrac{1}{2} \begin{bmatrix} -1+3\cdot3^{n}\\ 1+3\cdot3^{n} \end{bmatrix}\\[1.8em] &=& \boxed{ \dfrac{1}{2} \begin{bmatrix}-1+3^{n+1}\\1+3^{n+1}\end{bmatrix}} \end{array}
For n=4n = 4 specifically, we have the solution:
[x4y4]=12[1+811+81]=[4041]\begin{bmatrix}x_4\\y_4\end{bmatrix} =\dfrac{1}{2} \begin{bmatrix} -1+81\\ 1+81 \end{bmatrix} = \boxed{ \begin{bmatrix} 40\\ 41 \end{bmatrix}}

Practice: Recurrence Relations

Suppose a sequence is defined rescursively as:
xn+2=4xn,x0=1,  x1=4x_{n+2} = 4x_n, \quad x_0 =1,\ \ x_1 =4
Compute x20x_{20} by converting the recurrence to a linear dynamical system.
Extra Practice