4.9: Gram-Schmidt Process
( \newcommand{\kernel}{\mathrm{null}\,}\)
- Given a linearly independent set, use the Gram-Schmidt Process to find corresponding orthogonal and orthonormal sets.
The Gram-Schmidt process is an algorithm to transform a set of vectors into an orthonormal set spanning the same subspace, that is generating the same collection of linear combinations.
The goal of the Gram-Schmidt process is to take a linearly independent set of vectors and transform it into an orthonormal set with the same span. The first objective is to construct an orthogonal set of vectors with the same span, since from there an orthonormal set can be obtained by simply dividing each vector by its length.
Let {→u1,⋯,→un} be a set of linearly independent vectors in Rn.
I: Construct a new set of vectors {→v1,⋯,→vn} as follows: →v1=→u1→v2=→u2−(→u2⋅→v1‖→v1‖2)→v1→v3=→u3−(→u3⋅→v1‖→v1‖2)→v1−(→u3⋅→v2‖→v2‖2)→v2⋮→vn=→un−(→un⋅→v1‖→v1‖2)→v1−(→un⋅→v2‖→v2‖2)→v2−⋯−(→un⋅→vn−1‖→vn−1‖2)→vn−1
II: Now let →wi=→vi‖→vi‖ for i=1,⋯,n.
Then
- {→v1,⋯,→vn} is an orthogonal set.
- {→w1,⋯,→wn} is an orthonormal set.
- span{→u1,⋯,→un}=span{→v1,⋯,→vn}=span{→w1,⋯,→wn}.
Solution
The full proof of this algorithm is beyond this material, however here is an indication of the arguments.
To show that {→v1,⋯,→vn} is an orthogonal set, let a2=→u2⋅→v1‖→v1‖2 then: →v1⋅→v2=→v1⋅(→u2−a2→v1)=→v1⋅→u2−a2(→v1⋅→v1)=→v1⋅→u2−→u2⋅→v1‖→v1‖2‖→v1‖2=(→v1⋅→u2)−(→u2⋅→v1)=0 Now that you have shown that {→v1,→v2} is orthogonal, use the same method as above to show that {→v1,→v2,→v3} is also orthogonal, and so on.
Then in a similar fashion you show that span{→u1,⋯,→un}=span{→v1,⋯,→vn}.
Finally defining →wi=→vi‖→vi‖ for i=1,⋯,n does not affect orthogonality and yields vectors of length 1, hence an orthonormal set. You can also observe that it does not affect the span either and the proof would be complete.
Consider the following example.
Consider the set of vectors {→u1,→u2} given as in Example 4.9.1. That is →u1=[110],→u2=[320]∈R3
Use the Gram-Schmidt algorithm to find an orthonormal set of vectors {→w1,→w2} having the same span.
Solution
We already remarked that the set of vectors in {→u1,→u2} is linearly independent, so we can proceed with the Gram-Schmidt algorithm: →v1=→u1=[110]→v2=→u2−(→u2⋅→v1‖→v1‖2)→v1=[320]−52[110]=[12−120]
Now to normalize simply let →w1=→v1‖→v1‖=[1√21√20]→w2=→v2‖→v2‖=[1√2−1√20]
You can verify that {→w1,→w2} is an orthonormal set of vectors having the same span as {→u1,→u2}, namely the XY-plane.
In this example, we began with a linearly independent set and found an orthonormal set of vectors which had the same span. It turns out that if we start with a basis of a subspace and apply the Gram-Schmidt algorithm, the result will be an orthogonal basis of the same subspace. We examine this in the following example.
Let →x1=[1010],→x2=[1011], and →x3=[1100], and let U=span{→x1,→x2,→x3}. Use the Gram-Schmidt Process to construct an orthogonal basis B of U.
Solution
First →f1=→x1.
Next, →f2=[1011]−22[1010]=[0001].
Finally, →f3=[1100]−12[1010]−01[0001]=[1/21−1/20].
Therefore, {[1010],[0001],[1/21−1/20]} is an orthogonal basis of U. However, it is sometimes more convenient to deal with vectors having integer entries, in which case we take B={[1010],[0001],[12−10]}.