Euler Hall — free maths guides

Check that a Gram-Schmidt residual is orthogonal to the previous vector

Dot a new vector with every earlier orthogonal vector, not just the last one. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

How many dots, and against what

To certify that a setq1,…,qkq_1,\dots,q_k is orthogonal you need every pair to vanish: qiTqj=0for all i<j.q_i^Tq_j=0\quad\text{for all } i<j. That is(k2)\binom{k}{2} dot products: 1 for two vectors, 3 for three, 6 for four.

In Gram-Schmidt the count is the same but the shape is convenient. A new vector is compared with all the ones already built, so the third vector needs two dots, the fourth three. Each new vector costs one dot per earlier vector, and total work is1+2+⋯+(k−1)=(k2)1+2+\cdots+(k-1)=\binom{k}{2}.

What the check proves. Mutual perpendicularity plus no zero vector forces independence: ifc1q1+⋯+ckqk=0c_1q_1+\cdots+c_kq_k=\mathbf{0}, dot withqiq_i and every term exceptci∥qi∥2c_i\|q_i\|^2 dies, soci=0c_i=0. Each dot product isolates one coefficient.

What it does not prove. Unit length. An orthogonal set becomes orthonormal only after dividing each vector by its own length.

Why dotting isolates one coefficient

This is the mechanism, and it is the same one that makes orthonormal coordinates single dot products.

Take a relation.c1q1+c2q2+c3q3=0c_1q_1+c_2q_2+c_3q_3=\mathbf{0}. Dot both sides withq1q_1: c1(q1Tq1)+c2(q1Tq2)+c3(q1Tq3)=0.c_1(q_1^Tq_1)+c_2(q_1^Tq_2)+c_3(q_1^Tq_3)=0. If the set is orthogonal, the last two terms are zero, leavingc1∥q1∥2=0c_1\|q_1\|^2=0, soc1=0c_1=0. Repeat withq2q_2 andq3q_3 and every coefficient dies.

Why this is stronger than it looks. The argument works with no elimination, no rank computation and no size restriction — it is a proof that orthogonal nonzero sets are independent, and it is one line per coefficient.

And why normalisation is not needed for it. The step divides by∥q1∥2\|q_1\|^2, which is nonzero exactly whenq1≠0q_1\ne\mathbf{0}, so the argument works for orthogonal sets and not only orthonormal ones. Unit length matters for coordinates, not for independence.

What goes wrong if a vector is zero. Then∥qi∥2=0\|q_i\|^2=0 and the division is illegal, which is the dot-product version of "a zero vector in the list makes it dependent". Same statement, different route.

Worked example: all three dots

ForA=(1,−1,0)A=(1,-1,0),B=(1,1,−2)B=(1,1,-2),C=(1,1,1)C=(1,1,1):

ATB=1−1+0=0 ✓,ATC=1−1+0=0 ✓,BTC=1+1−2=0 ✓A^TB=1-1+0=0\ ✓,\qquad A^TC=1-1+0=0\ ✓,\qquad B^TC=1+1-2=0\ ✓

All three pairs vanish, so the set is orthogonal. The squared lengths are2,6,32,6,3, none of which is11, so the set is not orthonormal.

Now break one on purpose. TakeC′=(1,1,0)C'=(1,1,0) instead: ATC′=1−1=0 ✓,BTC′=1+1+0=2≠0 ✗.A^TC'=1-1=0\ ✓,\qquad B^TC'=1+1+0=2\ne0\ ✗. Two of the three pairs still pass, and the set is not orthogonal.

What produced that pattern.C′C' isCC with its third entry zeroed, which leaves a component alongBB. In Gram-Schmidt terms theBB-projection did not come off. And noticeATC′A^TC' still vanishes — which is exactly why checking only one pair is not enough, and why "the pair I happened to test passed" is not evidence.

The independence conclusion. Since all three dots vanish and no vector is zero, the three are independent, hence a basis forR3\mathbb{R}^3 — but not an orthonormal one.

By the end you can
  • Dot a new vector with every earlier orthogonal vector, not just the last one
  • Count the perpendicular pairs in a set and reject a set where any pair fails
  • Say what mutual perpendicularity proves (independence) and what it does not (orthonormality)
Test yourself

(a) How many dot products certify four vectors as orthogonal? (b) A set hasATB=0A^TB=0 and∥A∥=∥B∥=1\|A\|=\|B\|=1. Is it orthonormal? (c) Three nonzero vectors are pairwise perpendicular. Are they independent?

Answers

(a) Six:(42)=6\binom{4}{2}=6.

(b) For a pair, yes — both conditions hold. For a larger set you would need every pair, plus every length.

(c) Yes. Dot the relation with each vector in turn and each coefficient dies.

Work out where to start — free, no accountAnswer six real questions — free, no account