Let $W$ be the subspace R_3 with basis $\{(1,1,0), (0,1,-1)\},$ and let $v = (2, 0, -4)$. Find the vector in $w$ in $W$ closest to v.
This is what I've tried:
I obtained an orthogonal basis, where $w_1 = (1, 1, 0)$ and $w_2 = (-1/2, 1/2, -1).$
I then used to definition of a projection = $(v, w_1)w_1 + (v, w_2)w_2$. However, there is no answer corresponding to the vector produced this way.
I know the answer is (0, 2, -2) but I have no idea how to get there.
Edit: I forgot a negative sign in the answer. Sorry about that folks
The mistake is forgetting to divide by the norm squared.
$$\frac{(v, w_1)}{\color{blue}{\|w_1\|^2}}w_1 + \frac{(v, w_2)}{\color{blue}{\|w_2\|^2}}w_2$$
$$\frac{2}{2}(1,1,0)+\frac{3}{\frac32}(-0.5,0.5,-1)=(1,1,0)+2(-0.5,0.5,-1)=(0,2,-2)$$
Note that $(0,2,2)$ is not inside $W$.
$$a(1,1,0)-2(0,1,-1)=(0,2,2)$$
that would mean $a=0$ .