# find orthonormal vectors $q_1,q_2$ in the subspace $Span\{a,b\}$ spanned by

Looking to see if my workings so far are correct, and if so then help finding my next answer to question b). I need to find orthonormal vectors $q_1,q_2$ in the subspace $Span\{a,b\}$ spanned by $a=\begin{bmatrix} 1 \\3 \\4 \\5 \\7 \end{bmatrix}$, $b=\begin{bmatrix} -6 \\6 \\8 \\0 \\8 \end{bmatrix}$ of $R^5$. My logic here was to use the Gram–Schmidt process. So,

let $x_1 = a$ and $x_2=b$ so $q_1 = x_1 = \begin{bmatrix} 1 \\3 \\4 \\5 \\7 \end{bmatrix}$
then $q_2 = x_2 - proj_{q_1}x_2 =\begin{bmatrix} -6 \\6 \\8 \\0 \\8 \end{bmatrix} - \frac{x_2q_1}{q_1q_1}q_1 = \begin{bmatrix} -6 \\6 \\8 \\0 \\8 \end{bmatrix} - \frac{100}{100}\begin{bmatrix} 1 \\3 \\4 \\5 \\7 \end{bmatrix} = \begin{bmatrix} -7 \\3 \\4 \\-5 \\1 \end{bmatrix}$ If this logic is correct which vector in the subspace is closest to $\begin{bmatrix} 1 \\0 \\0 \\0 \\0 \end{bmatrix}$?

• $\|q_1\|\ne1$. Your basis is orthogonal, but not orthonormal. – amd Nov 24 '16 at 22:16
• @amd how do I fix that then? – jh123 Nov 24 '16 at 22:29
• Normalize the two vectors, of course. – amd Nov 24 '16 at 22:30
• @amd okay so $q_1= \frac{1}{10} \begin{bmatrix} 1 \\3 \\4 \\5 \\7 \end{bmatrix}$ ??? – jh123 Nov 24 '16 at 22:34
• That’s right. You’ll also seed to normalize $q_2$. – amd Nov 24 '16 at 22:37

First off, $\|q_1\|\ne1$ and $\|q_2\|\ne1$, so you have an orthogonal basis instead of an orthonormal one, but that’s easily remedied: simply normalize the two vectors.
For the second part, think about a similar situation in $\mathbb R^3$. The shortest distance between a point $P$ and a plane is along a line that’s perpendicular to the plane, so the closest point on the plane to $P$ lies at the intersection of this perpendicular line and the plane. In vector terms, it’s the orthogonal projection of $P$ onto the plane. The same principle holds in higher dimensions. Since you’ve now got an orthonormal basis for the span of $a$ and $b$, computing this projection is a simple matter.