Homework 11

1. Find the singular value decomposition of the following two matrices.

(a) [1−2−36]\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix}

Let A=[1−2−36]A=\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix}.

A⊤A=[1−3−26][1−2−36]=[10−20−2040]det⁡(A⊤A−λI)=[10−λ−20−2040−λ]=0=(10−λ)(40−λ)−(−20)(−20)=0=λ2−50λ=0=λ(λ−50)=0∴λ=0,50A^\top A=\begin{bmatrix} 1 & -3 \\ -2 & 6 \end{bmatrix}\begin{bmatrix} 1 & -2 \\ -3 & 6 \end{bmatrix} =\begin{bmatrix} 10 & -20 \\ -20 & 40 \end{bmatrix} \\ \begin{align*} \det(A^\top A-\lambda I) &= \begin{bmatrix} 10-\lambda & -20 \\ -20 & 40-\lambda \end{bmatrix} &= 0 \\ &= (10-\lambda)(40-\lambda) - (-20)(-20) &= 0 \\ &= \lambda^2 - 50\lambda &= 0 \\ &= \lambda(\lambda - 50) &= 0 \end{align*} \\ \therefore \lambda = 0, 50

λ1=0\lambda_1 = 0 and λ2=50\lambda_2=50 are the eigenvalues of A⊤AA^\top A.

λ1=0  ⟹  σ1=0λ2=50  ⟹  σ2=50=52∴Σ=[00052]\begin{array}{c} \lambda_1 = 0 &\implies &\sigma_1 = 0 \\ \lambda_2 = 50 &\implies &\sigma_2 = \sqrt{50} = 5\sqrt{2} \end{array} \\[1em] \boxed{\therefore\Sigma = \begin{bmatrix} 0 & 0 \\ 0 & 5\sqrt{2} \end{bmatrix} }

And so:

rref⁡(A⊤A−λ1I)=rref⁡[10−0−20−2040−0]=[1−200]∴ker⁡(A⊤A−λ1I)=ker⁡[1−200]=span⁡{ [21] }\operatorname{rref}(A^\top A - \lambda_1 I) = \operatorname{rref} \begin{bmatrix} 10-0 & -20 \\ -20 & 40-0 \end{bmatrix} = \begin{bmatrix} 1 & -2 \\ 0 & 0 \end{bmatrix} \\ \therefore \ker(A^\top A - \lambda_1 I) = \ker\begin{bmatrix} 1 & -2 \\ 0 & 0 \end{bmatrix} = \operatorname{span}\Set{ \begin{bmatrix} 2 \\ 1 \end{bmatrix} }

As such, v⃗1=15[21]\vector{v}_1 = \displaystyle\frac{1}{\sqrt{5}}\begin{bmatrix} 2 \\ 1 \end{bmatrix} is an eigenvector corresponding to λ1=0\lambda_1=0.

rref⁡(A⊤A−λ2I)=rref⁡[10−50−20−2040−50]=[11/200]∴ker⁡(A⊤A−λ2I)=ker⁡[11/200]=span⁡{ [−1/21] }\operatorname{rref}(A^\top A - \lambda_2 I) = \operatorname{rref} \begin{bmatrix} 10-50 & -20 \\ -20 & 40-50 \end{bmatrix} = \begin{bmatrix} 1 & 1/2 \\ 0 & 0 \end{bmatrix} \\ \therefore \ker(A^\top A - \lambda_2 I) = \ker\begin{bmatrix} 1 & 1/2 \\ 0 & 0 \end{bmatrix} = \operatorname{span}\Set{ \begin{bmatrix} -1/2 \\ 1 \end{bmatrix} }

As such, v⃗2=25[−1/21]\vector{v}_2 = \displaystyle\frac{2}{\sqrt{5}}\begin{bmatrix} -1/2 \\ 1 \end{bmatrix} is an eigenvector corresponding to λ2=50\lambda_2=50.

∴V=[2/5−1/51/52/5]=15[2−112]\boxed{ \therefore V = \begin{bmatrix} 2/\sqrt{5} & -1/\sqrt{5} \\ 1/\sqrt{5} & 2/\sqrt{5} \end{bmatrix} = \frac{1}{\sqrt{5}} \begin{bmatrix} 2 & -1 \\ 1 & 2 \end{bmatrix} }

Then, u⃗i=1σiAv⃗i\vector{u}_i = \displaystyle\frac{1}{\sigma_i}A\vector{v}_i for i=1,2i=1,2:

Note σ1=0\sigma_1 = 0, so we move on to u⃗2\vector{u}_2.

u⃗2=152[1−2−36]25[−1/21]=110[−13]\begin{align*} \vector{u}_2 &= \frac{1}{5\sqrt{2}}\begin{bmatrix} 1 & -2 \\ -3 & 6 \end{bmatrix} \frac{2}{\sqrt{5}}\begin{bmatrix} -1/2 \\ 1 \end{bmatrix} \\ &= \frac{1}{\sqrt{10}}\begin{bmatrix} -1 \\ 3 \end{bmatrix} \end{align*}

Since σ1=0\sigma_1=0 and we need one more vector, we need to choose a vector u⃗1\vector{u}_1 such that it is orthogonal to u⃗2\vector{u}_2. Since it’s just R2\R^2, we can just eyeball and make u⃗1=110[31]\displaystyle\vector{u}_1 = \frac{1}{\sqrt{10}}\begin{bmatrix} 3 \\ 1 \end{bmatrix}.

Sanity check: ⟨u⃗1,u⃗2⟩=110((−1)(3)+3(1))=0\displaystyle\langle\vector{u}_1,\vector{u}_2\rangle = \frac{1}{\sqrt{10}}((-1)(3) + 3(1)) = 0.

∴U=[3/10−1/101/103/10]=110[3−113]\boxed{ \therefore U = \begin{bmatrix} 3/\sqrt{10} & -1/\sqrt{10} \\ 1/\sqrt{10} & 3/\sqrt{10} \end{bmatrix} = \frac{1}{\sqrt{10}} \begin{bmatrix} 3 & -1 \\ 1 & 3 \end{bmatrix} }

And so, we have that the SVD for A=[1−2−36]A=\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix} is:

A=UΣV⊤=[3/10−1/101/103/10][00052][2/5−1/51/52/5]⊤=110[3−113][00052]15[21−12]=[1−2−36]\begin{align*} A &= U\Sigma V^\top \\ &= \begin{bmatrix} 3/\sqrt{10} & -1/\sqrt{10} \\ 1/\sqrt{10} & 3/\sqrt{10} \end{bmatrix}\begin{bmatrix} 0 & 0 \\ 0 & 5\sqrt{2} \end{bmatrix}\begin{bmatrix} 2/\sqrt{5} & -1/\sqrt{5} \\ 1/\sqrt{5} & 2/\sqrt{5} \end{bmatrix}^\top \\ &= \frac{1}{\sqrt{10}}\begin{bmatrix} 3 & -1 \\ 1 & 3 \end{bmatrix}\begin{bmatrix} 0 & 0 \\ 0 & 5\sqrt{2} \end{bmatrix}\frac{1}{\sqrt{5}}\begin{bmatrix} 2 & 1 \\ -1 & 2 \end{bmatrix} \\ &= \begin{bmatrix} 1 & -2 \\ -3 & 6 \end{bmatrix} \end{align*}

(b) [210−10−11−1]\begin{bmatrix}2 & 1 & 0 & -1 \\0 & -1 & 1 & -1\end{bmatrix}

Let A=[210−10−11−1]A=\begin{bmatrix}2 & 1 & 0 & -1 \\0 & -1 & 1 & -1\end{bmatrix}.

A⊤A=[420−222−100−11−1−20−12]det⁡(A⊤A−λI)=[4−λ20−222−λ−100−11−λ−1−20−12−λ]=0=λ4−9λ3+18λ2=0=λ2(λ−3)(λ−6)=0∴λ=0,3,6A^\top A = \begin{bmatrix} 4 & 2 & 0 & -2 \\ 2 & 2 & -1 & 0 \\ 0 & -1 & 1 & -1 \\ -2 & 0 & -1 & 2 \end{bmatrix} \\ \begin{align*} \det(A^\top A-\lambda I) &= \begin{bmatrix} 4-\lambda & 2 & 0 & -2 \\ 2 & 2-\lambda & -1 & 0 \\ 0 & -1 & 1-\lambda & -1 \\ -2 & 0 & -1 & 2-\lambda \end{bmatrix} &= 0 \\ &= \lambda^4 - 9\lambda^3 + 18\lambda^2 &= 0 \\ &= \lambda^2(\lambda - 3)(\lambda - 6) &= 0 \end{align*} \\ \therefore \lambda = 0,3,6

λ1=0\lambda_1=0, λ2=3\lambda_2=3, and λ3=6\lambda_3=6 are eigenvalues of A⊤AA^\top A.

λ1=0  ⟹  σ1=0λ2=3  ⟹  σ2=3λ3=6  ⟹  σ3=6∴Σ=[30000600]\begin{array}{c} \lambda_1 = 0 &\implies &\sigma_1 = 0 \\ \lambda_2 = 3 &\implies &\sigma_2 = \sqrt{3} \\ \lambda_3 = 6 &\implies &\sigma_3 = \sqrt{6} \end{array} \\[1em] \boxed{ \therefore\Sigma = \begin{bmatrix} \sqrt{3} & 0 & 0 & 0 \\ 0 & \sqrt{6} & 0 & 0 \end{bmatrix} }

And so:

rref⁡(A⊤A−λ1I)=rref⁡[4−020−222−0−100−11−0−1−20−12−0]=[101/2−101−1100000000]∴ker⁡(A⊤A−λ1I)=ker⁡[101/2−101−1100000000]=span⁡{ [−1/2110],[1−101] }\operatorname{rref}(A^\top A - \lambda_1 I) = \operatorname{rref} \begin{bmatrix} 4-0 & 2 & 0 & -2 \\ 2 & 2-0 & -1 & 0 \\ 0 & -1 & 1-0 & -1 \\ -2 & 0 & -1 & 2-0 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 1/2 & -1 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \\ \therefore \ker(A^\top A - \lambda_1 I) = \ker\begin{bmatrix} 1 & 0 & 1/2 & -1 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} = \operatorname{span}\Set{ \begin{bmatrix} -1/2 \\ 1 \\ 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 1 \\ -1 \\ 0 \\ 1 \end{bmatrix} }

As such, 23[−1/2110],13[1−101]\displaystyle\frac{2}{3}\begin{bmatrix} -1/2 \\ 1 \\ 1 \\ 0 \end{bmatrix},\frac{1}{\sqrt{3}} \begin{bmatrix} 1 \\ -1 \\ 0 \\ 1 \end{bmatrix} are eigenvectors corresponding to λ1=0\lambda_1=0.

rref⁡(A⊤A−λ2I)=rref⁡[4−320−222−3−100−11−3−1−20−12−3]=[1000010−100110000]∴ker⁡(A⊤A−λ2I)=ker⁡[1000010−100110000]=span⁡{ [01−11] }\operatorname{rref}(A^\top A - \lambda_2 I) = \operatorname{rref} \begin{bmatrix} 4-3 & 2 & 0 & -2 \\ 2 & 2-3 & -1 & 0 \\ 0 & -1 & 1-3 & -1 \\ -2 & 0 & -1 & 2-3 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} \\ \therefore \ker(A^\top A - \lambda_2 I) = \ker\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} = \operatorname{span}\Set{ \begin{bmatrix} 0 \\ 1 \\ -1 \\ 1 \end{bmatrix} }

As such, v⃗2=13[01−11]\vector{v}_2 = \displaystyle\frac{1}{\sqrt{3}}\begin{bmatrix} 0 \\ 1 \\ -1 \\ 1 \end{bmatrix} is an eigenvector corresponding to λ2=3\lambda_2=3.

rref⁡(A⊤A−λ3I)=rref⁡[4−620−222−6−100−11−6−1−20−12−6]=[1002010100100000]∴ker⁡(A⊤A−λ3I)=ker⁡[1002010100100000]=span⁡{ [−2−101] }\operatorname{rref}(A^\top A - \lambda_3 I) = \operatorname{rref} \begin{bmatrix} 4-6& 2 & 0 & -2 \\ 2 & 2-6& -1 & 0 \\ 0 & -1 & 1-6& -1 \\ -2 & 0 & -1 & 2-6 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \\ \therefore \ker(A^\top A - \lambda_3 I) = \ker\begin{bmatrix} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} = \operatorname{span}\Set{ \begin{bmatrix} -2 \\ -1 \\ 0 \\ 1 \end{bmatrix} }

As such, v⃗3=16[−2−101]\vector{v}_3 = \displaystyle\frac{1}{\sqrt{6}} \begin{bmatrix} -2 \\ -1 \\ 0 \\ 1 \end{bmatrix} is an eigenvector corresponding to λ3=6\lambda_3=6.

∴V=[−1/31/30−2/32/3−1/31/3−1/62/30−1/3001/31/31/6]  \boxed{ \therefore V = \begin{bmatrix} -1/3 & 1/\sqrt{3} & 0 &-\sqrt{2/3} \\ 2/3 & -1/\sqrt{3} & 1/\sqrt{3} & -1/\sqrt{6} \\ 2/3 & 0 & -1/\sqrt{3} & 0 \\ 0 & 1/\sqrt{3} & 1/\sqrt{3} & 1/\sqrt{6} \end{bmatrix} }\\ \;

Then, u⃗i=1σiAv⃗i\vector{u}_i = \displaystyle\frac{1}{\sigma_i}A\vector{v}_i for i=2,3i=2,3:

u⃗2=13[210−10−11−1]13[01−11]=[0−1]u⃗3=16[210−10−11−1]16[−2−101]=[−10]∴U=[0−1−10]\begin{align*} \vector{u}_2 &= \frac{1}{\sqrt{3}}\begin{bmatrix} 2 & 1 & 0 & -1 \\ 0 & -1 & 1 & -1 \end{bmatrix} \frac{1}{\sqrt{3}}\begin{bmatrix} 0 \\ 1 \\ -1 \\ 1 \end{bmatrix} \\ &= \begin{bmatrix} 0 \\ -1 \end{bmatrix} \\ \vector{u}_3 &= \frac{1}{\sqrt{6}}\begin{bmatrix} 2 & 1 & 0 & -1 \\ 0 & -1 & 1 & -1 \end{bmatrix}\frac{1}{\sqrt{6}} \begin{bmatrix} -2 \\ -1 \\ 0 \\ 1 \end{bmatrix} \\ &= \begin{bmatrix} -1 \\ 0 \end{bmatrix} \end{align*} \\[1em] \boxed{ \therefore U = \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} }

And so, we have that the SVD for A=[1−2−36]A=\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix} is:

A=UΣV⊤=[0−1−10][30000600][−1/31/30−2/32/3−1/31/3−1/62/30−1/3001/31/31/6]⊤=[0−1−10][30000600][−1/32/32/301/3−1/301/301/3−1/31/3−2/3−1/601/6]=[210−10−11−1]\begin{align*} A &= U\Sigma V^\top \\ &= \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} \begin{bmatrix} \sqrt{3} & 0 & 0 & 0 \\ 0 & \sqrt{6} & 0 & 0 \end{bmatrix} \begin{bmatrix} -1/3 & 1/\sqrt{3} & 0 &-\sqrt{2/3} \\ 2/3 & -1/\sqrt{3} & 1/\sqrt{3} & -1/\sqrt{6} \\ 2/3 & 0 & -1/\sqrt{3} & 0 \\ 0 & 1/\sqrt{3} & 1/\sqrt{3} & 1/\sqrt{6} \end{bmatrix}^\top \\ &= \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} \begin{bmatrix} \sqrt{3} & 0 & 0 & 0 \\ 0 & \sqrt{6} & 0 & 0 \end{bmatrix} \begin{bmatrix} -1/3 & 2/3 & 2/3 & 0 \\ 1/\sqrt{3} & -1/\sqrt{3} & 0 & 1/\sqrt{3} \\ 0 & 1/\sqrt{3} & -1/\sqrt{3} & 1/\sqrt{3} \\ -\sqrt{2/3} & -1/\sqrt{6} & 0 & 1/\sqrt{6} \end{bmatrix} \\ &= \begin{bmatrix} 2 & 1 & 0 & -1 \\ 0 & -1 & 1 & -1 \end{bmatrix} \end{align*}

2. A famous application of spectral theorem and SVD is the spectral graph theory. A graph (V,E)(V, E) is a set of vertices VV with edge set EE. We say that for x,y∈V,x∼yx, y \in V , x \sim y if xx and yy are connected by an edge in EE. The Graph Laplacian is defined to be a matrix AA of size ∣V∣×∣V∣|V|\times|V|

Ax,y={1if x∼y−(number of edges starting from x)if x=y0otherwiseA_{x,y} = \begin{cases} 1 & \text{if $x \sim y$} \\ -\text{(number of edges starting from $x$)} & \text{if $x = y$} \\ 0 & \text{otherwise} \end{cases}

For example, a triangle with three vertices

A=[−2111−2111−2]A = \begin{bmatrix} -2 & 1 & 1 \\ 1 & -2 & 1 \\ 1 & 1 & -2 \end{bmatrix}

(a) Find the SVD for the Laplacian of the triangle graph.

Using an online calculator, we find A=UΣV⊤A = U\Sigma V^\top for

U=[1/21/61/30−2/31/3−1/21/61/3],Σ=[300030000],V=[−1/2−1/61/302/31/31/2−1/61/3].U = \begin{bmatrix} 1/\sqrt{2} & 1/\sqrt{6} & 1/\sqrt{3} \\ 0 & -\sqrt{2/3} & 1/\sqrt{3} \\ -1/\sqrt{2} & 1/\sqrt{6} & 1/\sqrt{3} \end{bmatrix},\quad \Sigma = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 0 \end{bmatrix},\quad V = \begin{bmatrix} -1/\sqrt{2} & -1/\sqrt{6} & 1/\sqrt{3} \\ 0 & \sqrt{2/3} & 1/\sqrt{3} \\ 1/\sqrt{2} & -1/\sqrt{6} & 1/\sqrt{3} \end{bmatrix}.

(b) Write down the graph Laplacian matrix for the square graph and then find its SVD.

Using the definition above, the Laplacian matrix AA for a square graph is:

A=[2−10−1−12−100−12−1−10−12]A = \begin{bmatrix} 2 & -1 & 0 & -1 \\ -1 & 2 & -1 & 0 \\ 0 & -1 & 2 & -1 \\ -1 & 0 & -1 & 2 \end{bmatrix}

Again, sparing the computation. The SVD for the square graph A=UΣV⊤A = U\Sigma V^\top is given by:

U=V=[−1/20−1/21/21/2−1/201/2−1/201/21/21/21/201/2],Σ=[4000020000200000]U = V = \begin{bmatrix} -1/2 & 0 & -1/\sqrt{2} & 1/2 \\ 1/2 & -1/\sqrt{2} & 0 & 1/2 \\ -1/2 & 0 & 1/\sqrt{2} & 1/2 \\ 1/2 & 1/\sqrt{2} & 0 & 1/2 \end{bmatrix},\quad \Sigma = \begin{bmatrix} 4 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix}

Homework 11

  1. Find the singular value decomposition of the following two matrices.
  1. A famous application of spectral theorem and SVD is the spectral graph theory. A graph (V,E)(V, E) is a set of vertices VV with edge set EE. We say that for x,y∈V,x∼yx, y \in V , x \sim y if xx and yy are connected by an edge in EE. The Graph Laplacian is defined to be a matrix AA of size ∣V∣×∣V∣|V|\times|V|
≡