SharedTA Sandbox / Hao's Sandbox / Mid2 / Midterm Review 2.ipynbOpen in CoCalc

## Eigen Values and Eigen Vectors ¶

### Question 1: How to find Eigenvalues and eigen vectors by hand?¶

M= $\begin{bmatrix}1&4\\2&3\end{bmatrix}$

#### What are eigenvalues and eigenvectors?¶

Special combination of a scalar: $\lambda$ and a vector $v$ that:

$MV = \lambda V$

#### How to find it by hand?¶

$MV = \lambda V \implies MV = \lambda \begin{bmatrix}1&0\\0&1\end{bmatrix}V$

$(M - \lambda I)V = 0 \implies \begin{bmatrix}1-\lambda&4\\2&3-\lambda\end{bmatrix}V = 0$

$(1-\lambda)(3-\lambda)-4\times 2 = 0 = \lambda^2-4\lambda-5 = 0$

$= (\lambda-5)(\lambda+1) =0\implies \lambda = 5 \text{ or } -1$ Find Eigen Values

#### Find Eigen vectors¶

Let $\lambda = 5$

$\begin{bmatrix}1-5&4\\2&3-5\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix} = 0 \implies \begin{bmatrix}-4&4\\2&-2\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix} = 0$

$\begin{cases}-4v_1+4v_2 = 0\\2v_1-2v_2 =0\end{cases}\implies v_1 = v_2$ Eigen vector is $k \in \mathbb{R}, \begin{bmatrix}k\\k\end{bmatrix}//\begin{bmatrix}1\\1\end{bmatrix}$

There is always "infinity solutions of eigen vectors!!! (But in the same direction)"

Let $\lambda = -1$

$\begin{bmatrix}1+1&4\\2&3+1\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix} = 0 \implies \begin{bmatrix}2&4\\2&4\end{bmatrix}\begin{bmatrix}v_1\\v_2\end{bmatrix} = 0$

$v_1 = 2k,v_2 = -k,\text{ or } v = \begin{bmatrix}2k\\-k\end{bmatrix} k\in \mathbb{R}//\begin{bmatrix}2\\-1\end{bmatrix}$

### Can we diagonalize the matrix?¶

Let $T = \begin{bmatrix}1&2\\1&-1\end{bmatrix}$

Find $T^{-1}$!!!

$\begin{bmatrix}1&2\\1&-1\end{bmatrix}\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}b_1\\b_2\end{bmatrix}\implies\begin{bmatrix}x_1+2x_2\\x_1-x_2\end{bmatrix}=\begin{bmatrix}b1\\b_2\end{bmatrix}$

First row + 2$\times$Second row( I want to cancel $x_2$): $3x_1 = b_1+2b_2 \implies x_1 = \frac{b_1+2b_2}{3}$

$\because x_1+2x_2=b_1 \implies \frac{b_1+2b_2}{3}+2x_2 = b_1 \implies 2x_2 = b_1 - \frac{b_1+2b_2}{3} = \frac{2b_1-2b_2}{3},x_2 = \frac{b_1-b_2}{3}$

$T^{-1} = \text{write this for me!!!}$

$T^{-1}MT = \begin{bmatrix}1/3&2/3\\1/3&-1/3\end{bmatrix}\begin{bmatrix}1&4\\2&3\end{bmatrix}\begin{bmatrix}1&2\\1&-1\end{bmatrix}$

$=\begin{bmatrix}1/3&2/3\\1/3&-1/3\end{bmatrix}\begin{bmatrix}5&-2\\5&1\end{bmatrix}$ $=\begin{bmatrix}\frac{15}{3}&\frac{-2+2}{3}\\\frac{5-5}{3}&\frac{-2-1}{3}\end{bmatrix}=\begin{bmatrix}5&0\\0&-1\end{bmatrix}$

### Quiz 1:¶

If we define $\begin{bmatrix}x_{1_{n+1}}\\x_{2_{n+1}}\end{bmatrix}= \begin{bmatrix}1&4\\2&3\end{bmatrix}\begin{bmatrix}x_{1_n}\\x_{2_n}\end{bmatrix}$

If we define $\begin{bmatrix}x_{1_0}\\x_{2_0}\end{bmatrix} = \begin{bmatrix}3\\5\end{bmatrix}$, what will $x_{1_n}$ be if $n\rightarrow \infty$

(a) 0

(b) infinity

(c) 3

### Quiz 2:¶

For $n = 10$, $x_1= 42317707$, what will $x_2$ be?

(a) 84635418

(b) 0

(c) 42317709

### Complex Numbers ¶

$i = \sqrt{-1}$

## What will happen if eigenvalues are complex numbers? (Why I say "eigenvalues are" not "eigenvalue is?")¶

### Quiz 3:¶

M = $\begin{bmatrix}1&3\\-1&4\end{bmatrix}$

eigenvalues are: $2.5000 \pm 0.8660i$

eigenvectors are: $\begin{bmatrix}0.8660\\0.4330 \pm 0.2500i\end{bmatrix}$

If we define $\begin{bmatrix}x_{1_{n+1}}\\x_{2_{n+1}}\end{bmatrix}= \begin{bmatrix}1&3\\-1&4\end{bmatrix}\begin{bmatrix}x_{1_n}\\x_{2_n}\end{bmatrix}$

What will happen if $n\rightarrow \infty$

(a)spiral out

(b)spiral in

(c)stable limit cycle

### Why?¶

(This will not be tested, but good to know)

Any complex number can be written as $a+bi = C(cos(\theta)+isin(\theta))$

$C = \sqrt{a^2+b^2}$ (Pythagorean theorem)

$(C(cos(\theta)+isin(\theta)))^2=C^2(cos^2(\theta)+i^2sin^2(\theta)+2icos(\theta)sin(\theta))=C^2(cos^2(\theta)-sin^2(\theta)+2icos(\theta)sin(\theta))$

$=C^2(cos(2\theta)+isin(2\theta))$

### Some Example Questions¶

#### Question 2:¶

The Siberian tiger is an endangered subspecies of tiger that inhabits forests in Siberia and northern China. Set up a discrete-time model for a Siberian tiger population based on the assumptions below. If your model is linear, write down its matrix. If not, explain why not.

• The population is divided into cubs (less than a year old), subadults (1–3 years old) and adults.
• On average, adults have 1.5 cubs per year.
• Bengal tiger cubs only remain cubs for one year. 52% of cubs die during this first year.
• On average, 63% of subadults survive as subadults from one year to the next.
• 10% of adults die each year

We define three state variables

Cubs: $C$, Subadults: $S$, and Adult: $A$

• On average, adults have 1.5 cubs per year.

$C_{n+1} = 1.5A_{n}$

• Bengal tiger cubs only remain cubs for one year. 52% of cubs die during this first year.

All cubs are not cubs the next year, and (100%-52%)= 48% of them become subadults. $S_{n+1}= 0.48C_n$

• On average, 63% of subadults survive as subadults from one year to the next.

$S_{n+1}=0.48C_n+0.63S_n$

$A_{n+1}= 0.2S_n$

• 10% of adults die each year

$A_{n+1}= 0.2S_n+0.9A_n$

$\begin{bmatrix}C_{n+1}\\S_{n+1}\\A_{n+1}\end{bmatrix} = \begin{bmatrix}0&0&1.5\\0.48&0.63&0\\0&0.2&0.9\end{bmatrix}\begin{bmatrix}C_n\\S_n\\A_n\end{bmatrix}$

#### Question 2:¶

The following discrete-time matrix model describes the population of alligators in Florida, where the population has been divided into three life stages: juveniles (J), early adults (E), and adults (A).

$\begin{bmatrix}J_{t+1}\\E_{t+1}\\A_{t+1}\end{bmatrix} = \begin{bmatrix}0.6&0.45&0.68\\0.21&0.4&0\\0&0.09&0.84\end{bmatrix}\begin{bmatrix}J_t\\E_t\\A_t\end{bmatrix}$

• The eigenvalues of the matrix in this model are 0.67, 0.96, and 0.21. Regardless of the initial state, what will happen to the alligator population in the long run? (Be as specific as possible.)
• Find the dominant eigenvector of this model

$\begin{bmatrix}0.6&0.45&0.68\\0.21&0.4&0\\0&0.09&0.84\end{bmatrix}-\begin{bmatrix}0.96&0&0\\0&0.96&0\\0&0&0.96\end{bmatrix}$

= $\begin{bmatrix} -0.3600&0.4500&0.6800\\ 0.2100&-0.5600& 0\\ 0& 0.0900& -0.1200\end{bmatrix}$

$0.21x_1-0.56x_2 =0 \implies 3x_1-8x_2 = 0$

$0.09x_2-0.12x_3 = 0 \implies 3x_2 - 4x_3 =0$

$x_1 = 32, x_2 = 12, x_3 = 9$ will solve.

eigenvector is $\begin{bmatrix}32\\12\\9\end{bmatrix}$