TITLE: Let $V$ be a subspace of $R^3$ spanned by the vectors $(1,2,1)$ and $(2,1,2)$
QUESTION [1 upvotes]: a) Find an orthogonal basis for $V$.
b) Find the projection of the vector $(1,3,0)$ onto $V$.
c) Find the distance of the vector $(1,3,0)$ from $V$.
Alright, i think i got it, but i guess what I'm asking is did i do it right. Thanks for the help guys.
Let u=(1,3,0) and $v_1$=(1,2,1), and $v_2$=(1,-1,1)

REPLY [1 votes]: For (a), you'll need to justify why the basis is orthogonal. This usually doesn't work; row reducing and extracting the nonzero rows only guarantees that the vectors are linearly independent, not that they form an orthogonal set. In general, you'll want to use the Gram-Schmidt procedure.
For (b), let $\vec u = (1, 3, 0)$ and call the two vectors in your orthogonal basis $\vec v_1$ and $\vec v_2$. Then:
$$
\text{proj}_V(\vec u)
= \text{proj}_{\vec v_1}(\vec u) + \text{proj}_{\vec v_2}(\vec u)
= \frac{\vec u \cdot \vec v_1}{\vec v_1 \cdot \vec v_1}\vec v_1 + \frac{\vec u \cdot \vec v_2}{\vec v_2 \cdot \vec v_2}\vec v_2
$$
For (c), compute:
$$
\|\vec u - \text{proj}_V(\vec u)\|
$$
{"set_name": "stack_exchange", "score": 1, "question_id": 1275026}