Gram-Schmidt illustration for 3 vectors

Gram-Schmidt illustration for 3 vectors

Problem: Use the Gram-Schmidt process to find an orthogonal basis for the following span:

Solution: We first define . Then compute :

and therefore . At this point we have . Since we are just trying to preserve the span, it is convenient to change the definition of to by multiplying it by . This won’t change the span, and we eliminate the fractions.

Finally compute . Since , and this is actually an orthogonal basis for , we can use the formula for that splits it into components according to the orthogonal basis:

Therefore , and we can scale this up as with and use instead . So we have an orthogonal basis:

Computing distance of point to subspace

Computing distance of point to subspace

Problem: Find the closest point on the subspace given by the span

to the vector .

Solution: Label the vectors in the span , in order. Notice that they are already pairwise orthogonal, so we can skip Gram-Schmidt. Then compute :

Therefore

and the length of this vector is , which is our answer.