--- tags: Linear Algebra - HungYiLee --- Linear Algebra - Lec 25~28: Eigenvalue & Eigenvector, Diagonalization, PageRank === [TOC] # [課程網站](http://speech.ee.ntu.edu.tw/~tlkagk/courses_LA18.html) # [Lecture 25: Eigenvalues and Eigenvectors](https://www.youtube.com/watch?v=1RyHRIP8QGg&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=25) - learn how to find a "good" coordinate system (to make the function easier) ## Outline - What is Eigenvalue and Eigenvector? - Eigen (German word): "**unique to**" or "belonging to" - How to find eigenvectors (given eigenvalues)? - Check whether a scalar is an eigenvalue - How to find all eigenvalues? ## Definition of Eigenvalues & Eigenvectors ![](https://i.imgur.com/IWDotwO.png) 注意 - $A$ 必須是 square matrix - zero-vector **不是一個 eigenvector** ### Example: Shear Transform ![](https://i.imgur.com/YNveyfC.png) $\begin{bmatrix}x'\\y'\end{bmatrix}=T(\begin{bmatrix}x\\y\end{bmatrix})=\begin{bmatrix}x+my\\y\end{bmatrix}$ - x 軸的方向,就是這個 transform $T$ 的 eigenvector,而 eigenvalue 就是 1 ### Example: Reflection ![](https://i.imgur.com/LxmHH3G.png) - $b_1$ 的方向是 $T(\cdot)$ 的 eigenvector,他的 eigenvalue 是 $1$ - $b_2$ 的方向也是 $T(\cdot)$ 的 eigenvector,他的 eigevalue 是 $-1$ ### Example: Expansion & Compression ![](https://i.imgur.com/HGZOVjK.png) - 任何 vector 都是 eigenvector,而 eigenvalue 是縮放的比例 ### Some matrices don't have eigenvector - 例如 rotation,因為沒有一個 vector 在旋轉後會變成自己的 k 倍 (zero-vector 不算) - 其實在 complex (複數) domain 有 eigenvector,影片 51:14 ## How to find eigenvectors (given eigenvalues) - An eigenvector of $A$ corresponds to a **unique eigenvalue**. - An eigenvalue of $A$ has **infinitely many eigenvectors**. - Do the eigenvectors correspond to the same eigenvalue form a subspace? - No, 但是只要把 **zero-vector** 加進去這個集合,就是 subspace 了 ## Eigenspace - 同一個 eigenvalue $\lambda$ 對應的 eigenvector 所形成的集合,就是 **$(A-\lambda I_n)v=0$ 的 non-zero solution set** - 而 **eigenspace** 是上面那個集合**再加上 zero vector** = = 囧 - 所以 ***eigenspace 就是 subspace 了吧?*** ![](https://i.imgur.com/4tKIapr.png) ## Check whether a scalar is an eigenvalue - 若 $\dim(Null(A-\lambda I_n))=0$,則不是 eigenvalue ![](https://i.imgur.com/xL2cQj6.png) ### Example ![](https://i.imgur.com/zdOYNKt.png) ![](https://i.imgur.com/HTFw8Zi.png) - ***好像只要 $A-\lambda I_n$ 是 non-invertible,$\lambda$ 就是 eigenvalue??*** ## Looking for Eigenvalues (找出所有 Eigenvalues) - 解出 $\det(A-\lambda I_n)=0$ 所有可能的 $\lambda$ 即可 - 補充: - 解出的所有 eigenvalue 乘起來會是 $\det(A)$ - 解出的所有 eigenvalue 加起來會是 $trace(A)$ - $trace(A)$ 就是 $A$ 對角線所有值的和 ![](https://i.imgur.com/Nq9zmMu.png) ### Example 1 ![](https://i.imgur.com/aDglNAV.png) ### Example 2 ![](https://i.imgur.com/vn5Lq2V.png) ### Example 3 ![](https://i.imgur.com/nXbj8YJ.png) - 解 $t^2+1=0$ - 本題較特別,沒有實數 eigenvalue;**但有複數/虛數 eigenvalue** ## Characteristic Polynomial & Characteristic Equation ![](https://i.imgur.com/cJvGHcr.png) ### Properties - 在本章幾乎沒提到 RREF,因為 $A$ 和 $RREF(A)$ 並沒有相同的 characteristic polynomial,因此 eigenvalue 或 eigenvector 也不同 - similar 的兩個 matrix 有相同的 characteristic polynomials => 有同樣的 **eigenvalue** (不是 eigenvector!!) - 這其實很直觀,因為兩個 matrix 只是從不同 viewpoint 看同一個 transform - proof: assume $B=P^{-1}AP$ - $\det(B-tI)\\=\det(P^{-1}AP-P^{-1}(tI)P)\\=\det(P^{-1}(A-tI)P)\\=\det(P^{-1})\det(A-tI)\det(P)\\=\dfrac{1}{\det(P)}\det(A-tI)\det(P)\\=\det(A-tI)$ - 故得證 #### Q&A - 解 $\det(A-tI_n)=0$ 其實就是在解 $t$ 的 $n$ 次多項式 - 因此 $A$ 的 eigenvalue 會小於等於 $n$ 個 ## Characteristic Polynomial v.s. Eigenspace 可以對 $\det(A-\lambda I_n)$ 做 factorization (因式分解) - **eigenspace 的 dimension 一定小於等於 multiplicity** - 補充:後面會提到,eigenspace 的 dimension 要等於 multiplicity,才可以被 diagonalize (對角化) ![](https://i.imgur.com/DqBeyPV.png) ### Eigenvalues of upper triangular matrix - upper triangular matrix 的 eigenvalues 就是它的對角線 - review: upper-triangular matrix 或 lower-triangular matrix 的 determinant 就是對角線相乘 ![](https://i.imgur.com/QHUarGE.png) ## Summary ![](https://i.imgur.com/qMCZIqs.png) # [Lecture 26: Diagonalization](https://www.youtube.com/watch?v=TsB5_BiMFoo&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=26) - 可對角化,也代表 $A$ 和 diagonal matrix $D$ 是 similar 的 - review: similar 代表兩個 matrix 是從不同的 coordinate system 看待同一個 transform ## Diagonalizable - $A$ is called **diagonalizable** if $A=PDP^{-1}$ - $A\in\mathbb R^{n\times n}$ - $D\in\mathbb R^{n\times n}$ **diagonal** matrix - $P\in\mathbb R^{n\times n}$ **invertible** matrix - 要證明某個 matrix $A$ 不能被對角化,就先假設他可以被對角化,然後用反證法找出矛盾。 ### Diagonalizable v.s. Eigenvalue & Eigenvector $A,P,D$ 之間的關係 - $d_i$ 是 $A$ 的 eigenvalue,而 $d_i$ 對應的 eigenvector 是 $p_i$ - $P=[p_1\,p_2\,...\,p_n]$ - $D=[d_1e_1\,d_2e_2\,...\,d_ne_n]$ ![](https://i.imgur.com/fCxDJXn.png) ### Diagonalizable v.s. Basis - **若 $A$ 是 diagonalizable,則 $A$ 的 eigenvectors 可以形成 $\mathbb R^n$ 的 basis** ![](https://i.imgur.com/KkCQLH0.png) ### How to diagonalize a matrix? 根據上述: 1. 找到這個 matrix $A$ 的 $n$ 個 independent 的 eigenvectors 2. 那就找到了 $P$ 3. 找到 $P$ 就可以找到 $D$ ### How to find independent eigenvectors? - **只要 eigenvector 對應的 eigenvalue 是不同的,那他們就 independent** - 注意:**即使 eigenvalue 的數量小於 $n$,也有可能找到 $n$ 個 linear independent 的 eigenvector** ![](https://i.imgur.com/KHPj4Wr.png) #### Proof: 不同的 eigenvalue 對應到的 eigenvector 一定是 independent 的 - 先假設他們是 dependent 的,但會造成矛盾,反證結案 ![](https://i.imgur.com/boCGvWR.png) - 只要找得到 $n$ 個 independent 的 eigenvector,那 $A$ 就是 diagonalizable 的;反之則否 - 你沒辦法找到大於 $n$ 個 independent 的 eigenvector ![](https://i.imgur.com/hTUDHPK.png) ### Example ![](https://i.imgur.com/HWnPCDO.png) ## Application of Diagonalization - Markov Chain - **Markov Chain** 需要把 (transition) matrix 連乘 m 次,非常麻煩,因此需要 diagonalization 來幫助我們做計算 ![](https://i.imgur.com/JmkUfXP.png) ![](https://i.imgur.com/axgj2YW.png) 1. 先把 $A$ 做 diagonalization (對角化) ![](https://i.imgur.com/3ZR2o3e.png) 2. 再把 $A$ 連乘 m 次 ![](https://i.imgur.com/X0nMCu3.png) - 會發現無論 initial condition 是在做什麼,最後的機率都會一樣 # [Lecture 27: Diagonalization for Linear Transformation](https://www.youtube.com/watch?v=L7Y8wB3xzEc&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=27) ## Review?: Test for a Diagonalizable Matrix ![](https://i.imgur.com/wQ7XTcv.png) $A$ 是 diagonalizable iff 1. characteristic equation $\det(A-tI_n)=0$ 有 $n$ 個實根 2. 且每個 eigenvalue $\lambda$ 對應的 multiplicity 必須等於 eigenspace 的 dimension ![](https://i.imgur.com/EYeecYI.png) ## Review: Diagonalization of Linear Operator 就先把 linear operator 轉換成 matrix $A$,再做 diagonalize 即可 ![](https://i.imgur.com/Kwtq3V5.png) ### 不能被對角化的 example ![](https://i.imgur.com/eYrlEQR.png) 1. characteristic polynomial is $-t^2(t+2)$ 2. eigenvalues: 0, -2 3. $RREF(A-0I_3)=\begin{bmatrix}1&-1&0\\0&0&1\\0&0&0\end{bmatrix}$ 4. eigenvalue 0 的 eigenspace 的 dimension 是 1,小於 multiplicity,因此不能 diagonalize ## Eigenvectors form the good Coordinate System - review Lec 21~22 ![](https://i.imgur.com/dYRNJHI.png) ### Example ![](https://i.imgur.com/ZGaSshM.png) # [Lecture 28: PageRank](https://www.youtube.com/watch?v=pSg9TG_U_fY&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=28) ## 有空再回來看 ˊ ˋ - 1999, we present **Google**. - PageRank 的分數就是去解 $Ax=x$,也就是 $(A-\lambda I)x=0$ 對應到 $\lambda=1$ 的 eigenvector