skip to content

What does the singular value decomposition A = U S V^T tell you about a matrix A?

level: juniorimportance: must knowfreq 70%

answer

  1. rotate, stretch, rotate
  2. two orthonormal bases, one diagonal
  3. exists for every matrix, any shape
  4. diagonal entries are never negative
  5. count of nonzeros gives the rank

basics

~20 s

Every real matrix factors as A = U S V^T. U and V hold orthonormal directions in the output and input spaces, S is diagonal with non-negative singular values in descending order, and the number of nonzero ones equals the rank.

solid answer

~40 s

The SVD says any real m-by-n matrix A can be written A = U S V^T, where U is m-by-m orthogonal, V is n-by-n orthogonal, and S is m-by-n diagonal with non-negative entries sigma_1 >= sigma_2 >= ... >= 0 called singular values. Geometrically the map x -> Ax is a rotation or reflection by V^T, an axis-aligned scaling by the singular values, then another rotation or reflection by U: every linear map is rotate-stretch-rotate. The columns of V are the input directions that get stretched and the columns of U are where they land, linked by A v_i = sigma_i u_i. The count of nonzero singular values is the rank of A, and unlike eigenvalues, singular values always exist, are always real and are never negative, including for rectangular and singular matrices.

go deeper

for a junior

Be ready to state the shape of each factor and that S holds non-negative singular values in descending order. Knowing that every matrix, of any shape, has an SVD is usually enough at this stage.

for a middle

Explain the rotate-stretch-rotate geometry, why a rectangular map needs two different orthonormal bases, and how the number of nonzero singular values reads off the rank.

for a senior

Connect the decomposition to practice: which factors you keep for a compressed representation, why the largest singular value bounds amplification, and why near-zero singular values mark a numerically fragile matrix.

for a principal

Own the framing that the SVD is the one factorization that always exists, making it the safe default when you cannot assume squareness, symmetry or full rank, at the cost of being expensive on very large matrices.

## The statement For **any** real matrix A of shape m-by-n there exist matrices U, S, V such that `A = U S V^T` where U is m-by-m with orthonormal columns (`U^T U = I`), V is n-by-n with orthonormal columns (`V^T V = I`), and S is m-by-n, zero everywhere off the main diagonal, with diagonal entries `sigma_1 >= sigma_2 >= ... >= sigma_p >= 0` for `p = min(m, n)`. Those diagonal entries are the **singular values**; the columns of V are the **right singular vectors** and the columns of U the **left singular vectors**. No condition is attached. The matrix need not be square, symmetric, invertible or full rank. That unconditional existence is the single most useful thing about the SVD. ## What each factor means Read the factorization right to left as what happens to a vector x: 1. `V^T x` re-expresses x in the basis of right singular vectors. Because V is orthogonal this is a pure rotation (possibly with a reflection) — no stretching, no shearing. 2. Multiplying by S scales coordinate i by `sigma_i`, and pads or truncates to reach dimension m. 3. Multiplying by U rotates the result into the output space. So every linear map, however complicated it looks entrywise, is a **rotation, an axis-aligned stretch, and a rotation**. If you feed the unit sphere of inputs through A you get an ellipsoid; the singular values are the lengths of that ellipsoid's semi-axes and the columns of U are the directions those axes point. The pairing is captured by `A v_i = sigma_i u_i`: the i-th right singular vector is sent to the i-th left singular vector, stretched by `sigma_i`. ## What you read off it - **Rank.** The rank of A is exactly the number of nonzero singular values. This is the numerically trustworthy definition of rank: counting how many singular values sit above a sensible tolerance. - **Largest stretch.** `sigma_1 = max over ||x|| = 1 of ||A x||`, attained at `x = v_1`. This is the spectral norm of A. - **Smallest stretch.** For a square invertible A, `sigma_n` is the smallest stretch, and the ratio `sigma_1 / sigma_n` is the condition number, a bound on how badly A amplifies relative error. - **Layers.** Expanding the product gives `A = sigma_1 u_1 v_1^T + sigma_2 u_2 v_2^T + ...`, a sum of rank-1 pieces ordered by importance. Truncating that sum is the whole business of low-rank approximation. ## Full versus thin The **full** SVD keeps U at m-by-m and V at n-by-n, with S padded by zero rows or columns to be m-by-n. The **thin** or compact form keeps only the r columns of U and V that pair with nonzero singular values, giving `A = U_r S_r V_r^T` with S_r an invertible r-by-r diagonal. Both reproduce A exactly; the thin form simply drops the pieces that get multiplied by zero, and it is what is actually stored. ## Uniqueness The singular values themselves are unique. The singular vectors are not, in two ways. First, `u_i` and `v_i` can both be negated together without changing `sigma_i u_i v_i^T`. Second, if a singular value is repeated, any orthonormal rotation inside the corresponding subspace is equally valid. Vectors paired with zero singular values are almost entirely free. This matters when comparing two decompositions of the same matrix: expecting them to agree entry by entry is a mistake, but the singular values must agree. ## Why it is not an eigendecomposition An eigenvector satisfies `A v = lambda v`, which forces input and output to live in the same space, so only square matrices are candidates, and even then some square matrices cannot be diagonalized. The SVD sidesteps both problems by allowing two different orthonormal bases, V on the input side and U on the output side. That extra freedom is exactly what buys unconditional existence. ## Common mistakes Saying a singular value is negative (any sign is absorbed into U or V), claiming rectangular matrices have no SVD, and assuming the singular values of A are its eigenvalues. For a general square matrix the two sets are different quantities entirely.

  • Why can a rectangular matrix have an SVD but not an eigendecomposition?
    Eigenvectors require A v = lambda v, so input and output must live in the same space, which only square matrices satisfy, and even some square matrices are not diagonalizable. The SVD allows two different bases: V in the n-dimensional input space and U in the m-dimensional output space, connected by A v_i = sigma_i u_i. That extra freedom is why the factorization exists for every m-by-n matrix.
  • What is the difference between the full SVD and the thin SVD?
    The full form keeps U at m-by-m and V at n-by-n, padding S with zero rows or columns. The thin form keeps only the r columns of U and V paired with nonzero singular values, giving A = U_r S_r V_r^T with S_r an invertible r-by-r diagonal. Both reproduce A exactly; the thin form drops the parts multiplied by zero and is what you store.
  • What does the largest singular value of a matrix measure?
    sigma_1 is the largest factor by which A can stretch any unit vector: sigma_1 = max over ||x|| = 1 of ||A x||, attained at the first right singular vector v_1. It is the spectral norm of A, and the ratio of the largest to the smallest nonzero singular value is the condition number, which bounds how badly A can amplify relative error.

Feed the unit sphere of inputs through the matrix and it comes out an ellipsoid. The singular values are the lengths of that ellipsoid's semi-axes, and the columns of U are the directions the axes point.

saying these in an interview costs you the question

  • Says singular values can be negative
  • Claims only square matrices have an SVD
  • Treats singular values as the eigenvalues of A itself
  • Thinks U and V must be the same matrix
  • Assumes the singular vectors are always unique

context