Solution
(i) To compute the singular value decomposition of
$$ X = \begin{bmatrix} 1 & 0 \\\\ 0 & 1 \\\\ 2 & -1 \\\\ 2 & 2 \end{bmatrix} $$
we begin by forming the matrix \(X^T X\), since its eigenvalues give the squared singular values of \(X\):
$$ X^T X = \begin{bmatrix} 1^2 + 0^2 + 2^2 + 2^2 & 1\cdot 0 + 0\cdot 1 + 2(-1) + 2\cdot 2 \\\\[6pt] 1\cdot 0 + 0\cdot 1 + 2(-1) + 2\cdot 2 & 0^2 + 1^2 + (-1)^2 + 2^2 \end{bmatrix} = \begin{bmatrix} 9 & 2 \\\\[4pt] 2 & 6 \end{bmatrix} $$
To find the singular values, we compute the eigenvalues of this \(2\times 2\) matrix. Its characteristic polynomial is
$$ p(\lambda) = \begin{vmatrix} 9 - \lambda & 2 \\\\ 2 & 6 - \lambda \end{vmatrix} = (9-\lambda)(6-\lambda) - 4 = \lambda^2 - 15 \lambda + 50 $$
This factors as
$$ p(\lambda) = \lambda^2 - 15 \lambda + 50 = (\lambda - 10)(\lambda - 5) $$
so the two eigenvalues are \(\lambda_1 = 10\) and \(\lambda_2 = 5\). The singular values of \(X\) are therefore
$$ \sigma_1 = \sqrt{10} \qquad \sigma_2 = \sqrt{5} $$
and so we’ve found one piece of the puzzle:
$$ \boxed{\Sigma = \begin{bmatrix} \sqrt{10} & 0 \\\\ 0 & \sqrt{5} \\\\ 0 & 0 \\\\ 0 & 0 \end{bmatrix}} $$
(Remember that \(\Sigma\) is diagonal but also the same shape as \(X\), hence the extra \(0\)’s.)
To compute the right singular vectors (i.e. the \(\vec v_i\)’s), we find eigenvectors of \(X^T X\) corresponding to the eigenvalues \(\lambda_1 = 10\) and \(\lambda_2 = 5\). Recall that
$$ X^T X = \begin{bmatrix} 9 & 2 \\\\ 2 & 6 \end{bmatrix} $$
Right singular vector for \(\lambda_1 = 10\):
$$ (X^T X - 10I) \vec v_1 = 0 $$
$$ \begin{bmatrix} 9 - 10 & 2 \\\\ 2 & 6 - 10 \end{bmatrix} \begin{bmatrix} x \\\\ y \end{bmatrix} = \begin{bmatrix} -1 & 2 \\\\ 2 & -4 \end{bmatrix} \begin{bmatrix} x \\\\ y \end{bmatrix} = \begin{bmatrix} 0 \\\\ 0 \end{bmatrix} $$
The first row gives \(-x + 2y = 0\), so \(x = 2y\). Thus an eigenvector is
$$ \vec v_1 = \begin{bmatrix} 2 \\\\ 1 \end{bmatrix} $$
Normalizing gives \(\vec v_1 = \begin{bmatrix} \frac{2}{\sqrt{5}} \\ \frac{1}{\sqrt{5}} \end{bmatrix}\).
Right singular vector for \(\lambda_2 = 5\):
$$ (X^T X - 5I) \vec v_2 = 0 $$
$$ \begin{bmatrix} 9 - 5 & 2 \\\\ 2 & 6 - 5 \end{bmatrix} \begin{bmatrix} x \\\\ y \end{bmatrix} = \begin{bmatrix} 4 & 2 \\\\ 2 & 1 \end{bmatrix} \begin{bmatrix} x \\\\ y \end{bmatrix} = \begin{bmatrix} 0 \\\\ 0 \end{bmatrix} $$
The first row gives \(4x + 2y = 0\), so \(y = -2x\). Thus an eigenvector is
$$ \vec v_2 = \begin{bmatrix} 1 \\\\[4pt] -2 \end{bmatrix} $$
Normalizing gives \(\vec v_2 = \begin{bmatrix} \frac{1}{\sqrt{5}} \\ -\frac{2}{\sqrt{5}} \end{bmatrix}\). Note that we could have found this vector just by finding a vector orthogonal to \(\vec v_1\) and normalizing it, since the columns of \(V\) must be orthonormal.
So, \(V\) is
$$ V = \begin{bmatrix} \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \\\\ \frac{1}{\sqrt{5}} & -\frac{2}{\sqrt{5}} \end{bmatrix} \implies \boxed{V^T = \begin{bmatrix} \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \\\\ \frac{1}{\sqrt{5}} & -\frac{2}{\sqrt{5}} \end{bmatrix}} $$
Almost there!
Left singular vectors: the defining SVD identity \(X \vec v_i = \sigma_i \vec u_i\) allows us to compute each \(\vec u_i\) explicitly.
For \(\vec u_1\),
$$ X \vec v_1 = \begin{bmatrix} 1 & 0 \\\\ 0 & 1 \\\\ 2 & -1 \\\\ 2 & 2 \end{bmatrix} \begin{bmatrix} \frac{2}{\sqrt{5}} \\\\[4pt] \frac{1}{\sqrt{5}} \end{bmatrix} = \begin{bmatrix} \frac{2}{\sqrt{5}} \\\\ \frac{1}{\sqrt{5}} \\\\ \frac{2(2) - 1}{\sqrt{5}} \\\\ \frac{2(2) + 2}{\sqrt{5}} \end{bmatrix} = \frac{1}{\sqrt{5}} \begin{bmatrix} 2 \\\\[4pt] 1 \\\\[4pt] 3 \\\\[4pt] 6 \end{bmatrix} $$
Since \(\sigma_1 = \sqrt{10}\), we divide to obtain
$$ \vec u_1 = \frac{1}{\sigma_1} X v_1 = \frac{1}{\sqrt{10}} \cdot \frac{1}{\sqrt{5}} \begin{bmatrix} 2 \\\\ 1 \\\\ 3 \\\\ 6 \end{bmatrix} = \frac{1}{\sqrt{50}} \begin{bmatrix} 2 \\\\ 1 \\\\ 3 \\\\ 6 \end{bmatrix} $$
For \(\vec u_2\),
$$ X \vec v_2 = \begin{bmatrix} 1 & 0 \\\\ 0 & 1 \\\\ 2 & -1 \\\\ 2 & 2 \end{bmatrix} \begin{bmatrix} -\frac{1}{\sqrt{5}} \\\\[4pt] \frac{2}{\sqrt{5}} \end{bmatrix} = \frac{1}{\sqrt{5}} \begin{bmatrix} -1 \\\\ 2 \\\\ -(2)(1) - 2 \\\\ 2(-1) + 4 \end{bmatrix} = \frac{1}{\sqrt{5}} \begin{bmatrix} -1 \\\\[4pt] 2 \\\\[4pt] -4 \\\\[4pt] 2 \end{bmatrix} $$
Since \(\sigma_2 = \sqrt{5}\), dividing gives
$$ \vec u_2 = \frac{1}{\sigma_2} X \vec v_2 = \frac{1}{\sqrt{5}} \cdot \frac{1}{\sqrt{5}} \begin{bmatrix} -1 \\\\ 2 \\\\ -4 \\\\ 2 \end{bmatrix} = \frac{1}{5} \begin{bmatrix} -1 \\\\ 2 \\\\ -4 \\\\ 2 \end{bmatrix} $$
Both \(\vec u_1\) and \(\vec u_2\) are already unit vectors, which we expect from the definition of the SVD, given that we started with unit vectors \(\vec v_1\) and \(\vec v_2\).
Since \(X\) is a \(4\times 2\) matrix, the full SVD requires a \(4\times 4\) orthogonal matrix \(U\). We’ve used
$$ X \vec v_i = \sigma_i \vec u_i $$
to find the first two columns of \(U\), but this won’t work any further, since \(X\) has no more non-zero singular values. Instead, we look for vectors \(\vec u_3\) and \(\vec u_4\) that are (1) in \(\text{nullsp}(X^T)\) and (2) orthogonal to each other, as we first saw in Chapter 10.1.
Recall,
$$ X = \begin{bmatrix} 1 & 0 \\\\ 0 & 1 \\\\ 2 & -1 \\\\ 2 & 2 \end{bmatrix} \implies X^T = \begin{bmatrix} 1 & 0 & 2 & 2 \\\\ 0 & 1 & -1 & 2 \end{bmatrix} $$
We could solve a system of equations to find vectors that span \(\text{nullsp}(X^T)\), but we’ve chosen numbers that are small enough to reason through without needing to do that. Since \(\text{rank}(X) = 2\), we know that \(\text{nullsp}(X^T)\) is of dimension \(4 - 2 = 2\), so it is spanned by two vectors.
The first and second columns of \(X^T\) are the standard basis vectors in \(\mathbb{R}^2\). The third column of \(X^T\) is \(2 \cdot \text{column 1} - \text{column 2}\), and the fourth column of \(X^T\) is \(2 \cdot \text{column 1} + \text{column 2}\). This tells us the vectors
$$ \vec n_1 = \begin{bmatrix} 2 \\\\ -1 \\\\ -1 \\\\ 0 \end{bmatrix}, \vec n_2 = \begin{bmatrix} 2 \\\\ 2 \\\\ 0 \\\\ -1 \end{bmatrix} $$
span \(\text{nullsp}(X^T)\). We can’t place these in \(U\) directly, since they need to be orthogonal to one another, which they are not currently. (Though, they are automatically orthogonal to \(\vec u_1\) and \(\vec u_2\) as a consequence of the spectral theorem, which says that eigenvectors corresponding to different eigenvalues are orthogonal for symmetric matrices, and \(XX^T\) is symmetric. Remember that the \(\vec u_i\)’s are eigenvectors of \(XX^T\), not \(X^TX\).)
To make them orthogonal while preserving their span, we can use the Gram-Schmidt process. Since we only have two vectors, this boils down to keeping \(\vec n_1\) and computing the error of the projection of \(\vec n_2\) onto \(\vec n_1\), which must be orthogonal to \(\vec n_1\).
First, let’s find \(\vec u_3\) by normalizing \(\vec n_1\):
$$ \|\vec n_1\| = \sqrt{(-2)^2 + 1^2 + 1^2} = \sqrt{6} \qquad \vec u_3 = \frac{1}{\sqrt{6}} \begin{bmatrix} 2\\\\ -1\\\\ -1\\\\ 0 \end{bmatrix} $$
Next, we find the error of the projection of \(\vec n_2\) onto \(\vec u_3\).
$$ \begin{align*} \vec e &= \vec n_2 - \text{proj}_{\vec u_3}(\vec n_2) \\\\ &= \vec n_2 - (\vec u_3 \cdot \vec n_2) \vec u_3 \\\\ &= \begin{bmatrix} 2 \\\\ 2 \\\\ 0 \\\\ -1 \end{bmatrix} - \left( \frac{1}{\sqrt{6}} \begin{bmatrix} 2 \\\\ -1 \\\\ -1 \\\\ 0 \end{bmatrix} \cdot \begin{bmatrix} 2 \\\\ 2 \\\\ 0 \\\\ -1 \end{bmatrix} \right) \frac{1}{\sqrt{6}} \begin{bmatrix} 2 \\\\ -1 \\\\ -1 \\\\ 0 \end{bmatrix} \\\\ &= \begin{bmatrix} 2 \\\\ 2 \\\\ 0 \\\\ -1 \end{bmatrix} - \frac{1}{3} \begin{bmatrix} 2 \\\\ -1 \\\\ -1 \\\\ 0 \end{bmatrix} \\\\ &= \begin{bmatrix} 4/3 \\\\ 7/3 \\\\ 1/3 \\\\ -1 \end{bmatrix} \end{align*} $$
As a unit vector, this is
$$ \vec u_4 = \frac{\vec e}{\lVert \vec e \rVert} = \frac{1}{5\sqrt{3}} \begin{bmatrix} 4\\\\ 7\\\\ 1\\\\ -3 \end{bmatrix} $$
With these two additional vectors, the full \(U\) matrix is
$$ U = \begin{bmatrix} \frac{2}{\sqrt{50}} & -\frac{1}{5} & \frac{2}{\sqrt{6}} & \frac{4}{5\sqrt{3}} \\\\[6pt] \frac{1}{\sqrt{50}} & \frac{2}{5} & -\frac{1}{\sqrt{6}} & \frac{7}{5\sqrt{3}} \\\\[6pt] \frac{3}{\sqrt{50}} & -\frac{4}{5} & -\frac{1}{\sqrt{6}} & \frac{1}{5\sqrt{3}} \\\\[6pt] \frac{6}{\sqrt{50}} & \frac{2}{5} & 0 & -\frac{3}{5\sqrt{3}} \end{bmatrix} $$
which is now a complete orthonormal basis of \(\mathbb{R}^4\). These were not the only two choices of \(\vec u_3\) and \(\vec u_4\): there are infinitely many orthonormal bases for \(\text{nullsp}(X^T)\), and any of them could have been used.
So, finally, the SVD of \(X = \begin{bmatrix} 1 & 0\\ 0 & 1\\ 2 & -1\\ 2 & 2 \end{bmatrix}\) is:
$$ X = \underbrace{ \begin{bmatrix} \frac{2}{\sqrt{50}} & -\frac{1}{5} & \frac{2}{\sqrt{6}} & \frac{4}{5\sqrt{3}} \\\\[6pt] \frac{1}{\sqrt{50}} & \frac{2}{5} & -\frac{1}{\sqrt{6}} & \frac{7}{5\sqrt{3}} \\\\[6pt] \frac{3}{\sqrt{50}} & -\frac{4}{5} & -\frac{1}{\sqrt{6}} & \frac{1}{5\sqrt{3}} \\\\[6pt] \frac{6}{\sqrt{50}} & \frac{2}{5} & 0 & -\frac{3}{5\sqrt{3}} \end{bmatrix} }_{U} \; \underbrace{ \begin{bmatrix} \sqrt{10} & 0 \\\\ 0 & \sqrt{5} \\\\ 0 & 0 \\\\ 0 & 0 \end{bmatrix} }_{\Sigma} \; \underbrace{ \begin{bmatrix} \frac{2}{\sqrt{5}} & \frac{1}{\sqrt{5}} \\\\ \frac{1}{\sqrt{5}} & -\frac{2}{\sqrt{5}} \end{bmatrix} }_{V^T} $$
(ii) Observe that no new computation is needed to obtain the SVD of \(X^T\). Transposing the decomposition \(X = U \Sigma V^T\) gives
$$ X^T = V \Sigma U^T, $$
which is already an SVD because \(\Sigma\) is diagonal and both \(U\) and \(V\) are orthonormal. Thus the left singular vectors of \(X\) become the right singular vectors of \(X^T\), the right singular vectors of \(X\) become the left singular vectors of \(X^T\), and the singular values remain unchanged. This reuse of the original computation highlights the symmetry built into the singular value decomposition.