Gram–Schmidt: A Worked-Example Reflection Sheet (Checklist Style)
Gram–Schmidt is like turning a messy group of “kinda pointing different ways” vectors into a neat set of perpendicular, unit-length arrows. Same span, cleaner coordinates, happier math.
Below is a step-labeled reflection sheet you can follow every time—no drama, just structure.
Big Picture Goal
Given linearly independent vectors v1,v2,…,vk in an inner-product space, we want an orthonormal set q1,q2,…,qk that spans the same subspace.
- Orthogonal means: ⟨qi,qj⟩=0 for i=j
- Normal (normalized) means: ∥qi∥=1
- Orthonormal means both.
The Checklist (with a tiny worked example structure)
We’ll write the output vectors in two stages:
- Orthogonal (not yet unit): u1,u2,…,uk
- Orthonormal (unit): qi=∥ui∥ui
Step 0 — Start with independent vectors
✅ Input: v1,v2,…,vk must be linearly independent.
Why? If one vector is “already made from the others,” Gram–Schmidt eventually tries to normalize a zero vector, and that’s a hard stop.
Step 1 — First vector: keep it (then normalize later)
Set:
u1=v1
Then later:
q1=∥u1∥u1
Idea: the first direction is free—you’re just choosing your first axis.
Step 2 — Make the next vector perpendicular by subtracting its “shadow”
For the second vector:
-
Project v2 onto u1:
proju1(v2)=⟨u1,u1⟩⟨v2,u1⟩u1
-
Subtract that projection:
u2=v2−proju1(v2)
-
Normalize:
q2=∥u2∥u2
Mental picture: you remove the part of v2 that points along u1, leaving only the “new direction.”
Step 3 — Repeat: subtract all earlier shadows
For the third vector, you subtract the shadows onto each previous orthogonal vector:
u3=v3−proju1(v3)−proju2(v3)
Then normalize:
q3=∥u3∥u3
In general, for i≥2:
ui=vi−∑j=1i−1projuj(vi)
and
qi=∥ui∥ui
✅ Checklist wording:
- Subtract projections onto all earlier uj
- Confirm ui=0
- Normalize to get qi
Step 4 — Verify orthonormality (quick inner product audit)
Once you have q1,…,qk, verify:
-
Unit length:
⟨qi,qi⟩=1
-
Perpendicular for different indices:
⟨qi,qj⟩=0(i=j)
If these hold, you’ve built an orthonormal set.
Self-Audit: Catch Problems Before They Bite
How to spot near-dependence (a.k.a. “why is my vector almost zero?”)
Sometimes the input vectors are technically independent, but almost dependent. Then Gram–Schmidt can produce a tiny ∥ui∥ and things get numerically wobbly.
Watch for:
- Very small norm after subtraction: ∥ui∥≈0
- Huge coefficients in projections (because you’re dividing by ⟨uj,uj⟩)
- A feeling that vi is “mostly explained” by earlier vectors
What it means conceptually:
- You’re trying to create a “new direction,” but there’s barely any new direction left.
(Practical note: in computation-heavy settings, people often use Modified Gram–Schmidt for better numerical stability—but the idea is the same.)
Where conjugation appears (complex inner products)
If your vectors have complex entries, the inner product uses complex conjugates.
Common convention:
⟨x,y⟩=∑ixiyi
That conjugation shows up in the projection formula because projections use inner products:
proju(v)=⟨u,u⟩⟨v,u⟩u
✅ Self-check:
- In complex spaces, make sure your inner product is conjugate-linear in one argument (depending on convention).
- If you forget conjugation, your “orthogonality check” can fail in confusing ways.
Plain-Language Reflection Prompt (Explain the why)
In your own words, briefly explain the purpose of:
- starting with independent vectors,
- subtracting projections,
- normalizing,
- checking inner products at the end.
Takeaway
Gram–Schmidt is a tidy routine: keep the parts that are new, remove the parts that are repeats, then scale everything to length 1. It’s like organizing a closet—same clothes, suddenly everything fits nicely.