<s>[INST] Questions on orthogonal projections on a subspace 
Let $u= \begin{pmatrix} 3 \\ 1 \\ 1\end{pmatrix}$ and $S = \left\{\frac{1}{3} \begin{pmatrix} 2 \\ -1 \\ -2\end{pmatrix}, \frac{1}{3}\begin{pmatrix} 1 \\ -2 \\ 2\end{pmatrix} \right\}$.
  
  
*
  
*Find the unique vectors $w \in W$ and $z \in W^\perp$, such that $z = u - w$.
  
*Find the orthogonal projection of $u$ on $W$.
  
*Verify that $z$ is in $W^\perp$.

This is what I have so far:


*

*$w = (u \cdot v_1)v_1 + (u \cdot v_2)v_2 = (3/3)v_1 + (3/3)v_2$, and after plugging in the vectors, I got $w = \begin{pmatrix} 3 \\ -3 \\ 0\end{pmatrix}$, thus $z = \begin{pmatrix} 0 \\ 4 \\ 1\end{pmatrix}$.

*projection of $u$ on $W$ is $\begin{pmatrix} 0 \\ 4 \\ 1\end{pmatrix}$

*When I tried verifying that $z$ is in $W^\perp$, I was not getting $0$, so I'm not sure where I went wrong.
 [/INST] $w=(u\cdot v_1)v_1+(u\cdot v_2)v_2=(3/3)v_1+(3/3)v_2$
After plugging in the vectors and simplifying I got $w=(1,-1,0)$, thus $z=(2,2,1)$. 
Projection of $u$ on $W$ is $(2,2,1)$. 
$z\cdot v_1=4-2-2=0$  
$z\cdot v_2=2-4+2=0$
</s>