# Finding an orthonormal basis for a subspace

## Homework Statement

Find an orthonormal basis for the subspace of V4 spanned by the given vectors.
x1 = (1, 1, 0, 1)
x2 = (1, 0, 2, 1)
x3 = (1, 2, -2, 1)

## Homework Equations

Gram-Schmidt Process

## The Attempt at a Solution

I have used the Gram-Schmidt process but seem to be running into trouble. Here is what I did:
y1 = x1 = (1, 1, 0, 1)
y2 = x - y1 = (1-1, 0-1, 2-0, 1-1) = (0, -1, 2, 0)
y3 = x3 - y1 + y2 = (1-1+0, 2-1-1, -2-0+2, 1-1+0) = (0, 0, 0, 0)

Now I used these and their norms to find the basis {y1, y2}

y1 / lly1ll = 1/sqrt(3) (1, 1, 0, 1)
y2 / lly2ll = 1/sqrt(5) (0, -1, 2, 0)

Therefore, {1/sqrt(3) (1, 1, 0, 1), 1/sqrt(5) (0, -1, 2, 0)} from my work. However, my book says the answer is {(1/3)(1/sqrt(3)(1, 1, 0, 1), 1/sqrt(42) (1, -2, 6, 1)} which is very different than my answer. Where am I going wrong?

mfb
Mentor
y2 = x2 - y1
y3 = x3 - y1 + y2
This is not Gram-Schmidt, and randomly subtracting some vectors will not give orthogonal vectors in general. There is an important part missing.
You can see that your answer is wrong if you check if your y2 and y1 are orthogonal.

Unrelated to this issue: There is more than one orthonormal basis. Your answer can deviate from the book's answer.

RUber
Homework Helper
http://en.wikipedia.org/wiki/Gram–Schmidt_process
Start with one vector, then from the second vector, subtract off the projection of the second vector onto the first vector. For the third, you have to subtract off the projections onto the two already found orthogonal vectors.
You can either normalize as you go, or normalize at the end. If you are doing it by hand, waiting until you have the orthogonal vectors is nicer for arithmetic. If you are automating the process, it is usually more efficient to normalize as you go.

This is not Gram-Schmidt, and randomly subtracting some vectors will not give orthogonal vectors in general. There is an important part missing.
You can see that your answer is wrong if you check if your y2 and y1 are orthogonal.

Unrelated to this issue: There is more than one orthonormal basis. Your answer can deviate from the book's answer.
This is the abbreviated formula given to me in my book from the more complex Gram-Schmidt formula. Maybe I will try using the original formulas.

RUber
Homework Helper
Your y1 and y2 above are good starting points, since they are helping you to find a set of linearly independent vectors spanning the space. You have already found that the space spanned by the three vectors will only have dimension 2 with y1 and y2 as admissible bases. However, y1 and y2 are neither orthogonal nor normal, bases.

I was unable to reproduce the answer you had for the book answer, but as mfb said, there are many admissible solutions. It seems like the book answer may be based on conducting the operations in a certain order.

vela
Staff Emeritus