Subtract one projection in a Gram-Schmidt step
Compute the coefficient aT b / aT a and explain why the denominator is the squared length. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.
Given an earlier direction and a new vector, the second orthogonal vector is
The coefficient is not a convention — it is forced. must be a multiple of subtracted from, say, and it must satisfy. That gives
Read the two dots as answering two questions: - — how much of points along. - — how long is, squared. This converts that amount into a multiple of the vector.
The first step, for completeness.: the first direction is accepted as it comes, with no subtraction. Normalising happens at the end, once per vector — never before the projections.
The step in four moves, in order. Both dots, then the division, then the subtraction, then the check. Each move needs the one before it.
Every failure mode of this step shows up in the same number.
The check is, and it must be zero. Compute it before moving on, and each possible slip is diagnosed by it:
| what went wrong | | |---|---| | forgot the division | | | inverted the fraction | | | added instead of subtracting | | | left unchanged | |
The check does not tell you which of the four happened — but you know it is one of them, and the four are easy to tell apart by looking at your coefficient.
Why the check is exactly the condition. was defined as the leftover after the projection came off. That leftover is perpendicular to precisely when the coefficient was the projection coefficient. So the check is not a heuristic; it is the definition restated.
Why the step generalises. With two earlier vectors and, the third vector subtracts two projections, and the check is two dots. With earlier vectors, projections and dots. The idea never changes; only the count does.
Run Gram-Schmidt on,,.
First.,.
Second., so and Check: ✓ and.
Third. and, so Check both: ✓ and ✓
The lengths.,,, so,,.
The one mistake this example catches. Using instead of in the third projection. is not orthogonal to, so subtracting along it removes part of the-direction again and leaves a with. Here that would give, and, so this particular pair happens to survive — which is exactly why you check rather than assume.
- Compute the coefficient a^T b / a^T a and explain why the denominator is the squared length
- Form B = b - (a^T b / a^T a) a and verify a^T B = 0
- Put the steps of one Gram-Schmidt step in order and name the first line that goes wrong
(a) For and, what coefficient does the step use? (b) What is the first thing to compute if you suspect your is wrong? (c) In the step, is guaranteed nonzero?
Answers
(a) and, so and.
(b). If it is not zero, the coefficient or the sign is wrong.
(c) Only if is not a multiple of. If is a multiple, and the process stops and reports dependence — which is the next skill.