∑GATE DA Atlas

LU Decomposition and Singular Value Decomposition

LU factorisation as recorded Gaussian elimination, permutations (PA = LU), solving systems with forward and back substitution, LDU and Cholesky; the singular value decomposition, how to compute it from AᵀA, its geometric meaning, rank, matrix norms and condition number, the Eckart–Young low-rank approximation, the pseudo-inverse, and the link to PCA.

Section 210 practice questions

LU decomposition

Gaussian elimination without row swaps factors a square matrix as

A=LU,A = LU,

where UU is the upper-triangular result of elimination and LL is unit lower triangular holding the multipliers: ℓij\ell_{ij} is the multiple of row jj subtracted from row ii.

Solving with LU

Ax=b  ⟺  L(Ux)=bA\mathbf x = \mathbf b \iff L(U\mathbf x) = \mathbf b:

  1. Forward substitution: solve Ly=bL\mathbf y = \mathbf b.
  2. Back substitution: solve Ux=yU\mathbf x = \mathbf y.

Factoring costs 23n3\frac23n^3 once; each new right-hand side then costs only 2n22n^2. This is why libraries factor once and solve many times.

Pivoting and variants

  • If a zero pivot appears, swap rows: PA=LUPA = LU with a permutation matrix PP. Every invertible matrix has such a factorisation; partial pivoting also improves numerical stability.
  • An LU factorisation without pivoting exists iff all leading principal minors are non-zero.
  • LDU: factor the pivots out of UU: A=LDUA = LDU with both triangular factors unit-diagonal; for symmetric AA, A=LDL⊤A = LDL^\top.
  • Cholesky: a symmetric positive definite AA factors as A=LL⊤A = LL^\top (about half the work of LU, no pivoting needed). Its existence is itself a test for positive definiteness.

Singular value decomposition

Every real m×nm\times n matrix factors as

A=UΣV⊤=∑i=1rσi uivi⊤,A = U\Sigma V^\top = \sum_{i=1}^r \sigma_i\,\mathbf u_i\mathbf v_i^\top,
  • UU (m×mm\times m) orthogonal — left singular vectors, eigenvectors of AA⊤AA^\top;
  • VV (n×nn\times n) orthogonal — right singular vectors, eigenvectors of A⊤AA^\top A;
  • Σ\Sigma (m×nm\times n) diagonal with σ1≥σ2≥⋯≥σr>0\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r > 0, the singular values, σi=λi(A⊤A)\sigma_i = \sqrt{\lambda_i(A^\top A)}, and r=rank⁡Ar = \operatorname{rank}A.

Computing it by hand

  1. Form A⊤AA^\top A; find its eigenvalues λi\lambda_i and orthonormal eigenvectors vi\mathbf v_i.
  2. σi=λi\sigma_i = \sqrt{\lambda_i}.
  3. ui=Avi/σi\mathbf u_i = A\mathbf v_i/\sigma_i for each non-zero σi\sigma_i (complete to an orthonormal basis if needed).

Geometry

Any linear map is a rotation/reflection (V⊤V^\top), then an axis-aligned stretch (Σ\Sigma), then another rotation/reflection (UU). The unit sphere maps to an ellipsoid whose semi-axes have lengths σi\sigma_i along ui\mathbf u_i.

unit circle Vᵀ rotated Σ stretched by σ₁, σ₂ U A maps the circle
A = UΣVᵀ: rotate, scale along the axes, rotate again.

What the SVD gives you

QuantityIn terms of singular values
Ranknumber of non-zero σi\sigma_i
Spectral norm ∥A∥2\lVert A\rVert_2σ1\sigma_1
Frobenius norm ∥A∥F=∑aij2\lVert A\rVert_F = \sqrt{\sum a_{ij}^2}∑σi2\sqrt{\sum\sigma_i^2}
∣det⁡A∣\lvert\det A\rvert (square)∏σi\prod\sigma_i
Condition numberκ=σ1/σn\kappa = \sigma_1/\sigma_n
Bases of the four subspacesv1..vr\mathbf v_1..\mathbf v_r: row space; vr+1..vn\mathbf v_{r+1}..\mathbf v_n: null space; u1..ur\mathbf u_1..\mathbf u_r: column space; ur+1..um\mathbf u_{r+1}..\mathbf u_m: left null space

Low-rank approximation (Eckart–Young)

The best rank-kk approximation to AA — in both the spectral and Frobenius norms — is the truncated SVD

Ak=∑i=1kσiuivi⊤,∥A−Ak∥2=σk+1,∥A−Ak∥F=∑i>kσi2.A_k = \sum_{i=1}^k\sigma_i\mathbf u_i\mathbf v_i^\top, \qquad \lVert A - A_k\rVert_2 = \sigma_{k+1}, \qquad \lVert A - A_k\rVert_F = \sqrt{\sum_{i>k}\sigma_i^2}.

Used for image compression, latent semantic analysis, recommender systems (matrix factorisation) and denoising. Storing AkA_k takes k(m+n+1)k(m + n + 1) numbers instead of mnmn.

Pseudo-inverse

A+=VΣ+U⊤,Σ+=diag⁡(1/σ1,…,1/σr,0,… ).A^+ = V\Sigma^+U^\top, \qquad \Sigma^+ = \operatorname{diag}(1/\sigma_1, \dots, 1/\sigma_r, 0, \dots).

A+bA^+\mathbf b is the least-squares solution of Ax≈bA\mathbf x \approx \mathbf b with the smallest norm. If AA has full column rank, A+=(A⊤A)−1A⊤A^+ = (A^\top A)^{-1}A^\top; if AA is invertible, A+=A−1A^+ = A^{-1}.

SVD and PCA

For a centred data matrix XX (nn samples × pp features), the covariance is 1n−1X⊤X=VΣ2n−1V⊤\frac{1}{n-1}X^\top X = V\frac{\Sigma^2}{n-1}V^\top. So the principal directions are the right singular vectors vi\mathbf v_i, the variance explained by each is σi2/(n−1)\sigma_i^2/(n-1), and the principal component scores are XV=UΣXV = U\Sigma. Libraries compute PCA via the SVD of XX for numerical stability. See PCA.

Quick revision

Practice questions

GATE-style questions: 3 one-mark and 7 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.

Q1NAT2 marks

A=(2347)=LUA = \begin{pmatrix}2&3\\4&7\end{pmatrix} = LU with LL unit lower triangular and UU upper triangular. The entry u22u_{22} of UU is ______.

Q2NAT2 marks

The largest singular value of (3045)\begin{pmatrix}3&0\\4&5\end{pmatrix} is ______ (round to two decimals).

Q3MCQ1 mark

The number of non-zero singular values of a matrix equals its

Q4NAT2 marks

A=diag⁡(5,3,1)A = \operatorname{diag}(5, 3, 1). The Frobenius-norm error ∥A−A1∥F\lVert A - A_1\rVert_F of the best rank-1 approximation A1A_1 is ______ (round to two decimals).

Q5MSQ2 marks

Which statements about the singular value decomposition A=UΣV⊤A = U\Sigma V^\top of a real m×nm \times n matrix are true?

One or more options are correct.

Q6NAT1 mark

The spectral norm ∥A∥2=max⁡∥x∥=1∥Ax∥\lVert A\rVert_2 = \max_{\lVert\mathbf x\rVert = 1}\lVert A\mathbf x\rVert of A=(1221)A = \begin{pmatrix}1&2\\2&1\end{pmatrix} is ______.

Q7MCQ2 marks

Gaussian elimination without row exchanges applied to A=(0111)A = \begin{pmatrix}0&1\\1&1\end{pmatrix}

Q8NAT2 marks

The 2-norm condition number κ(A)=σmax⁡/σmin⁡\kappa(A) = \sigma_{\max}/\sigma_{\min} of A=diag⁡(10,0.1)A = \operatorname{diag}(10, 0.1) is ______.

Q9NAT2 marks

A=LUA = LU with L=(1031)L = \begin{pmatrix}1&0\\3&1\end{pmatrix} and U=(2104)U = \begin{pmatrix}2&1\\0&4\end{pmatrix}. Then det⁡A\det A is ______.

Q10MCQ1 mark

The Moore–Penrose pseudo-inverse of (2000)\begin{pmatrix}2&0\\0&0\end{pmatrix} is