The matrix \(A\) is \(3\times 2\text{.}\) The reduced SVD returns two singular values because
\begin{equation*}
\min(3,2)=2.
\end{equation*}
The array s stores only the diagonal entries of \(\Sigma\text{,}\) not the full diagonal matrix, so its shape is (2,). The array Vt represents \(V^T\text{.}\) With full_matrices=False, NumPy returns the reduced SVD shapes needed for reconstruction:
The vector v is the first right singular vector \(\mathbf{v}_1\text{.}\) The array lhs computes \(A\mathbf{v}_1\text{.}\) The array rhs computes \(\sigma_1\mathbf{u}_1\text{.}\) The value True means that the numerical computation agrees with
Squared singular values measure squared stretch and are used for the energy calculation. For \(k=1\text{,}\) the retained energy is approximately
\begin{equation*}
0.8544.
\end{equation*}
For \(k=2\text{,}\) the retained energy is approximately
\begin{equation*}
0.9911.
\end{equation*}
The smallest \(k\) retaining at least \(90\%\) of the energy is
\begin{equation*}
k=2.
\end{equation*}
A rank-2 reconstruction keeps the directions corresponding to singular values \(10\) and \(4\text{,}\) and discards the smaller directions corresponding to singular values \(1\) and \(0.2\text{.}\)
After the first two factors are multiplied, the result has shape \(2\times 1\text{,}\) which cannot be multiplied by a \(2\times 1\) matrix on the right.
The mathematical mistake is that columns of \(V^T\) are not the transposed right singular vectors used in the reconstruction. The rows of \(V^T\) are the transposed right singular vectors, so the correct slice is Vt[:k, :].
. The core path practices SVD shapes, singular values, singular-vector identities, rank and null directions, redundant features, energy retained, rank-\(k\) reconstruction, compression on a small matrix, low-rank update shapes, and review code-reading checks. The activities above prepare you to read the notebook outputs as mathematical statements.
For a quick reference on SVD commands, diagonal matrices, slices, matrix multiplication, and numerical checks such as np.allclose, see the programming appendix sections B.10, B.8, B.3, B.4, and B.9.
Interpretation check. Given singular values, choose \(k\) to retain a specified percentage of energy. Explain what information is discarded when small singular values are removed. Tags.[U6-LO6, U6-LO7 | C+M+T | Core]
Exam skill. Read a short SVD computation and explain singular values, rank, retained energy, forgotten directions, and rank-\(k\) reconstruction without coding the SVD from scratch. Tags.[U6-LO4, U6-LO5, U6-LO6, U6-LO7 | C+M+T | Core]