Ma · Mathematics

How to Solve Homogeneous Equations with the SVD

Published By the 9to5Science editorial team

At a glance

  1. 1. Write the SVD

    Factor the matrix as A = UΣVᵀ.

  2. 2. Change coordinates

    Set x = Vz, so Ax = 0 becomes Σz = 0.

  3. 3. Find zero singular values

    Set coordinates corresponding to zero singular values freely and the others to zero.

  4. 4. Transform back

    The null space is spanned by the corresponding columns of V.

A homogeneous linear system has the form

Ax=0,A x=0,

where AA is an m×nm\times n matrix and x∈Rnx\in\mathbb{R}^n. The singular value decomposition (SVD) gives a direct way to identify every solution, including the dimension and a basis of the null space.

The key fact is simple: with a full SVD, the null space of AA is spanned by the right singular vectors associated with zero singular values.

The SVD and the null-space equation

Write the SVD of AA as

A=UΣVT.A=U\Sigma V^T.

For a full SVD, UU is an m×mm\times m orthogonal matrix, VV is an n×nn\times n orthogonal matrix, and Σ\Sigma is an m×nm\times n rectangular diagonal matrix. Let p=min⁡(m,n)p=\min(m,n). The usual singular values are

σ1≥σ2≥⋯≥σp≥0.\sigma_1\geq\sigma_2\geq\cdots\geq\sigma_p\geq 0.

When m<nm<n, the full matrix VV has nn columns but only pp diagonal positions occur in Σ\Sigma. To index all columns of VV, extend the list by setting σi=0\sigma_i=0 for p<i≤np<i\leq n. Thus, for this null-space calculation, we use

σ1≥σ2≥⋯≥σn≥0,\sigma_1\geq\sigma_2\geq\cdots\geq\sigma_n\geq 0,

where any appended values are zero.

Suppose xx satisfies Ax=0Ax=0. Since VV is orthogonal, write

x=Vz,x=Vz,

where z=VTxz=V^Tx. Substituting this into the equation gives

Ax=UΣVTVz=UΣz=0.Ax=U\Sigma V^T Vz=U\Sigma z=0.

Multiplying by UTU^T produces

Σz=0.\Sigma z=0.

Thus, each component ziz_i must satisfy

σizi=0.\sigma_i z_i=0.

If σi≠0\sigma_i\ne 0, then zi=0z_i=0. If σi=0\sigma_i=0, then ziz_i can be arbitrary. Therefore, if viv_i denotes the iith column of VV,

null⁡(A)=span⁡{vi:σi=0}.\operatorname{null}(A)=\operatorname{span}\{v_i:\sigma_i=0\}.

This also agrees with the rank–nullity theorem. If AA has nn columns and rank rr, then exactly n−rn-r independent right singular vectors belong to the null space:

dim⁡null⁡(A)=n−r.\dim\operatorname{null}(A)=n-r.

Step-by-step procedure

Given AA:

  1. Compute a full SVD A=UΣVTA=U\Sigma V^T.
  2. Determine which singular values are zero.
  3. Select the corresponding columns of VV.
  4. Form arbitrary linear combinations of those columns.

If the zero-singular-value columns are vr+1,…,vnv_{r+1},\ldots,v_n, then the general solution is

x=cr+1vr+1+⋯+cnvn,x=c_{r+1}v_{r+1}+\cdots+c_nv_n,

where the coefficients are arbitrary real numbers.

If there are no zero singular values, the only solution is x=0x=0. In that case, AA has full column rank and its null space is trivial.

Worked example

Consider

A=[110002].A=\begin{bmatrix} 1&1&0\\ 0&0&2 \end{bmatrix}.

Instead of computing the entire SVD from scratch, calculate the eigenvectors of ATAA^TA:

ATA=[110110004].A^TA= \begin{bmatrix} 1&1&0\\ 1&1&0\\ 0&0&4 \end{bmatrix}.

Its orthonormal eigenvectors can be chosen as

v1=[001],v2=12[110],v3=12[1−10].v_1=\begin{bmatrix}0\\0\\1\end{bmatrix}, \qquad v_2=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\1\\0\end{bmatrix}, \qquad v_3=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\\0\end{bmatrix}.

The corresponding eigenvalues are 44, 22, and 00. Using the zero-extended list for the three columns of VV, the corresponding singular values are 22, 2\sqrt{2}, and 00. The vector v3v_3 is associated with the zero singular value, and therefore spans the null space:

null⁡(A)=span⁡{12[1−10]}.\operatorname{null}(A)=\operatorname{span}\left\{ \frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\\0\end{bmatrix} \right\}.

Consequently, every solution is

x=t[1−10],t∈R.x=t\begin{bmatrix}1\\-1\\0\end{bmatrix}, \qquad t\in\mathbb{R}.

Direct substitution confirms this:

A[t−t0]=[t−t0]=[00].A\begin{bmatrix}t\\-t\\0\end{bmatrix} = \begin{bmatrix}t-t\\0\end{bmatrix} = \begin{bmatrix}0\\0\end{bmatrix}.

The matrix has rank 22 and 33 columns, so rank–nullity predicts a one-dimensional null space, as obtained from the SVD.

Reduced SVD notation

For an m×nm\times n matrix, a compact SVD is often written

A=UrΣrVrT,A=U_r\Sigma_r V_r^T,

where only the rr positive singular values are retained. Some sources call this a reduced SVD; terminology varies. This factorization is useful for representing the action of AA, but it does not display the null space explicitly: the null-space vectors are omitted from VrV_r.

To obtain a basis for the null space, use a full SVD, or compute the remaining orthonormal columns of VV. In the example above, a compact SVD contains the two right singular vectors associated with singular values 22 and 2\sqrt{2}, while the third right singular vector is needed to describe the solutions of Ax=0Ax=0.

Numerical SVD: what counts as zero?

For exact symbolic matrices, a singular value is either zero or nonzero. In floating-point computation, a theoretically zero singular value may appear as a small number such as 10−1410^{-14}. It should not automatically be treated as nonzero.

A common numerical rank rule is to regard σi\sigma_i as zero when

σi≤τ,\sigma_i\leq \tau,

where a scale-dependent tolerance might be chosen as

τ=max⁡(m,n) σ1 ε,\tau=\max(m,n)\,\sigma_1\,\varepsilon,

with ε\varepsilon the machine precision. Software packages may use a related threshold, and the appropriate tolerance also depends on measurement or modeling error.

The columns of VV corresponding to singular values below the chosen threshold provide a numerical basis for an approximate null space. Such vectors satisfy Ax≈0Ax\approx 0, rather than necessarily satisfying the equation exactly.

Common mistakes

Using columns of UU

The null-space vectors belong to the domain of AA, which is Rn\mathbb{R}^n. They are columns of VV, not columns of UU. The columns of UU describe directions in the output space Rm\mathbb{R}^m.

Looking for zero rows in Σ\Sigma only

The important information is the zero singular values and their associated right singular vectors. For a rectangular matrix, the shape of Σ\Sigma can make zero rows or columns appear because of dimensions, even when those entries do not by themselves identify the null-space basis.

Forgetting the arbitrary coefficients

The null-space basis vectors are not usually the complete answer. If two columns of VV correspond to zero singular values, the complete solution is every linear combination of those two vectors.

Treating a small singular value as exactly zero

A small singular value indicates near dependence, not necessarily exact dependence. In numerical applications, state the tolerance used and distinguish an exact null space from an approximate one.

References

  1. Matrix Computations, Gene H. Golub and Charles F. Van Loan
  2. Introduction to Linear Algebra, Gilbert Strang

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.