[Math] Gram-Schmidt Process to find an orthonormal basis for a matrix

linear algebraorthonormal

By using the Gram-Schmidt Process find an orthonormal basis for the
column space of the matrix:

$$A=\begin{pmatrix}0 & -3 & 1 \\ 1 & 0 & 1 \\ 1 & -3 &
0\end{pmatrix}$$

Note: The basis vectors should be normalised so that the third entry
in each column vector is positive.

Having tried the question I obtained a basis consisting of:

$$x_1 = [0, 1, 1]$$
$$x_2 = [-3, 3/2, -3/2]$$
$$x_3 = [1, 1/2, -1/2]$$

The note part of the question confuses me however as I fail to see how this will make the basis of positive.

Help is very much appreciated.

Best Answer

Your vectors are neither orthogonal ($x_2 \cdot x_3 = -1.5)$, nor normal.

The note to your question points to the choice, given a normal vector $n$, of choosing either $n$ or $-n$ as normal.

How to orthonormalize:

We could start with $x_1$ and keep it as first vector of the new base, $x_1' = x_1$.

We want to end up with normal vectors as well, so it is better to do the normalization now. The second vector is the second given vector without the parts in direction of the first new base vector: \begin{align} x_1'' &= \frac{x_1'}{\sqrt{x_1' \cdot x_1'}} = \frac{x_1}{\sqrt{x_1 \cdot x_1}} \\ x_2' &= x_2 - (x_1'' \cdot x_2) x_1'' \\ x_2'' &= \frac{x_2'}{\sqrt{x_2' \cdot x_2'}} \\ x_3' &= x_3 - (x_1'' \cdot x_3) x_1''- (x_2'' \cdot x_3) x_2'' \\ x_3'' &= \frac{x_3'}{\sqrt{x_3' \cdot x_3'}} \\ \end{align} Thus here \begin{align} x_1'' &= (0, 1/\sqrt{2}, 1/\sqrt{2}) \\ x_2' &= (3, -3/2, 3/2) \\ x_2'' &= \sqrt{\frac{2}{27}}(3,-3/2, 3/2) \\ x_3' &= (2/3, 2/3, -2/3) \\ x_3'' &= \frac{\sqrt{3}}{2} (2/3, 2/3,-2/3) = (1/\sqrt{3},1/\sqrt{3},-1/\sqrt{3}) \end{align} For the third vector we removed the parts in direction of the new first and second vector.

Only $x_3''$ has negative third component, so we choose $$ x_3''' = - x_3'' = (-1/\sqrt{3},-1/\sqrt{3},/\sqrt{3}) $$