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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 矩陣對角化 ![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/). $\newcommand{\trans}{^\top} \newcommand{\adj}{^{\rm adj}} \newcommand{\cof}{^{\rm cof}} \newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} \newcommand{\dunion}{\mathbin{\dot\cup}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bone}{\mathbf{1}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bd}{\mathbf{d}} \newcommand{\be}{\mathbf{e}} \newcommand{\bh}{\mathbf{h}} \newcommand{\bp}{\mathbf{p}} \newcommand{\bq}{\mathbf{q}} \newcommand{\br}{\mathbf{r}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\nul}{\operatorname{null}} \newcommand{\rank}{\operatorname{rank}} %\newcommand{\ker}{\operatorname{ker}} \newcommand{\range}{\operatorname{range}} \newcommand{\Col}{\operatorname{Col}} \newcommand{\Row}{\operatorname{Row}} \newcommand{\spec}{\operatorname{spec}} \newcommand{\vspan}{\operatorname{span}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\sgn}{\operatorname{sgn}} \newcommand{\idmap}{\operatorname{id}}$ ```python from lingeo import random_int_list, random_good_matrix ``` ## Main idea We know that an $n\times n$ matrix is diagonalizable if and only if there is a basis of $\mathbb{R}^n$ composed of eigenvectors. We also know how to find the eigenvalues through the characteristic polynomial. Indeed, that is all we need to perform the diagonalization of a matrix. Let $A$ be an $n\times n$ matrix. Here are the steps for its diagonalization: 1. Calculate the characteristic polynomial $p_A(x) = \det(A - xI)$ and solve the roots for $\spec(A)$. 2. For each $\lambda\in\spec(A)$, find a basis $\beta_\lambda$ for $\ker(A - \lambda I)$. 3. Let $\beta$ be the union of all such $\beta_\lambda$. 4. If $\beta$ is a basis of $\mathbb{R}^n$, then $A$ can be diagonalized through $\beta$. That is, $[f_A]_\beta^\beta = D$ is a diagonal matrix. Equivalently, $D = Q^{-1}AQ$, where $Q$ is the matrix whose columns are the vectors in $\beta$. ##### Remark If $\beta = \{\bv_1, \ldots, \bv_n\}$ is a basis of $\mathbb{R}^n$ such $\bv_i$ is an eigenvector of $A$ with respect to $\lambda_i$ for all $i$. Then the equalities $A\bv_i = \lambda_i\bv_i$ is equivalent to $$ AQ = A\begin{bmatrix} | & ~ & | \\ {\bf v}_1 & \cdots & {\bf v}_n \\ | & ~ & | \end{bmatrix} = \begin{bmatrix} | & ~ & | \\ \lambda_1{\bf v}_1 & \cdots & \lambda_n{\bf v}_n \\ | & ~ & | \end{bmatrix} = \begin{bmatrix} | & ~ & | \\ {\bf v}_1 & \cdots & {\bf v}_n \\ | & ~ & | \end{bmatrix} \begin{bmatrix} \lambda_1 & ~ & ~ \\ ~ & \ddots & ~ \\ ~ & ~ & \lambda_n \end{bmatrix} = QD. $$ ##### Remark The above process might not able to finish for a few different reasons: - The root of $p_A(x)$ might not be real. If we instite the basis should be using real vectors, then it cannot be done. - It is possible that $\beta_\lambda$ does not provide enough independent eigenvectors, so $\beta$ is not a bsis of $\mathbb{R}^n$. Here is an example of diagonalizing $$ A = \begin{bmatrix} 2 & 3 \\ 3 & 2 \end{bmatrix}. $$ _Solve for the eigenvalues_: The characteristic polynomial of $A$ is $$ p_A(x) = \det\begin{bmatrix} 2 - x & 3 \\ 3 & 2 - x \end{bmatrix} = x^2 - 4x - 5, $$ which as roots $-1, 5$. _Solve for the eigenvectors_: For $\lambda = 5$, calculate the basis of $\ker(A - 5I)$ and get $$ \ker(A - 5I) = \ker \begin{bmatrix} -3 & 3 \\ 3 & -3 \end{bmatrix} = \vspan\left\{\begin{bmatrix} 1 \\ 1 \end{bmatrix}\right\}. $$ For $\lambda = -1$, calculate the basis of $\ker(A + I)$ and get $$ \ker(A + I) = \ker \begin{bmatrix} 3 & 3 \\ 3 & 3 \end{bmatrix} = \vspan\left\{\begin{bmatrix} 1 \\ -1 \end{bmatrix}\right\}. $$ By setting $$ \beta = \left\{ \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 1 \\ -1 \end{bmatrix}\right\} \text{ and } Q = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}, $$ we get $$ [f_A]_\beta^\beta = Q^{-1}AQ = \begin{bmatrix} 5 & 0 \\ 0 & -1 \end{bmatrix}. $$ ## Side stories - Jordan block - discrete Fourier transform ## Experiments ##### Exercise 1 執行以下程式碼。 ```python ### code set_random_seed(0) print_ans = False n = 3 spec = random_int_list(n, 3) D = diagonal_matrix(spec) Q = random_good_matrix(n,n,n,2) A = Q * D * Q.inverse() pretty_print(LatexExpr("A ="), A) pA = (-1)^n * A.charpoly() print("characteristic polyomial =", pA) print(" =", factor(pA)) if print_ans: print("eigenvalues are:" + ", ".join("%s"%val for val in spec)) print("corresponding eigenvectors are:") for i in range(n): pretty_print(LatexExpr(r"\lambda ="), spec[i], ", eigenvector =", Q[:,i]) pretty_print(LatexExpr("Q ="), Q) ``` 藉由 `seed = 2`得到 $$A=\begin{bmatrix} -1 & 2 & -3\\ 6 & 0 & 6\\ 4 & -2 & 6 \end{bmatrix}. $$ ##### Exercise 1(a) 求出 $A$ 的所有特徵值。 答: 特徵多項式為 $$ p_A(x)=\det (A-xI)= \det \begin{bmatrix} -1-x & 2 & -3\\ 6 & 0-x & 6\\ 4 & -2 & 6-x \end{bmatrix}=6x^2-18x=-x^3+5x^2-6x=-x(x-3)(x-2). $$ 特徵值為 $0$、$2$、$3$。 ##### Exercise 1(b) 對每個特徵值,求出對應的特徵向量。 :::warning - [x] 沒有寫清楚答案,比如:所以對應的特徵向量分別為 ... ::: 答: $$\lambda_1=2, \ker (A-2I)= \ker \begin{bmatrix} -3 & 2 & -3\\ 6 & -2 & 6\\ 4 & -2 & 4 \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} \right\},\bv_1=(1,0,-1). $$ $$\lambda_2=0, \ker (A-0I)= \ker \begin{bmatrix} -1 & 2 & -3\\ 6 & 0 & 6\\ 4 & -2 & 6 \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} -1 \\ 1 \\ 1 \end{bmatrix} \right\},\bv_2=(-1,1,1). $$ $$\lambda_3=3, \ker (A-3I)= \ker \begin{bmatrix} -4 & 2 & -3\\ 6 & -3 & 6\\ 4 & -2 & 3 \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix} \right\},\bv_3=(1,2,0). $$ ##### Exercise 1(c) 求出 $Q$ 使得 $D = Q^{-1}AQ$ 是一個對角矩陣。 :::warning - [x] 要在上一題說明什麼是 $\bv_1,\bv_2,\bv_3$ - [x] 標點 ::: 答: 得到 $$ Q= \begin{bmatrix} | & | & | \\ \bv_1& \bv_2 & \bv_3 \\ | & | & | \\ \end{bmatrix}= \begin{bmatrix} 1 & -1 & 1\\ 0 & 1 & 2\\ -1 & 1 & 0 \end{bmatrix}, $$ $$ D= \begin{bmatrix} \lambda_1& 0 & 0 \\ 0& \lambda_2& 0 \\ 0 & 0 & \lambda_3 \\ \end{bmatrix}=\begin{bmatrix} 2 & 0 & 0 \\ 0& 0 & 0 \\ 0 & 0 & 3 \\ \end{bmatrix}. $$ 使得 $D = Q^{-1}AQ$。 ## Exercises ##### Exercise 2 將以下矩陣 $A$ 對角化。 (求出可逆矩陣 $Q$ 和對角矩陣 $D$ 使得 $D = Q^{-1}AQ$。) ##### Exercise 2(a) $$ A = \begin{bmatrix} 0 & 1 \\ -6 & 5 \end{bmatrix}. $$ :::warning - [x] 特徵值為 2、3。 <-- 把 $2$ 和 $3$ 丟進數學模式 - [x] 跟第一題一樣,要說明 $\bv_1, \bv_2$ 是什麼 ::: 答: 特徵多項式為 $$ p_A(x)=\det (A-xI)= \det \begin{bmatrix} 0-x & 1\\ -6 & 5-x\\ \end{bmatrix}=x^2-5x+6=(x-3)(x-2). $$ 特徵值為 $2$、$3$。 $$\lambda_1=2, \ker (A-2I)= \ker \begin{bmatrix} -2 & 1\\ -6 & 3\\ \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix} \right\},\bv_1=(1,2), $$ $$\lambda_2=3, \ker (A-3I)= \ker \begin{bmatrix} -3 & 1\\ -6 & 2\\ \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} 1 \\ 3 \end{bmatrix} \right\},\bv_2=(1,3). $$ 得到 $$ Q= \begin{bmatrix} | & | \\ \bv_1& \bv_2 \\ | & | \\ \end{bmatrix}= \begin{bmatrix} 1 & 1\\ 2 & 3\\ \end{bmatrix}、 $$ $$ D= \begin{bmatrix} \lambda_1& 0\\ 0& \lambda_2 \\ \end{bmatrix}=\begin{bmatrix} 2 & 0 \\ 0 & 3 \\ \end{bmatrix}, $$ 使得 $D = Q^{-1}AQ$。 ##### Exercise 2(b) $$ A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}. $$ :::warning - [x] 同上題 - [x] 呃... 特徵值有錯喔,所以特徵向量也有算錯 ::: 答: 特徵多項式為 $$ p_A(x)=\det (A-xI)= \det \begin{bmatrix} 0-x & -1\\ 1 & 0-x\\ \end{bmatrix}=x^2+1. $$ 特徵值為 $i,-i$。 $$ \lambda_1=i,\ \ker (A-iI)= \ker \begin{bmatrix} -i & -1\\ 1 & -i\\ \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} i \\ 1 \end{bmatrix} \right\},\bv_1=(i,1). $$ $$ \lambda_2=-i,\ \ker (A+iI)= \ker \begin{bmatrix} i & -1\\ 1 & i\\ \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} -i \\ 1 \end{bmatrix} \right\},\bv_2=(-i,1). $$ 得到 $$ Q= \begin{bmatrix} | & | \\ \bv_1& \bv_2 \\ | & | \\ \end{bmatrix}= \begin{bmatrix} i & -i\\ 1 & 1\\ \end{bmatrix}、 $$ $$ D= \begin{bmatrix} \lambda_1& 0\\ 0& \lambda_2 \\ \end{bmatrix}=\begin{bmatrix} i & 0 \\ 0 & -i \\ \end{bmatrix}, $$ 使得 $D = Q^{-1}AQ$。 ##### Exercise 3 將以下矩陣 $A$ 對角化。 (求出可逆矩陣 $Q$ 和對角矩陣 $D$ 使得 $D = Q^{-1}AQ$。) ##### Exercise 3(a) $$ A = \begin{bmatrix} 4 & 0 & -1 \\ 0 & 4 & -1 \\ -1 & -1 & 5 \end{bmatrix}. $$ :::warning - [x] $P_A$ --> $p_A$;後面幾題也改一下 ::: sol: The characteristic polynomial of $A$ is $$\begin{split} p_A(x) & = \det(A - xI) \\ & = \det \left[\begin{array}{ccc} 4 - x & 0 & -1 \\ 0 & 4 - x & -1 \\ -1 & -1 & 5 - x \end{array}\right] \\ & = -x^3 + 13 x^2 - 54x + 72 \\ & = -(x - 3)(x - 4)(x - 6). \end{split}$$ If characteristic polynomial $p_A(x) = 0$, then $-(x - 3)(x - 4)(x - 6) = 0$. We can get eigenvalues $x = 3, 4, 6$. For $x = 3$, calculate the basis for $\ker(A - 3I)$ and get $$\begin{split} \ker(A - 3I) = \ker \left[\begin{array}{ccc} 1 & 0 & -1 \\ 0 & 1 & -1 \\ -1 & -1 & 2 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ 1 \\ 1 \end{array}\right] \right\rbrace. \end{split}$$ For $x = 4$, calculate the basis for $\ker(A - 4I)$ and get $$\begin{split} \ker(A - 4I) = \ker \left[\begin{array}{ccc} 0 & 0 & -1 \\ 0 & 0 & -1 \\ -1 & -1 & 1 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ -1 \\ 0 \end{array}\right] \right\rbrace. \end{split}$$ For $x = 6$, calculate the basis for $\ker(A - 6I)$ and get $$\begin{split} \ker(A - 6I) = \ker \left[\begin{array}{ccc} -2 & 0 & -1 \\ 0 & -2 & -1 \\ -1 & -1 & -1 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ 1 \\ -2 \end{array}\right] \right\rbrace. \end{split}$$ By setting $$\beta = \left\lbrace \left[\begin{array}{c} 1 \\ 1 \\ 1 \end{array}\right], \left[\begin{array}{c} 1 \\ -1 \\ 0 \end{array}\right], \left[\begin{array}{c} 1 \\ 1 \\ -2 \end{array}\right] \right\rbrace \text{, and } Q = \left[\begin{array}{ccc} 1 & 1 & 1\\ 1 & -1 & 1 \\ 1 & 0 & -2 \end{array}\right]$$ such that $$[f_A]^\beta_\beta = Q^{-1}AQ = \left[\begin{array}{ccc} 3 & 0 & 0\\ 0 & 4 & 0 \\ 0 & 0 & 6 \end{array}\right]. $$ :::info 寫得很完整 :smiley: :dog: :rabbit: :cat: :rage: ::: ##### Exercise 3(b) $$ A = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 6 & -11 & 6 \end{bmatrix}. $$ sol: The characteristic polynomial of $A$ is $$\begin{split} p_A(x) & = \det(A - xI) \\ & = \det \left[\begin{array}{ccc} - x & 1 & 0 \\ 0 & - x & 1 \\ 6 & -11 & 6 - x \end{array}\right] \\ & = -x^3 + 6x^2 - 11x + 6 \\ & = -(x - 1)(x - 2)(x - 3). \end{split}$$ If characteristic polynomial $p_A(x) = 0$, then $-(x - 1)(x - 2)(x - 3) = 0$. We can get eigenvalues $x = 1, 2, 3$. For $x = 1$, calculate the basis for $\ker(A - I)$ and get $$\begin{split} \ker(A - I) = \ker \left[\begin{array}{ccc} -1 & 1 & 0 \\ 0 & -1 & 1 \\ 6 & -11 & 5 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ 1 \\ 1 \end{array}\right] \right\rbrace. \end{split}$$ For $x = 2$, calculate the basis for $\ker(A - 2I)$ and get $$\begin{split} \ker(A - 2I) = \ker \left[\begin{array}{ccc} -2 & 1 & 0 \\ 0 & -2 & 1 \\ 6 & -11 & 4 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ 2 \\ 4 \end{array}\right] \right\rbrace. \end{split}$$ For $x = 3$, calculate the basis for $\ker(A - 3I)$ and get $$\begin{split} \ker(A - 3I) = \ker \left[\begin{array}{ccc} -3 & 1 & 0 \\ 0 & -3 & 1 \\ 6 & -11 & 3 \end{array}\right] = \operatorname{span} \left\lbrace \left[\begin{array}{c} 1 \\ 3 \\ 9 \end{array}\right] \right\rbrace. \end{split}$$ By setting $$\beta = \left\lbrace \left[\begin{array}{c} 1 \\ 1 \\ 1 \end{array}\right], \left[\begin{array}{c} 1 \\ 2 \\ 4 \end{array}\right], \left[\begin{array}{c} 1 \\ 3 \\ 9 \end{array}\right] \right\rbrace \text{, and } Q = \left[\begin{array}{ccc} 1 & 1 & 1\\ 1 & 2 & 3\\ 1 & 4 & 9 \end{array}\right]$$ such that $$[f_A]^\beta_\beta = Q^{-1}AQ = \left[\begin{array}{ccc} 1 & 0 & 0\\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{array}\right]. $$ ##### Exercise 3(c) $$ A = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}. $$ **[以下答案說明 $A$ 在實數中不可對角化]** The characteristic polynomial of $A$ is $$\begin{split} p_A(x) & = \det(A - xI) \\ & = \det \left[\begin{array}{ccc} - x & 1 & 0 \\ 0 & - x & 1 \\ 1 & 0 & - x \end{array}\right] \\ & = -x^3 + 1 \\ & = -(x - 1)(x^2 + x + 1). \end{split} $$ Since $(x^2 + x + 1)$ can not be spilt in $\mathbb{R}$, thus $A$ can't diagonalizable. :::warning - [ ] 可以用 $\omega = e^{\frac{2\pi}{3}i}$ 改寫,讓答案變乾淨一些 ::: 討論 $A$ 在複數空間中的特徵值為 $(1, \frac{-1+\sqrt{3}i}{2}, \frac{-1-\sqrt{3}i}{2})$。 $$ \lambda_1=1,\ker(A-1I)= \ker\begin{bmatrix} -1 & 1 & 0 \\ 0 & -1 & 1 \\ 1 & 0 & -1 \\ \end{bmatrix}=\vspan\left\{\begin{bmatrix} 1\\1\\1\end{bmatrix}\right\} $$ $$ \lambda_2=\frac{-1+\sqrt{3}i}{2},\ker(A-\frac{-1+\sqrt{3}i}{2}I)= \ker\begin{bmatrix} \frac{1-\sqrt{3}i}{2} & 1 & 0 \\ 0 & \frac{1-\sqrt{3}i}{2} & 1 \\ 1 & 0 & \frac{1-\sqrt{3}i}{2} \\ \end{bmatrix} $$ $$ \lambda_3=\frac{-1-\sqrt{3}i}{2},\ker(A-\frac{-1-\sqrt{3}i}{2}I)= \ker\begin{bmatrix} \frac{1+\sqrt{3}i}{2} & 1 & 0 \\ 0 & \frac{1+\sqrt{3}i}{2} & 1 \\ 1 & 0 & \frac{1+\sqrt{3}i}{2} \\ \end{bmatrix} $$ :::info 答案可接受,不用更動 但沒特別說明的情況下應該對複數對角化,像 2(b) 可以在後面再加一個 $A$ 在複數中可對角化的答案 ::: ##### Exercise 4 將以下矩陣 $A$ 對角化, 並說明 $f_A$ 的作用。 ##### Exercise 4(a) $$ A = \begin{bmatrix} \frac{2}{3} & -\frac{1}{3} & -\frac{1}{3} \\ -\frac{1}{3} & \frac{2}{3} & -\frac{1}{3} \\ -\frac{1}{3} & -\frac{1}{3} & \frac{2}{3} \end{bmatrix}. $$ :::warning - [x] 雖然根沒有解錯,但 $p_A(x)$ 應該有少一些係數 - [x] $\ker(...)$ 應該是等於 $\vspan\left\{...\right\}$, 不會等於一兩個向量 - [x] $\{ \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix},\ \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}\}$ --> $\left\{ \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix},\ \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}\right\}$ ::: **Ans:** 先求 $A$ 的特徵多項式,依定義 $p_A(x) = \det (A-xI)$ 。 即 $$ \frac{1}{27}\det \begin{bmatrix} 2-3x & -1 & -1 \\ -1 & 2-3x & -1 \\ -1 & -1 & 2-3x \end{bmatrix}. $$ 經計算後得 $p_A(x) = -x{(x-1)}^2$ ,根為 $0,1,1$ 。 當 $x=0$ , $$ \ker(A-xI) = \vspan\left\{\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}\right\}. $$ 當 $x=1$ , $$ \ker(A-xI) = \vspan\left\{ \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix},\ \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}\right\}. $$ 則可得 $$ Q = \begin{bmatrix} 1 & -1 & -1 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}. $$ 且將 $Q$ 做到 $rref$ 後得到 $I$ ,故 $Q^{-1}$ 存在。 依照定義,將 $A$ 對角化後得到的矩陣 $D = Q^{-1}AQ$ 。 故 $$ D = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}. $$ 可知 $f_A$ 是一個將 $3$ 維向量投影到 $2$ 維平面上的函數。 ##### Exercise 4(b) $$ A = \begin{bmatrix} \frac{1}{3} & -\frac{2}{3} & -\frac{2}{3} \\ -\frac{2}{3} & \frac{1}{3} & -\frac{2}{3} \\ -\frac{2}{3} & -\frac{2}{3} & \frac{1}{3} \end{bmatrix}. $$ :::warning - [x] 跟上一題類似 ::: **Ans:** 先求 $A$ 的特徵多項式,依定義 $p_A(x) = \det (A-xI)$ 。 即 $$ \frac{1}{27}\det \begin{bmatrix} 1-3x & -2 & -2 \\ -2 & 1-3x & -2 \\ -2 & 2 & 1-3x \end{bmatrix}. $$ 經計算後得 $p_A(x) = -(x+1){(x-1)}^2$ ,根為 $-1,1,1$ 。 當 $x=-1$ , $$ \ker(A-xI) = \vspan\left\{\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}\right\}. $$ 當 $x=1$ , $$ \ker(A-xI) =\vspan\left\{ \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix},\ \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}\right\}. $$ 則可得 $$ Q = \begin{bmatrix} 1 & -1 & -1 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}. $$ 且將 $Q$ 做到 $rref$ 後得到 $I$ ,故 $Q^{-1}$ 存在。 依照定義,將 $A$ 對角化後得到的矩陣 $D = Q^{-1}AQ$ 。 故 $$ D = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}. $$ 可知 $f_A$ 是一個鏡射的函數。 ##### Exercise 5 令 $$ A = \begin{bmatrix} 3 & 1 & 0 \\ 0 & 3 & 1 \\ 0 & 0 & 3 \end{bmatrix}. $$ 說明 $A$ 矩陣只有一個特徵值 $3$(重根三次), 但 $\ker(A - 3I)$ 的維度只有 $1$, 找不到足夠的向量將 $A$ 對角化。 答: 特徵多項式為 $$ P_A(x)=\det (A-xI)= \det \begin{bmatrix} 3-x & 1 & 0 \\ 0 & 3-x & 1 \\ 0 & 0 & 3-x \end{bmatrix}=-x^3+9x^2-27x+27=-(x-3)^3. $$ 得到特徵值 $$ \lambda_1=\lambda_2=\lambda_3=3. $$ 使得 $$\lambda=3, \ker (A-3I)= \ker \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}= \operatorname{span}\left\{ \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \right\}. $$ 得到 $\lambda=3$ 時,只有一個特徵向量 $\bv=(1,0,0)$,使得 $\ker(A - 3I)$ 的維度只有 $1$,所以找不到足夠的向量將 $A$ 對角化。 ##### Exercise 6 令 $$ A = \begin{bmatrix} 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 & 0 \end{bmatrix} $$ 並令 $\zeta = e^{\frac{2\pi}{5}i}$ 為 $1$ 的五次方根。 這個練習告訴我們,如果運氣很好有找到所有的特徵向量,則不見得要解特徵多項式也可以找得到 $\spec(A)$。 ##### Exercise 6(a) 令 $$ Q = \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^6 & \zeta^8 \\ 1 & \zeta^3 & \zeta^6 & \zeta^9 & \zeta^{12} \\ 1 & \zeta^4 & \zeta^8 & \zeta^{12} & \zeta^{16} \\ \end{bmatrix}. $$ 驗證 $Q^*Q = 5I_5$, 因此 $Q$ 可逆且其行向量集合是一組 $\mathbb{C}^5$ 的基底。 (這裡 $Q^*$ 的意思是將 $Q$ 轉置後再逐項取共軛。) 答: 因為尤拉公式(Euler's formula),對於任意實數 $x$,$$e^{ix}=\cos(x)+i\sin(x)$$ 恆成立。 所以可以得到 $\zeta = e^{\frac{2\pi}{5}i} = \cos(\frac{2\pi}{5})+i\sin(\frac{2\pi}{5}).$ 可以推出 $\zeta^n = e^{\frac{2n\pi}{5}i} = \cos(\frac{2n\pi}{5})+i\sin(\frac{2n\pi}{5})$,且 $\zeta^1$ 和 $\zeta^4$ 共軛 ,$\zeta^2$ 和 $\zeta^3$ 共軛。 計算 $Q$ 和 $Q^*:$ $$Q = \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^6 & \zeta^8 \\ 1 & \zeta^3 & \zeta^6 & \zeta^9 & \zeta^{12} \\ 1 & \zeta^4 & \zeta^8 & \zeta^{12} & \zeta^{16} \\ \end{bmatrix}= \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ \end{bmatrix}. $$ $$ Q^* = \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ \end{bmatrix}. $$ 計算 $Q^*Q:$ 運用 $x^5 = 1$,計算 $$x^5-1= (x-1)(x^4+x^3+x^2+x+1)=0.$$ 可以得到 $\zeta^4+\zeta^3+\zeta^2+\zeta^1+1=0.$ 因此 $$Q^*Q = \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ \end{bmatrix}= \begin{bmatrix} 5 & 0 & 0 & 0 & 0 \\ 0 & 5 & 0 & 0 & 0 \\ 0 & 0 & 5 & 0 & 0 \\ 0 & 0 & 0 & 5 & 0 \\ 0 & 0 & 0 & 0 & 5 \\ \end{bmatrix}. $$ 因此 $Q$ 存在反矩陣,$Q$ 可逆且其行向量集合是一組 $\mathbb{C}^5$ 的基底。 ##### Exercise 6(b) 說明 $Q$ 的每個行向量都是 $A$ 的特徵向量,並找出對應的特徵值。 利用這點將 $A$ 對角化。 :::warning - [x] 向量用粗體 ::: 答: 計算 $AQ=QD:$ $$\begin{aligned}AQ&= \begin{bmatrix} 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^6 & \zeta^8 \\ 1 & \zeta^3 & \zeta^6 & \zeta^9 & \zeta^{12} \\ 1 & \zeta^4 & \zeta^8 & \zeta^{12} & \zeta^{16} \\ \end{bmatrix}= \begin{bmatrix} 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ \end{bmatrix} \\ &= \begin{bmatrix} 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ 1 & 1 & 1 & 1 & 1 \end{bmatrix}= \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & \zeta^1 & \zeta^2 & \zeta^3 & \zeta^4 \\ 1 & \zeta^2 & \zeta^4 & \zeta^1 & \zeta^3 \\ 1 & \zeta^3 & \zeta^1 & \zeta^4 & \zeta^2 \\ 1 & \zeta^4 & \zeta^3 & \zeta^2 & \zeta^1 \\ \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & \zeta^1 & 0 & 0 & 0 \\ 0 & 0 & \zeta^2 & 0 & 0 \\ 0 & 0 & 0 & \zeta^3 & 0 \\ 0 & 0 & 0 & 0 & \zeta^4 \end{bmatrix}=QD. \end{aligned}$$ 令 $Q$ 的各行向量為 $\{\bv_1,\cdots,\bv_5\}$,則可找出特徵值依序為 $\{1,\zeta^1, \ldots,\zeta^4\}$ 與各行向量對應,組成對角矩陣 $D$,使得 $A$ 對角化為 $D$。 :::success 寫得很棒 :thumbsup: :u5272: ::: :::info 目前分數 = 6.5 &times; 檢討 = 6.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