Using Gram-Schmidt to find the QR decomposition I'm having problems doing a QR decomposition of a matrix...
Let $A=\begin{bmatrix}
    {1} & {1} & {0} \\
    {0} &{1} &{1} \\
   {1} & {0} &{1} 
\end{bmatrix}$
Find the QR decomposition for A
Here's what I've been doing:
I choose this basis, $B=\left \{(1,0,1), (1,1,0), (0,1,1)\right \}$ (the columns of the matrix).
Now I use the Gram-Schmidt process (and this is where I'm having trouble)
$u_{1}=(1,0,1)$
$u_{2}=(1,1,0)$ (cuz $<(1,0,1), (1,1,0)>=0$)
$u_{3}=(0,1,1)-\frac{<(0,1,1), (1,1,0)>}{<(1,1,0), (1,1,0)>}(1,1,0)-\frac{<(0,1,1), (1,0,1)>}{<(1,0,1), (1,0,1)>}(1,0,1)=$ $(0,1,1)-1/2(1,1,0)-1/2(1,0,1)=(-1, 1/2, 1/2)$
And now I find the norm for all the three vectors:
$||u_{1}||=||u_{2}||=||u_{3}||=\sqrt{2}$
So the orthonormal basis must be $B'= \left \{(\frac{1}{\sqrt{2}},0,\frac{1}{\sqrt{2}}), (\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}},0), (\frac{-1}{\sqrt{2}}, \frac{1}{2\sqrt{2}}, \frac{1}{2\sqrt{2}})\right \}$ (Which it isn't orthonormal)
So $Q=\begin{bmatrix}
    {\frac{1}{\sqrt{2}}} & {\frac{1}{\sqrt{2}}} & {\frac{-1}{\sqrt{2}}} \\
    {0} &{\frac{1}{\sqrt{2}}} &{\frac{1}{2\sqrt{2}}} \\
   {\frac{0}{\sqrt{2}}} & {0} &{\frac{1}{2\sqrt{2}}} 
\end{bmatrix}$
Which $Q^{t}Q \neq I$ ($I$ being the identity matrix), so all I did was wrong...
Where's my mistake?

Suppose that we have $A$ as the following matrix
$$ A = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \end{bmatrix} \tag{1} $$
modified Gram Schmidt is 

$$ v_{1} =a_{1} \tag{2}$$
$$ r_{11} = \| v_{1} \| = \sqrt{ 2}\tag{3}$$
$$ q_{1} = \frac{v_{1}}{r_{11}}  = \langle \frac{1}{\sqrt{2}} , 0 , \frac{1}{\sqrt{2}} \rangle \tag{4}$$
$$ r_{12} = q_{1}^{*}v_{2} \tag{5} $$
they only share one vector entry in common
$$ r_{12} = \frac{1}{\sqrt{2}} \tag{6}$$
$$ v_{2} = \langle 1 , 1, 0 \rangle -  \frac{1}{\sqrt{2}}\langle \frac{1}{\sqrt{2}} , 0 , \frac{1}{\sqrt{2}} \rangle \tag{7} $$
$$ v_{2} = \langle \frac{1}{2} , 1, \frac{-1}{2} \rangle \tag{8} $$
$$ r_{13} = q_{1}^{*}v_{3} \tag{9}  $$
$$ r_{13} = \frac{1}{\sqrt{2}} \tag{10}  $$
$$ v_{3} = \langle  0 , 1, 1 \rangle  - \frac{1}{\sqrt{2}} \langle 0 , \frac{1}{\sqrt{2}} , \frac{1}{\sqrt{2}} \rangle \tag{11} $$
$$ v_{3} = \langle  0 , 1, 1 \rangle  - \langle 0 , \frac{1}{2} , \frac{1}{2} \rangle 
 = \langle 0 , \frac{1}{2} , \frac{1}{2} \rangle \tag{12} $$
Now we repeat
$$ r_{22} = \| v_{2}\| =\sqrt{(\frac{1}{2})^{2} + 1 + (\frac{1}{2})^{2} }\tag{13}$$
$$ r_{22} = \| v_{2}\| = \frac{\sqrt{6}}{2}\tag{13}$$
$$ q_{2} = \frac{v_{2}}{r_{22} } \tag{14} $$
$$ q_{2} = \langle \frac{\frac{1}{2}}{\frac{\sqrt{6}}{2}}, \frac{1}{\frac{\sqrt{6}}{2}} ,\frac{\frac{-1}{2}}{\frac{\sqrt{6}}{2}} \rangle \tag{15} $$
$$ q_{2} = \langle \frac{1}{\sqrt{6}}, \frac{2}{\sqrt{6}} ,\frac{-1}{\sqrt{6}} \rangle \tag{16} $$
Go on from there..
