Homework 11

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

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

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

AA=[1326][1236]=[10202040]det(AAλI)=[10λ202040λ]=0=(10λ)(40λ)(20)(20)=0=λ250λ=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 AAA^\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(AAλ1I)=rref[1002020400]=[1200]ker(AAλ1I)=ker[1200]=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, v1=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(AAλ2I)=rref[105020204050]=[11/200]ker(AAλ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, v2=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/51/51/52/5]=15[2112]\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, ui=1σiAvi\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 u2\vector{u}_2.

u2=152[1236]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 u1\vector{u}_1 such that it is orthogonal to u2\vector{u}_2. Since it’s just R2\R^2, we can just eyeball and make u1=110[31]\displaystyle\vector{u}_1 = \frac{1}{\sqrt{10}}\begin{bmatrix} 3 \\ 1 \end{bmatrix}.

Sanity check: u1,u2=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/101/101/103/10]=110[3113]\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=[1236]A=\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix} is:

A=UΣV=[3/101/101/103/10][00052][2/51/51/52/5]=110[3113][00052]15[2112]=[1236]\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) [21010111]\begin{bmatrix}2 & 1 & 0 & -1 \\0 & -1 & 1 & -1\end{bmatrix}

Let A=[21010111]A=\begin{bmatrix}2 & 1 & 0 & -1 \\0 & -1 & 1 & -1\end{bmatrix}.

AA=[4202221001112012]det(AAλI)=[4λ20222λ10011λ12012λ]=0=λ49λ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 AAA^\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(AAλ1I)=rref[40202220100110120120]=[101/21011100000000]ker(AAλ1I)=ker[101/21011100000000]=span{[1/2110],[1101]}\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[1101]\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(AAλ2I)=rref[43202223100113120123]=[1000010100110000]ker(AAλ2I)=ker[1000010100110000]=span{[0111]}\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, v2=13[0111]\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(AAλ3I)=rref[46202226100116120126]=[1002010100100000]ker(AAλ3I)=ker[1002010100100000]=span{[2101]}\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, v3=16[2101]\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/302/32/31/31/31/62/301/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, ui=1σiAvi\vector{u}_i = \displaystyle\frac{1}{\sigma_i}A\vector{v}_i for i=2,3i=2,3:

u2=13[21010111]13[0111]=[01]u3=16[21010111]16[2101]=[10]U=[0110]\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=[1236]A=\begin{bmatrix}1 & -2 \\-3 & 6\end{bmatrix} is:

A=UΣV=[0110][30000600][1/31/302/32/31/31/31/62/301/3001/31/31/6]=[0110][30000600][1/32/32/301/31/301/301/31/31/32/31/601/6]=[21010111]\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,yV,xyx, 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 xy(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=[211121112]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ΣVA = U\Sigma V^\top for

U=[1/21/61/302/31/31/21/61/3],Σ=[300030000],V=[1/21/61/302/31/31/21/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=[2101121001211012]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ΣVA = U\Sigma V^\top is given by:

U=V=[1/201/21/21/21/201/21/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,yV,xyx, 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|