Orthogonality & Matrix Decompositions

Factorising matrices is how computers solve linear algebra. Learn inner products and orthogonality, projections and least squares, Gram–Schmidt and QR, LU and Cholesky factorisations, the singular value decomposition (SVD), low-rank approximation, pseudo-inverse and condition number.

Behind every call to a linear-algebra library is a decomposition: LU for general systems, Cholesky for symmetric positive-definite FEM matrices, QR for least squares, SVD for rank, noise reduction and image compression.

An analogy

A decomposition is like disassembling a complex machine into simple standard parts (triangular, orthogonal, diagonal) that are easy to work with individually.

Orthogonality

Orthogonal vectors have zero inner product; orthonormal bases make coordinates trivial (dot products). Gram–Schmidt turns any basis into an orthonormal one.

Least squares

Overdetermined systems (more equations than unknowns — noisy measurements) have no exact solution; the least-squares solution projects b onto the column space. QR is more stable than forming AᵀA.

LU and Cholesky

LU (with pivoting) solves general systems in O(n³/3) once, then O(n²) per right-hand side. Cholesky is twice as fast for symmetric positive-definite matrices (stiffness, covariance).

SVD

Every matrix factors as UΣVᵀ. Singular values reveal rank, conditioning and the most important directions; truncating small ones compresses images, denoises data, and gives the pseudo-inverse for rank-deficient problems.

Formulas

Worked example: Least-squares line

Given: Points (0, 1), (1, 3), (2, 4), (3, 4)

Find: y = a + bx.

Answer: y = 1.5 + x

Worked example: Gram–Schmidt

Given: v₁ = (1, 1, 0), v₂ = (1, 0, 1)

Find: Orthogonal u₂.

Answer: u₂ = (0.5, −0.5, 1) (u₂·v₁ = 0 ✓)

Common mistakes

Applications

Key takeaways

Going further