Orthogonality · Definition
Gram–Schmidt process
Before you start you need to know
Answers how to build an orthogonal basis from any basis, so that you can compute with it without solving systems.
Definition
A procedure that turns linearly independent vectors into an orthogonal list spanning the same subspace, by subtracting from each one its projections onto the previous ones.
The process goes one vector at a time. The first is kept, \(w_1=v_1\). Each later vector is corrected by removing its component along all the previous ones: \(w_2=v_2-\operatorname{proj}_{w_1}v_2\), \(w_3=v_3-\operatorname{proj}_{w_1}v_3-\operatorname{proj}_{w_2}v_3\), and so on. What remains is orthogonal to what was already built because each projection removes exactly the part that was not.
Guiding example: with \(v_1=(1,1,0)\) and \(v_2=(1,0,1)\), \(w_1=(1,1,0)\) and \(\frac{v_2\cdot w_1}{w_1\cdot w_1}=\frac12\), so \(w_2=(1,0,1)-\tfrac12(1,1,0)=(\tfrac12,-\tfrac12,1)\). One checks that \(w_1\cdot w_2=\tfrac12-\tfrac12=0\). To get unit vectors, divide each \(w_k\) by its norm, \(q_k=w_k/\|w_k\|\), which yields an orthonormal basis.
At every step, \(w_1,\dots,w_k\) span the same subspace as \(v_1,\dots,v_k\): only combinations of earlier vectors are subtracted. If some \(w_k\) comes out as \(\mathbf 0\), then \(v_k\) depended on the earlier ones, so the starting list was not independent. A typical mistake is projecting onto the original \(v_j\) instead of the already orthogonalized \(w_j\); separate projections add up correctly only when the reference vectors are orthogonal to each other.
This process shows that every finite-dimensional subspace has an orthonormal basis, and it underlies the factorization \(A=QR\), where \(Q\) stores the \(q_k\) and \(R\) the projection coefficients. It also simplifies least squares, since with an orthonormal basis the projection onto the subspace is a sum of projections onto each vector.
Think about it
Why does the order of orthogonalization not affect orthogonality of the result, yet change the vectors obtained?
Any order yields an orthogonal list spanning the same subspace, but each \(w_k\) depends on which vectors were processed before it, so the specific vectors change.
If \(v_1=(1,0)\) and \(v_2=(0,5)\) are already orthogonal, what does the process do?
Since \(v_2\cdot w_1=0\), the projection is zero and \(w_2=v_2\): the process leaves already orthogonal vectors unchanged.
Exercises 10
- Apply Gram–Schmidt to \(v_1=(1,1)\), \(v_2=(1,0)\). What is the second orthogonal vector \(w_2\)?
- Apply Gram–Schmidt to \(v_1=(2,0)\), \(v_2=(3,4)\). What is \(w_2\)?
- Apply Gram–Schmidt to \(v_1=(1,-1)\), \(v_2=(2,0)\). What is \(w_2\)?
- In the Gram–Schmidt process, what is taken as the first orthogonal vector \(w_1\)?
- After Gram–Schmidt, the first vector is \(w_1=(3,4)\). What is the corresponding unit vector \(q_1\)?
- Apply Gram–Schmidt to \(v_1=(1,1,0)\), \(v_2=(1,0,1)\). What is \(w_2\)?
- Apply Gram–Schmidt to \(v_1=(1,1,1)\), \(v_2=(1,2,3)\). What is \(w_2\)?
- Apply Gram–Schmidt to \(v_1=(1,0,0)\), \(v_2=(1,1,0)\), \(v_3=(1,1,1)\). What is \(w_3\)?
- Gram–Schmidt is applied to \(v_1,v_2\) with \(v_2=3v_1\) and \(v_1\neq\mathbf 0\). What is \(w_2\)?
- Which statement about \(w_1,w_2\), the output of Gram–Schmidt applied to linearly independent \(v_1,v_2\), is true?
References
- Gilbert Strang, Introduction to Linear Algebra, 6th edition, Wellesley-Cambridge Press, 2023. §4.4
- David C. Lay, Steven R. Lay, Judi J. McDonald, Linear Algebra and Its Applications, 6th edition, Pearson, 2021. §6.4