Read this lesson as text

Modified Gram-Schmidt

Linear Algebra (Matrices) · Axiom Academy

Same algebra, better arithmetic — why re-projecting against the latest partial vector keeps an orthogonal basis honest in floating point. 1. Subtract All at Once, or One at a Time? Both algorithms remove the same components — they differ in where the projections are measured from . Classical fans all projection rays out from the single original vector a_3 . Modified peels them off one at a time from the shrinking remainder, re-measuring against each new direction as it appears. Classical — every projection uses the original a_k Modified — each step re-projects the current partial v 2. Watching Orthogonality Slip Away Take a nearly-dependent set whose columns differ by only (a classic stress test). Form the basis both ways and measure how far the result is from truly orthonormal with the loss-of-orthogonality . As the meter fills, the classical bar creeps up off zero while the modified bar stays pinned. These are the actual measured numbers from running both algorithms in double precision on that matrix: 3. The Remainder Lands Perpendicular Why does re-projecting help? Watch one vector get cleaned up sequentially. We strip off its component along q_1 , then — from that updated remainder — strip off its component along q_2 . Each subtraction measures against the freshest direction, so the leftover snaps onto the plane's normal at a clean right angle.

This is the written version of the interactive lesson above. See the full Linear Algebra (Matrices) course.