# Gram-Schmidt Process - Can't Find a Mistake

I've been trying to apply the Gram-Schmidt procedure to $v_1=(1,1,0)^t$, $v_2=(1,0,1)^t,v_3=(0,1,1)^t$ to get an orthonormal basis of $\mathbb R^3$.

Start with $w_1=\frac{1}{\sqrt 2}(1,1,0)^t$. The orthogonal projection of $V$ onto the span of $v_1$ is given by $\pi(v_2)={(v_2,w_1})w_1=\frac{1}{\sqrt 2}w_1=\frac{1}{2}(1,1,0)$. The vector $v_2-\pi(v_2)=(1/2,-1/2,1)^t$ is orthogonal to all vectors in the span of $v_1$. After normalizing we get $w_2=\frac{1}{\sqrt 6}(1,-1,2)^t$/

Up to that point (I believe) everything was fine. I have problems with $w_3$. The orthogonal projection of $V$ onto the span of $v_1,v_2$ is given by $v_3\mapsto (w_1,v_3)w_1+(w_2,v_3)w_2=\frac{1}{\sqrt 2}w_1+\frac{1}{\sqrt 6}w_2=(2/3,1/3,1/3)$. Substracting this from $v_3$ we should get a vector orthogonal to the span of $v_1,v_2$. What I actually get is $(-1/3,2/3,2/3)$. This vector is not orthogonal to either $w_1$ or $w_2$.

What is wrong with my calculations?

• The first element should be $-2/3$. Jan 28, 2018 at 17:58
• Think about it: to be orthogonal to $(1,1,0)^T$ and $(1,0,1)^T$ is the same as $-x_1=x_2=x_3$. That should reveal your mistake.
– Ian
Jan 28, 2018 at 17:59
• So the third vector should be of the form $(-t,t,t)$ before normalizing (apparently with $t=2/3)$, but I still don't see where I made a mistake. The first coordinate of the vector I obtained is $0-(1/2+1/6)=-1/3$. I checked the calculations yesterday a several times, and also now, and still cannot reveal the mistake. Jan 28, 2018 at 18:08

I also stared at this for a long time without seeing the mistake. I even computed the inner products with $(\frac23, \frac13, \frac13)$ to confirm that was right. It checked out.
The mistake, then, is in subtracting that from $v_3$. And, as I noticed after way too long, the first entry should be $0-\frac23 = -\frac23 \neq -\frac13$.
• Thank you. This is a very stupid mistake. I can't stop laughing at it, since I did this computation more than 5 times, and every time I was convinced that $0-2/3=-1/3$. Jan 28, 2018 at 19:48