# Gram-Schmidt problem - I'm stuck

1. Dec 4, 2007

### helpm3pl3ase

I am stuck on a problem.. I keep obtaining the incorrect answer and I am unsure of where my calculation went wrong??? I have the 2 vectors v1 [4,0,3] and v2 [25,0,-25]

I first obtain (1/||v1||)v1 = [4/5 0 3/5] = z1

I then proceed to do: (v2 - (z1 . v2)z1)/||v2 - (z1 . v2)|| = [25 0 -25] - 5 [4/5 0 3/5] = [25 0 -25] + [-4 0 -3] = [21 0 -28] = u2

then 1/||u2|| = sqrt(21^2 + 0^2 + -28^2) = 35

So i should get (1/35)[25 0 -25]

But in the book it shows the correct answer to be:

(1/5)[3 0 -4]?? I don't see where I went wrong.. I went over it several times.. I just must be missing something??

2. Dec 4, 2007

### ice109

it's so difficult to understand what you wrote but if you want to project $\vec{u_1}$ onto $\vec{u_2}$ you do this:

$$\frac{\vec{u_1} \bullet \vec{u_2}}{\vec{u_1} \bullet \vec{u_1}} \vec{u_1}$$

then the orthogonal compliment is just $u_1 - proj$

3. Dec 5, 2007

### helpm3pl3ase

blahh.. I don't get it.. I did and still not the right answer is produced.. can someone help.. I don't know what I am missing

The main question is to just perform Gram-Schmidt on those first two vectors:
4
0
3
and
25
0
-25

I did it in the first post and just did it again.. I still i get a different answer then what is in the book.

4. Dec 5, 2007

### JasonRox

I suggest taking your sweet ass time when doing the Gram-Schmidt process. It's so easy to make a mistake and one mistake just carries on.

Do it slowly and double check and check again.

5. Dec 5, 2007

### helpm3pl3ase

I did this.. just want to make sure my formula is right for vector 2.. where u1 = what you received for the first vector.

V2 =
v2 - (u1 (dot product) v2)u1
~~~~~~~~~~~~~~~~~~~~
||v2 - (u1 (dot product) v2)u1||

where ~~~~ = divide.

I did this over and over again and seem to get (1/35)v2

6. Dec 5, 2007

### Galileo

EDIT: Nevermind, your first post works out doesn't it?

You have u_2=[21 0 -28]=7[3 0 -4]

so normalize it to get the right answer.

Last edited: Dec 5, 2007
7. Dec 5, 2007

### helpm3pl3ase

i get how you got 7[3 0 -4]

but for the answer it shows:

(1/5) [3 0 -4]

So I am still not sure how the hell they got the (1/5)

8. Dec 5, 2007

### Chris Hillman

What is $3^2+(-4)^2$?

Jason: in this context, is 2000 or 2007 the more memorable number?

9. Dec 5, 2007

### helpm3pl3ase

ahhhhhhhhhhhhhh alright i think i got it.. thank you all for your help.. But what happens to the 7???

10. Dec 8, 2007

### Galileo

You are just normalizing the vector, i.e. scale it so becomes of unit length.
If v is a nonzero vector, then clearly v/|v| is a unit vector, where |v| is the norm of v.
So what is the norm of 7[3 0 -4] ?