Gram-Schmidt Orthonormalization — Definition, Formula & Examples
Gram-Schmidt orthonormalization is a procedure that takes a set of linearly independent vectors and produces a set of orthonormal vectors (mutually perpendicular and each of unit length) that span the same subspace.
Given a set of linearly independent vectors in an inner product space, the Gram-Schmidt process constructs an orthonormal set such that for each , .
Key Formula
Where:
- = The k-th original linearly independent vector
- = The j-th orthonormal vector already computed
- = Intermediate orthogonal (but not yet normalized) vector
- = The Euclidean norm (length) of the intermediate vector
How It Works
At each step you subtract from the current vector its projections onto all previously computed orthonormal vectors, then normalize the result. The first orthonormal vector is simply divided by its norm. For each subsequent vector , you remove the components along to get an orthogonal vector , then divide by to obtain . This guarantees every pair of output vectors has a dot product of zero and each has length 1.
Worked Example
Problem: Apply Gram-Schmidt orthonormalization to the vectors and .
Step 1: Normalize the first vector.
Step 2: Subtract the projection of onto .
Step 3: Normalize the result.
Answer: The orthonormal set is and .
Why It Matters
Gram-Schmidt is the foundation of QR factorization, one of the most widely used matrix decompositions in numerical computing. It appears throughout signal processing, computer graphics, and statistics whenever you need an orthonormal basis — for example, in least-squares regression or principal component analysis.
Common Mistakes
Mistake: Forgetting to normalize after each subtraction step, producing orthogonal but not orthonormal vectors.
Correction: Always divide by its norm immediately before using it in subsequent projection calculations. The projection formula shown above assumes each already has unit length.
