Jephian Lin
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 體驗譜分解 ![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png) This work by Jephian Lin is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). {%hackmd 5xqeIJ7VRCGBfLtfMi0_IQ %} ```python from lingeo import random_int_list ``` ## Main idea Let $A$ be an $n\times n$ matrix and $f_A : \mathbb{R}^n\rightarrow\mathbb{R}^n$ the corresponding linear function defined by $f({\bf v}) = A{\bf v}$. Let $\mathcal{E}_n$ be the standard basis of $\mathbb{R}^n$. Then $[f_A] = [f_A]_{\mathcal{E}_n}^{\mathcal{E}_n} = A$. Let $\beta$ be another basis of $\mathcal{R}^n$ and $Q = [\operatorname{id}]_\beta^{\mathcal{E}_n}$. Then $[f_A]_\beta^\beta = Q^{-1}AQ$. ##### Spectral theorem (vector version) Let $A$ be an $n\times n$ symmetric matrix. Then there is an orthonormal basis $\beta$ of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = D$ is a diagonal matrix. That is, there is an orthogonal matrix $Q$ such that $Q^\top AQ = D$ is a diagonal matrix. Let $\beta = \{ {\bf v}_1, \ldots, {\bf v}_n \}$ be the basis in the spectral theorem. Then $Q$ is the matrix whose columns are vectors in $\beta$. Since $\beta$ is orthonormal, $Q$ is orthogonal and $Q^{-1} = Q^\top$. Suppose the $D$ matrix in the spectral theorem is $$\begin{bmatrix} \lambda_1 & ~ & ~ \\ ~ & \ddots & ~ \\ ~ & ~ & \lambda_n \\ \end{bmatrix}. $$ By examining $AQ = QD$, we have $$AQ = A\begin{bmatrix} | & ~ & | \\ {\bf v}_1 & \cdots & {\bf v}_n \\ | & ~ & | \end{bmatrix} = QD = \begin{bmatrix} | & ~ & | \\ {\bf v}_1 & \cdots & {\bf v}_n \\ | & ~ & | \end{bmatrix} \begin{bmatrix} \lambda_1 & ~ & ~ \\ ~ & \ddots & ~ \\ ~ & ~ & \lambda_n \end{bmatrix} = \begin{bmatrix} | & ~ & | \\ \lambda_1{\bf v}_1 & \cdots & \lambda_n{\bf v}_n \\ | & ~ & | \end{bmatrix}. $$ Therefore, $A{\bf v}_i = \lambda_i {\bf v}_i$ for $i = 1,\ldots, n$. If a nonzero vector ${\bf v}$ satisfies $A{\bf v} = \lambda{\bf v}$ for some scalar $\lambda$, then ${\bf v}$ is called an **eigenvector** of $A$ and $\lambda$ is called an **eigenvalue** of $A$. On the other hand, we may write $A = QDQ^\top$. Thus, $$ A = QDQ^\top = \begin{bmatrix} | & ~ & | \\ {\bf v}_1 & \cdots & {\bf v}_n \\ | & ~ & | \end{bmatrix} \begin{bmatrix} \lambda_1 & ~ & ~ \\ ~ & \ddots & ~ \\ ~ & ~ & \lambda_n \\ \end{bmatrix} \begin{bmatrix} - & {\bf v}_1^\top & - \\ ~ & \vdots & ~\\ - & {\bf v}_n^\top & - \end{bmatrix} = \sum_{i = 1}^n \lambda_i {\bf v}_i{\bf v}_i^\top. $$ Suppose $\{\lambda_1,\ldots,\lambda_n\}$ only has $q$ distinct values $\{\mu_1,\ldots, \mu_q\}$. For each $j = 1,\ldots, q$, we may let $\displaystyle P_j = \sum_{\lambda_i = \mu_j} {\bf v}_i{\bf v}_i^\top$. Thus, we have the following. ##### Spectral theorem (projection version) Let $A$ be an $n\times n$ symmetric matrix. Then there are $q$ distinct values $\mu_1,\ldots, \mu_q$ and $q$ projection matrices $P_1,\ldots, P_q$ such that - $A = \sum_{j=1}^q \mu_j P_j$, - $P_iP_j = P_jP_i$ for any $i$ and $j$, and - $\sum_{j=1}^q P_j = I_n$. ## Side stories - quadratic form - differential equation - diagonalization for general matrices ## Experiments ##### Exercise 1 執行以下程式碼。 ```python ### code set_random_seed(0) print_ans = False n = 3 Q = matrix([ [1 / sqrt(3), 1 / sqrt(2), 1 / sqrt(6)], [1 / sqrt(3), -1 / sqrt(2), 1 / sqrt(6)], [1 / sqrt(3), 0, -2 / sqrt(6)] ]) v = random_int_list(n) D = diagonal_matrix(v) A = Q * D * Q.transpose() cs = random_int_list(n) print("A =") show(A) for i in range(n): print("v%s ="%(i+1), Q.column(i)) print("b = " + " + ".join("%s v%s"%(cs[i], i+1) for i in range(n))) if print_ans: for i in range(n): print("A v%s = %s v%s"%(i+1, v[i], i+1)) print("A b = " + " + ".join("%s v%s"%(cs[i]*v[i], i+1) for i in range(n))) print("Q =") show(Q) print("D =") show(D) ``` ```set_random_seed(0)```,得 $$ A = \begin{bmatrix} 1 & -2 & -3\\ -2 & 1 & -3\\ -3 & -3 & 2 \end{bmatrix}, \bv_1 = \begin{bmatrix} \frac{1}{3\sqrt{3}}\\ \frac{1}{3\sqrt{3}}\\ \frac{1}{3\sqrt{3}} \end{bmatrix}, \bv_2 = \begin{bmatrix} \frac{1}{2\sqrt{2}}\\ -\frac{1}{2\sqrt{2}}\\ 0 \end{bmatrix}, \bv_3 = \begin{bmatrix} \frac{1}{6\sqrt{6}}\\ \frac{1}{6\sqrt{6}}\\ -\frac{1}{3\sqrt{6}} \end{bmatrix}, \bb = -5\bv_1 -5\bv_2 + 0\bv_3 $$ ##### Exercise 1(a) 驗證 ${\bf v}_1, \ldots, {\bf v}_3$ 是 $A$ 的特徵向量﹐並找出相對應的特徵值。 $Ans:$ 直接驗證 $$ \begin{aligned} &A\bv_1 = \begin{bmatrix} -\frac{4\sqrt{3}}{9}\\ -\frac{4\sqrt{3}}{9}\\ -\frac{4\sqrt{3}}{9} \end{bmatrix}=\lambda_1\bv_1,\ \lambda_1 = -4,\\ &A\bv_2 = \begin{bmatrix} \frac{3\sqrt{2}}{4}\\ -\frac{3\sqrt{2}}{4}\\ 0 \end{bmatrix}=\lambda_2\bv_2,\ \lambda_2 = 3,\\ &A\bv_3= \begin{bmatrix} \frac{5\sqrt{6}}{36}\\ \frac{5\sqrt{6}}{36}\\ -\frac{5\sqrt{6}}{18} \end{bmatrix}=\lambda_3\bv_3,\ \lambda_3 = 5. \end{aligned} $$ ##### Exercise 1(b) 把 $A{\bf b}$ 寫成 $\{{\bf v}_1, \ldots, {\bf v}_3\}$的線性組合。 $Ans:$ 利用 1(a) $$ \begin{aligned} A\bb &= A(-5\bv_1-5\bv_2+0\bv_3)\\ &= -5A\bv_1 - 5A\bv_2\\ &= 20\bv_1 - 15\bv_2. \end{aligned} $$ ##### Exercise 1(c) 找出一個垂直矩陣 $Q$ 和一個對角矩陣 $D$ 使得 $D = Q^\top AQ$。 :::warning - [x] Orthonormal --> orthonormal - [x] 標點 ::: $Ans:$ 令 $Q = \begin{bmatrix} | & | & |\\ \bv_1 & \bv_2 & \bv_3\\ | & | & | \end{bmatrix}$, 因為$Q$是垂直矩陣,所以 $\beta$ 是 orthonormal basis,所以分別將 $\bv_i$ 單位化,就可以得到 $\bu_i$。 做單位化得 $$ Q = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}\\ \end{bmatrix} .$$ 驗證 $D =\begin{bmatrix} \lambda_1 & 0 & 0\\ 0 & \lambda_2 & 0\\ 0 & 0 & \lambda_3 \end{bmatrix}= Q\trans AQ$, $$ \begin{aligned} Q\trans AQ &= \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{3}}\\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} & 0\\ \frac{1}{\sqrt{6}} & \frac{1}{\sqrt{6}} & -\frac{2}{\sqrt{6}}\\ \end{bmatrix} \begin{bmatrix} 1 & -2 & -3\\ -2 & 1 & -3\\ -3 & -3 & 2 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}\\ &=\begin{bmatrix} -\frac{4\sqrt{3}}{3} & -\frac{4\sqrt{3}}{3} & -\frac{4\sqrt{3}}{3}\\ -\frac{3\sqrt{2}}{2} & \frac{3\sqrt{2}}{2} & 0\\ -\frac{5\sqrt{6}}{6} & -\frac{5\sqrt{6}}{6} & \frac{5\sqrt{6}}{3} \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}}\\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}}\\ \end{bmatrix}\\ &=\begin{bmatrix} -4 & 0 & 0\\ 0 & 3 & 0\\ 0 & 0 & 5 \end{bmatrix}. \end{aligned} $$ ## Exercises ##### Exercise 2 令 $A$ 為一 $3\times 3$ 矩陣而 $\beta = \{ {\bf v}_1,\ldots,{\bf v}_3 \}$ 為 $\mathbb{R}^3$ 的一組基底。 已知 $$[f_A]_\beta^\beta = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 5 \\ \end{bmatrix}. $$ 將 $A{\bf v}_1$、$A{\bf v}_2$、$A{\bf v}_3$、及 $A({\bf v}_1 + {\bf v}_2 + {\bf v}_3)$ 分別寫成 $\beta$ 的線性組合。 :::warning - [x] 前兩行看起來沒用到? - [x] $[A]_\beta^\beta$ --> $[f_A]_\beta^\beta$ - [x] 矩陣右下角的 $\beta$ 拿掉,這門課沒有用這個符號 ::: $Ans:$ $[A {\bf v}_1]_\beta = [f_A]_\beta ^\beta [{\bf v}_1]_\beta = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 5 \end{bmatrix} \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 3 \\ 0 \\ 0 \end{bmatrix} = 3 {\bf v}_1.$ $[A {\bf v}_2]_\beta = [f_A]_\beta ^\beta [{\bf v}_2]_\beta = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 5 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 4 \\ 0 \end{bmatrix} = 4 {\bf v}_2.$ $[A {\bf v}_3]_\beta = [f_A]_\beta ^\beta [{\bf v}_3]_\beta = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 5 \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 5 \end{bmatrix} = 5 {\bf v}_3.$ $A({\bf v}_1 + {\bf v}_2 + {\bf v}_3) = A {\bf v}_1 + A {\bf v}_2 + A {\bf v}_3 = 3 {\bf v}_1 + 4 {\bf v}_2 + 5 {\bf v}_3.$ ##### Exercise 3 令 $$A = \begin{bmatrix} 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \\ \end{bmatrix} $$ 且 $\beta = \{ {\bf v}_1, \ldots, {\bf v}_3 \}$ 為 $$\begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \\ \end{bmatrix} $$ 的行向量集合。 ##### Exercise 3(a) 寫出 $[f_A]_\beta^\beta$ 並說明 $f_A$ 的作用。 $Ans:$ $$[f_A]_\beta^\beta = \begin{bmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \\ \end{bmatrix}. $$ $f_A$ 的作用為: 將基底 $\beta$ 分解成 $c_1{\bf u}_1 + c_2{\bf u}_2 + c_3{\bf u}_3$ 的形式, 再根據運算做伸縮, 最後再將全部一起合併。 以這題為例: 將基底 $\beta$ 分解成 $c_1{\bf u}_1 + c_2{\bf u}_2 + c_3{\bf u}_3$, 經過運算伸縮及合併後可得$\beta = 2c_1{\bf u}_1-c_2{\bf u}_2-c_3{\bf u}_3$。 ##### Exercise 3(b) 找出一個垂直矩陣 $Q$ 和一個對角矩陣 $D$ 使得 $D = Q^\top AQ$。 :::warning - [x] $D$ 有打錯 ::: $Ans:$ $Q$ 為從標準基底到 $\beta$ 的基底變換矩陣, 則可得: $$Q= \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \\ \end{bmatrix} $$ $$D =\begin{bmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix} $$ ##### Exercise 3(c) 令 $P_1$ 為投影到 $\operatorname{span}(\{{\bf v}_1\})$ 的投影矩陣、 $P_2$ 為投影到 $\operatorname{span}(\{{\bf v}_2, {\bf v}_3\})$ 的投影矩陣。 說明 $P_1 = {\bf v}_1{\bf v}_1^\top$ 且 $P_2 = {\bf v}_2{\bf v}_2^\top + {\bf v}_3{\bf v}_3^\top$。 :::warning - [x] 中英數間空格 - [x] 同理,--> 另一部份,因為 $\bv_2$ 和 $\bv_3$ 為互相垂直的單位向量,所以一個向量對 $\vspan\{\bv_2,\bv_3\}$ 的投影,等同於該向量投影到 $\vspan\{\bv_2\}$ 和投影到 $\vspan\{\bv_3\}$ 的結果相加,所以 ::: $Ans:$ 若有一個向量 $u$ 進來和 ${\bf v}_1^\top$ 作內積, 內積完再乘以 ${\bf v}_1$, 所以合在一起就是內積乘以 ${\bf v}_1$,等於投影矩陣, 所以 $P_1 ={\bf v}_1{\bf v}_1^\top$即為 $\operatorname{span}(\{{\bf v}_1\})$的投影矩陣, 另一部份,因為 $\bv_2$ 和 $\bv_3$ 為互相垂直的單位向量, 所以一個向量對 $\vspan\{\bv_2,\bv_3\}$ 的投影, 等同於該向量投影到 $\vspan\{\bv_2\}$ 和投影到 $\vspan\{\bv_3\}$ 的結果相加, 所以 $P_2 = {\bf v}_2{\bf v}_2^\top + {\bf v}_3{\bf v}_3^\top$ 即為 $\operatorname{span}(\{{\bf v}_2, {\bf v}_3\})$ 的投影矩陣。 ##### Exercise 3(d) 將 $A$ 寫成一些投影矩陣的線性組合﹐並再次說明 $f_A$ 的作用﹐看看是否和第一小題一致。 :::warning - [x] 且 ${\bf v}_2{\bf v}_2^\top + {\bf v}_3{\bf v}_3^\top$ 為 $\operatorname{span}(\{{\bf v}_2\})$的投影矩陣。<-- 這句有錯 ::: $Ans:$ $A =2{\bf v}_1{\bf v}_1^\top - {\bf v}_2{\bf v}_2^\top - {\bf v}_3{\bf v}_3^\top$, 其中 ${\bf v}_1{\bf v}_1^\top$ 為 $\operatorname{span}(\{{\bf v}_1\})$的投影矩陣, 且 ${\bf v}_2{\bf v}_2^\top + {\bf v}_3{\bf v}_3^\top$ 為 $\operatorname{span}(\{{\bf v}_2, {\bf v}_3\})$的投影矩陣。 而 $f_A$ 的作用仍是把向量先分解,再伸縮,最後合併, 和第一小題的作用一致。 ##### Exercise 4 令 $$A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \\ \end{bmatrix}. $$ ##### Exercise 4(a) 說明要找一個非零向量 ${\bf v}$ 使得 $A{\bf v} = \lambda{\bf v}$﹐ 等同於在 $(A - \lambda I){\bf v} = {\bf 0}$ 中找非零解。 :::warning - [x] 因為 $(A - \lambda I){\bf v} = {\bf 0}$ 為一個方程式的表示方法, --> 我們可以將 $\lambda\bv$ 寫成 $\lambda I\bv$,則 $A\bv = \lambda I\bv$ 和 $(A - \lambda I) \bv = \bzero$ 等價。 ::: ***Ans:*** 我們可以將 $\lambda\bv$ 寫成 $\lambda I\bv$,則 $A\bv = \lambda I\bv$ 和 $(A - \lambda I) \bv = \bzero$ 等價。 又要求 ${\bf v}$ 為非零向量,所以就等同於在 $(A - \lambda I){\bf v} = {\bf 0}$ 中找非零解。 ##### Exercise 4(b) 方程式 $(A - \lambda I){\bf v} = {\bf 0}$ 有非零解只會發生在 $\det(A - \lambda I) = 0$ 的時候。 利用這個性質找出所有可能的 $\lambda$。 ***Ans:*** 由 $\det(A - \lambda I) = 0$ 可算得 $\lambda(\lambda-5)=0$, 求得 $\lambda=0$ 或 $5$。 ##### Exercise 4(c) 對每一個 $\lambda$ 解出相對應的 ${\bf v}$。 向量 ${\bf v}$ 的選擇可能很多﹐把它的長度縮為 $1$。 :::warning - [x] 向量粗體 - [x] 第二個 $A$ 的等式有錯 ::: ***Ans:*** 當 $\lambda=0:$ $A-\lambda I = \begin{bmatrix} 1 & 2 \\ 2 & 4 \\ \end{bmatrix}$,${\bf v}=(2,-1)$, ${\bf v}'=(2/{\sqrt{5}},-1/{\sqrt{5}})$。 或 $\lambda=5:$ $A- \lambda I = \begin{bmatrix} -4 & 2 \\ 2 & -1 \\ \end{bmatrix}$,${\bf v}=(1,2)$, ${\bf v}'=(1/{\sqrt{5}},2/{\sqrt{5}})$, 以上兩解為所求。 ##### Exercise 4(d) 找出一個垂直矩陣 $Q$ 和一個對角矩陣 $D$ 使得 $D = Q^\top AQ$。 :::warning - [x] 向量粗體 - [x] 則 $Q$ <-- 這裡 $Q$ 是什麼 - [x] 邏輯不完整:取了這個 $Q$ 和這個 $D$ 之後為什麼 $D = Q\trans AQ$? ::: ***Ans:*** 由4(c),我們取 $\beta=\{ v_1,v_2 \}$,其中 ${\bf v}_1=(\frac{2}{\sqrt{5}},\frac{-1}{\sqrt{5}}),{\bf v}_2=(\frac{1}{\sqrt{5}},\frac{2}{\sqrt{5}})$, 則垂直矩陣 $Q$ 為從標準基底到 $\beta$ 的基底變換矩陣, 也就是 $$Q= \begin{bmatrix} \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \\ \frac{-1}{\sqrt{5}} & \frac{2}{\sqrt{5}} \\ \end{bmatrix} $$ 經過直接計算可得 $$D = Q^\top AQ =\begin{bmatrix} 0 & 0 \\ 0 & 5 \\ \end{bmatrix}. $$ ##### Exercise 5 令 $$A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \\ \end{bmatrix}, Q = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & - \frac{1}{\sqrt{2}} \\ \end{bmatrix}, D = \begin{bmatrix} 3 & 0 \\ 0 & -1 \\ \end{bmatrix}. $$ ##### Exercise 5(a) 驗證 $Q^\top AQ = D$。 ***Ans:*** $$Q^\top AQ = \frac{1}{2} \begin{bmatrix} 1 & 1 \\ 1 & - 1 \\ \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 2 & 1 \\ \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & - 1 \\ \end{bmatrix} = \frac{1}{2} \begin{bmatrix} 1 & 1 \\ 1 & - 1 \\ \end{bmatrix} \begin{bmatrix} 3 & -1 \\ 3 & 1 \\ \end{bmatrix} = \frac{1}{2} \begin{bmatrix} 6 & 0 \\ 0 & -2 \\ \end{bmatrix} = \begin{bmatrix} 3 & 0 \\ 0 & -1 \\ \end{bmatrix} = D. $$ ##### Exercise 5(a) 令 $p(x,y) = x^2 + 4xy + y^2$。 找一些係數 $a,b,c,d$ 並令 $\hat{x} = a x + b y$、 $\hat{y} = c x + d y$﹐ 使得 $p(x,y) = 3\hat{x}^2 - \hat{y}^2$。 藉此說明 $p(x,y) = 1$ 的圖形是雙曲線。 :::warning 這題想法不錯,不過不清楚。 我直接改寫。 ::: ***Ans:*** 設一線性函數為 $$ f\left(\begin{bmatrix} x \\ y \end{bmatrix}\right) = \begin{bmatrix} x + 2y \\ 2x + y \end{bmatrix}. $$ 則 $$ p(x,y) = x(x+2y) + y(2x+y), $$ 恰好為 $(x,y)$ 與 $f(x,y)$ 的內積。 已知正交的標準基底變換不影響線性函數與內積, 若能找一組正交標準基底 $\beta$ 使得 $$ \inp{[(x,y)]_\beta}{[f(x,y)]_\beta} = 3\hat{x}^2 - \hat{y}^2, $$ 其中 $[(x,y)]_\beta = (\hat{x}, \hat{y})$, 則 $$ p(x,y) = \inp{(x,y)}{f(x,y)} = \inp{[(x,y)]_\beta}{[f(x,y)]_\beta} = 3\hat{x}^2 + \hat{y}^2. $$ 如果可以取到 $$ [f]_\beta^\beta = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} $$ 則可以得到這個效果。 因此根據 5(a),我們可以取 $\beta$ 為 $Q$ 矩陣的行向量集合。 如此一來就有 $$ \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & - \frac{1}{\sqrt{2}} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}. $$ 也就是說 $a = \frac{1}{\sqrt{2}} , b = \frac{1}{\sqrt{2}} , c = \frac{1}{\sqrt{2}} , d = - \frac{1}{\sqrt{2}}$ 。 <!-- 所以可設 $B$ 為此基底變換矩陣, 則若 $B \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix}$ , 且$B \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} B^ {-1} \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix} = \begin{bmatrix} 3 \hat{x} \\ -1 \hat{y} \end{bmatrix}$ 時, 會使 $p(x,y) = 3\hat{x}^2 - \hat{y}^2$ 成立, 因此根據 5(a),令 $B = \begin{bmatrix} a & b \\ c & d \end{bmatrix} = Q^ \top = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & - \frac{1}{\sqrt{2}} \end{bmatrix}$ , 也就是說 $a = \frac{1}{\sqrt{2}} , b = \frac{1}{\sqrt{2}} , c = \frac{1}{\sqrt{2}} , d = - \frac{1}{\sqrt{2}}$ 。 --> ##### Exercise 5(b) 令 $x(t), y(t)$ 為以 $t$ 為變數的函數。 令 $x'(t), y'(t)$ 為其對 $t$ 的微分。 考慮微分方程 $x' = x + 2y$、 $y' = 2x + y$。 找一些係數 $a,b,c,d$ 並令 $\hat{x} = a x + b y$、 $\hat{y} = c x + d y$﹐ 使得原方程可以改寫為 $\hat{x}' = 3\hat{x}$、 $\hat{y}' = -\hat{y}$。 (此方程的解為 $\hat{x} = C_1e^{3t}$、 $\hat{y} = C_2e^{-t}$﹐ 其中 $C_1$ 和 $C_2$ 是任意常數。) 解原方程。 ***Ans:*** 由於 $\begin{cases} x' = x + 2y \\ y' = 2x + y \end{cases}$ , 可寫成 $\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}$ 。 設一基底變換矩陣 $B$ , 會使 $B \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix}$ , 且 $B \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix} B^ {-1} \begin{bmatrix} \hat{x} \\ \hat{y} \end{bmatrix} = \begin{bmatrix} 3 \hat{x} \\ -1 \hat{y} \end{bmatrix}$ , 因此根據5(a), $B = \begin{bmatrix} a & b \\ c & d \end{bmatrix} = Q^ \top = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & - \frac{1}{\sqrt{2}} \end{bmatrix}$ , 也就是說, $a = \frac{1}{\sqrt{2}} , b = \frac{1}{\sqrt{2}} , c = \frac{1}{\sqrt{2}} , d = - \frac{1}{\sqrt{2}}$ 。 ##### Exercise 6 以下例題說明並非對稱矩陣才能表示成對角矩陣。 然而其所用的基底不再是垂直的。 令 $$A = \begin{bmatrix} 1 & 2 \\ 1 & 2 \\ \end{bmatrix}. $$ ##### Exercise 6(a) 說明要找一個非零向量 ${\bf v}$ 使得 $A{\bf v} = \lambda{\bf v}$﹐ 等同於在 $(A - \lambda I){\bf v} = {\bf 0}$ 中找非零解。 :::warning - [x] 向量粗體 - [x] 也就是那句刪掉 ::: $Ans:$ $A{\bf v}$ = $\lambda{\bf v}$ 可寫成 $(A-\lambda I){\bf v}$ = $0$ , 由於 ${\bf v}$ 為非零向量 , 所以也是非零解 。 ##### Exercise 6(b) 方程式 $(A - \lambda I){\bf v} = {\bf 0}$ 有非零解只會發生在 $\det(A - \lambda I) = 0$ 的時候。 利用這個性質找出所有可能的 $\lambda$。 :::warning - [x] 句子要完整,不要只有數學式 - [x] $\lambda = 0 或是 3$ --> $\lambda$ 為 $0$ 或是 $3$ ::: $Ans:$ 直接計算可得 $A - \lambda I$ = $\begin{bmatrix}1 & 2 \\ 1 & 2 \end{bmatrix} -\begin{bmatrix} \lambda & 0 \\ 0 & \lambda\end{bmatrix} = \begin{bmatrix} 1 - \lambda & 2 \\ 1 & 2 - \lambda \end{bmatrix}.$ 當 $\det(A - \lambda I)$ 為 $0$ 時, 行列式值為 $(1 - \lambda)(2 - \lambda) - 2 = 0$ , 也就是 $\lambda(\lambda - 3) = 0$ , 故 $\lambda$ 為 $0$ 或是 $3$ 。 ##### Exercise 6(c) 對每一個 $\lambda$ 解出相對應的 ${\bf v}$。 向量 ${\bf v}$ 的選擇可能很多﹐把它的長度縮為 $1$。 :::warning - [x] 中英數間空格 ::: $Ans:$ 假設 ${\bf v}$ = $$\begin{bmatrix}a \\ b \end{bmatrix}$$ 當 $\lambda = 0$ , $\begin{bmatrix} 1 & 2 \\ 1 & 2 \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}$ 因為 $a$ = $-2 b$ , 所以 $a = \frac{-2}{\sqrt{5}} , b = \frac{1}{\sqrt{5}}$ 。 當 $\lambda = 3$ , $\begin{bmatrix} 1 & 2 \\ 1 & 2\end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix} = 3 \begin{bmatrix} a \\b \end{bmatrix}$ 因為 $a = b$ , 所以 $a = \frac{1}{\sqrt{2}} , b = \frac{1}{\sqrt{2}}$ 。 ##### Exercise 6(d) 找出一個可逆矩陣 $Q$ 和一個對角矩陣使得 $D = Q^{-1} AQ$。 :::warning - [x] 數學進數學式 - [x] $V(0)$ 是什麼,第二行第三行的數字又是哪來的。 - [x] 等號進數學式 這題要用上一題,目前的答案沒有解釋為什麼 $Q^{-1}AQ = D$。 ::: $Ans:$ 由 6(b) 知特徵根為 $0$ 和 $3$, 並由上一題的計算可得到, $\operatorname{ker}(A - 0 I)$ = $\operatorname{span}\left\{\begin{bmatrix}-2 \\ 1\end{bmatrix}\right\}$ 為 $A$ 相對於 0 的特徵空間 , $\operatorname{ker}(A - 3 I)$ = $\operatorname{span}\left\{\begin{bmatrix}1 \\ 1\end{bmatrix}\right\}$ 為 $A$ 相對於 3 的特徵空間 , 所以 $\begin{bmatrix}-2 \\ 1\end{bmatrix}$ , $\begin{bmatrix}1 \\ 1\end{bmatrix}$ 為 $A$ 的兩個線性獨立的特徵向量。 由於 $$ A\begin{bmatrix} -2 \\ 1 \end{bmatrix} = 0 \begin{bmatrix} -2 \\ 1 \end{bmatrix} $$ 且 $$ A\begin{bmatrix} 1 \\ 1 \end{bmatrix} = 3 \begin{bmatrix} 1 \\ 1 \end{bmatrix}. $$ 所以當 $\beta$ 是由這兩個向量所組成的基底時, $$ [f_A]_\beta^\beta = \begin{bmatrix} 0 & 0 \\ 0 & 3 \end{bmatrix} = [\operatorname{id}]_{\mathcal{E}_2}^\beta [f_A] [\operatorname{id}]_{\beta}^{\mathcal{E}_2}. $$ 因此可以取 $Q = [\operatorname{id}]_{\beta}^{\mathcal{E}_2}$= $\begin{bmatrix}-2 & 1 \\1 & 1\end{bmatrix}$ , 則 $Q^{-1}AQ$ = $D$ = $\begin{bmatrix}0 & 0\\ 0 & 3\end{bmatrix}$ 。 :::info 目前分數 4.5 :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully