<s>[INST] Find orthonormal vectors for given vectors using Gram-Schmidt Doing an exercise after completing the G.S. Lecture 17 and stuck. 

Suppose we have three vectors $\begin{pmatrix}1 \\ 1 \\0  \end{pmatrix}$ , $\begin{pmatrix}1 \\ 0 \\1  \end{pmatrix}$, $\begin{pmatrix}0 \\ 1 \\1  \end{pmatrix}$ and the aim is to transform these vectors into orthonormal vectors $(A,B,C)$ using the Gram-Schmidt process. 

My working:
Let $u_1$ = $\begin{pmatrix}1 \\ 1 \\0  \end{pmatrix}$ , $u_2=$ $\begin{pmatrix}1 \\ 0 \\1  \end{pmatrix}$ and $u_3$ $\begin{pmatrix}0 \\ 1 \\1  \end{pmatrix}$
Fix $A=\frac{u_1}{||u_1||}= \frac{1}{\sqrt{2}} \begin{pmatrix}1 \\ 1 \\0  \end{pmatrix}= \begin{pmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \\0 \end{pmatrix}$
Then we can find $ B = \frac{b}{||b||} $ and to find $b$ we use the projection property: $b=b- \frac{u_1^{T}u_2}{u_1^{T}u_1}u_1= \begin{pmatrix}1 \\ 0 \\1  \end{pmatrix} - \frac{1}{2}\begin{pmatrix}1 \\ 1 \\0  \end{pmatrix} =  \begin{pmatrix} \frac{1}{2} \\ \frac{-1}{2} \\ 1 \end{pmatrix}$
Which means $ B = \frac{\sqrt{6}}{3}\begin{pmatrix} \frac{1}{2} \\ \frac{-1}{2} \\ 1 \end{pmatrix} =\begin{pmatrix} \frac{\sqrt{6}}{6} \\ \frac{-\sqrt{6}}{6} \\ \frac{\sqrt{6}}{3} \end{pmatrix}$
Lastly, we need to find $C=\frac{c}{||c||}$ and to find $c$ we use projection once again:
$ c = u_3 -\frac{u_1^{T}u_3}{u_2^{T}u_1}u_1 - \frac{u_2^{T}u_3}{u_2^{T}u_1}u_2 =  \begin{pmatrix}0 \\ 1 \\1  \end{pmatrix} - \frac{1}{2} \begin{pmatrix}1 \\ 1 \\0  \end{pmatrix} - \frac{1}{2} \begin{pmatrix}1 \\ 0 \\1  \end{pmatrix} = \begin{pmatrix} -1 \\ \frac{1}{2} \\ \frac{1}{2}\end{pmatrix}$
But apparently this is wrong, it should be: $\begin{pmatrix} \frac{-1}{\sqrt{3}} \\ \frac{1}{\sqrt{3}} \\ \frac{1}{\sqrt{3}} \end{pmatrix} $, where did I go wrong?
 [/INST] HINT
$u_2-u_3$ is orthogonal to $u_1$
in this way you can simplify the calculation assuming $u_1*=u_1$, $u_2*=u_2-u_3$
NOTE
When you calculate c you should use $u_3$, $u_1$ and $b$.
Remember the meaning of the procedure: you are subtracting to $u_3$ the components of $u_3$ on orthogonal vectors $u_1$ and $b$, to do this you use dot product by the unitaru vectors, for example for $u_1$:
$$\left(\frac{u_1}{|u_1|}\cdot u_3\right)\frac{u_1}{|u_1|}=\frac{u_1^{T}u_3}{|u_1|^2}u_1=\frac{u_1^{T}u_3}{u_1^{T}u_1}u_1$$
thus
$$c = u_3 -\frac{u_1^{T}u_3}{u_1^{T}u_1}u_1 - \frac{b^{T}u_3}{b^{T}b}b =  \begin{pmatrix}0 \\ 1 \\1  \end{pmatrix} - \frac{1}{2} \begin{pmatrix}1 \\ 1 \\0  \end{pmatrix} - \frac{1}{3} \begin{pmatrix}\frac12 \\ -\frac12 \\1  \end{pmatrix} = \begin{pmatrix} -\frac23 \\ \frac23 \\ \frac23\end{pmatrix}$$
$$|c|=\sqrt{\frac43}=\frac{2}{\sqrt3}\implies C= \begin{pmatrix} -\frac{\sqrt3}{3} \\ \frac{\sqrt3}{3} \\ \frac{\sqrt3}{3}\end{pmatrix}= \begin{pmatrix} -\frac{1}{\sqrt3} \\ \frac{1}{\sqrt3} \\ \frac{1}{\sqrt3}\end{pmatrix}$$
</s>