Course contentsShow
← Mathematics
Lesson 2228 of 3,12146. Linear Algebra — Inner Products and OrthogonalityFree lesson

Applications: QR Factorization Preview

See how Gram-Schmidt directly leads to QR decomposition and its role in solving least squares problems.

Applications: QR Factorization Preview

You'll learn: How the Gram-Schmidt process naturally produces a powerful matrix factorization that solves least squares problems efficiently.

From Gram-Schmidt to QR Decomposition

When you apply Gram-Schmidt to the columns of a matrix A, you're doing more than just creating an orthonormal basis—you're actually factoring the matrix itself.

Here's the key insight: Gram-Schmidt transforms a matrix A into an orthonormal matrix Q (whose columns are the orthonormal vectors you computed) and an upper triangular matrix R (which captures the transformation coefficients). This gives us:

A = QR

Think of it like this: Q contains the "pure directions" (orthonormal basis vectors), while R records "how much of each original column was built from these directions."

Why This Matters: Least Squares Problems

The QR factorization is particularly valuable for solving overdetermined systems—when you have more equations than unknowns and no exact solution exists. In least squares, you want to find the "best" approximate solution.

The system Ax = b transforms into QRx = b. Since Q is orthonormal, multiplying both sides by Qᵀ gives:

Rx = Qᵀb

Now you only need to solve a triangular system (extremely fast!), rather than dealing with the messy normal equations AᵀAx = Aᵀb.

The Big Picture

QR decomposition inherited numerical stability from Gram-Schmidt (especially the modified version) and turns the abstract orthogonalization process into a computational workhorse for regression, data fitting, and solving inconsistent systems.

Key Takeaway: Gram-Schmidt isn't just theory—it directly produces the QR factorization A = QR, which transforms difficult least squares problems into easy triangular systems.