The Gram-Schmidt process, step by step
6 min read
Short answer
Gram-Schmidt converts independent vectors into orthogonal vectors spanning the same space. Keep ; for each next vector, subtract its projections onto the earlier 's: . Divide each by its length for an orthonormal set.
The recipe
- .
- .
- , and so on.
- Optional: .
Each step removes the part of that already lies in the span of the earlier vectors, leaving only the new direction.
Why it is useful
The process produces the QR factorization , with orthonormal columns in and upper triangular. Orthonormal columns make least squares and projections much simpler. If comes out as , the original vectors were dependent.
Worked example
Apply Gram-Schmidt to and and normalize.
. Then and , so Check: . ✓
Lengths: and . So and .
Try it yourself
Orthogonalize and .
Show the answer
. and , so . Check: .
Keep going with practice
Gram-Schmidt builds on projections and orthogonality in Vidi's Linear Algebra & Probability course.