Orthonormal basis for subspace spanned by $x_1=(1,1,1), x_2=(1,0,1), x_3=(3,2,3)$ How do you find an orthonormal basis for the subspace of $V_3$ spanned by the given vectors:
$$x_1=(1,1,1), x_2=(1,0,1), x_3=(3,2,3)$$
 A: As the third vector is linearly dependent forget it, and use Gram-Schmidt only on $x_1$ and $x_2$.
If you don't want to calculate that much, you can use the fact that the span of your subspace is the same as that of
$$\begin{pmatrix} 0 \\ 1 \\ 0\\ \end{pmatrix} \qquad \begin{pmatrix} 1 \\ 0 \\ 1\\ \end{pmatrix}$$
Those vectors are already orthogonal (with the standard scalar product). Just normalise them and you will be fine.
A: Gram Schmidt method is usually used to find orthonormal vector. The method is simple. Given $a,b,c$, we need to find $q_1,q_2,q_3$.
1. There is no problem with $q_1$: it can go in the direction of $a$.We divide by the length, so that $q_1=a/||a||$ is a unit vector
2. The second vector $q_2$ has to be orthogonal to $q_1$. If the second vector $b$ has any component in the direction of $q_1$, that component has to be subtracted.
$$B=b-(q_1^Tb)q_1 \text{ and } q_2=B/||B||$$ B is orthogonal to $q_1$
3. similarly, for third vector $$C=c-(q_1^Tc)q_1-(q_2^Tc)q_2 \text{ and } q_3=C/||C||$$  
Reference: Gilbert Strang Linear Algebra Book Fourth Edition
