Consider subspace $S \in R^4$, spanned by the vectors:
$v_1 = (1,0,-1,1)^T$ and $v_2 = (1,1,1,1)^T$.
Let $v = (1,-1,-1,3)^T$.
I want to find the projection of $v$ onto $S$; that is, find the coefficients $a$ and $b$ such that the projection is $av_1+bv_2$.
How I am approaching it: The projection of $v$, $p_V(v)$ = $\sum_{i=1}^2 (v \cdot v_i)v_i $.
Some questions: (a) do I need to make $v_1$ and $v_2$ orthogonal to each other? If so, (b) I should use something like Graham-Schmidt? (c) Is there a way to do this without using something like Graham-Schmidt? (I have to do this by hand.)
you don't need to make the vectors orthogonal. here is one way to do this. let $$v = k_1v_1 + k_2v_2 +\epsilon $$ we need to choose $k_1, k_2$ so that the residue $\epsilon$ is orthogonal to the plane spanned by $\{v_1, v_2\}.$ that is $$ (1,-1,-1,3)^\top= k_1(1,0,-1,1)^\top+k_2(1,1,1,1)^\top +\epsilon$$ taking the dot products with $v_1, v_2$ give $$\begin{align}5 &= 3k_1 + k_2\\ 2 &=k_1+4k_2\end{align} $$ so $$\pmatrix{k_1\\k_2} = \frac1{11}\pmatrix{4&-1\\-1&3}\pmatrix{5\\2} =\pmatrix{18/11\\1/11}.$$ the projection is $$\frac{18}{11}v_1 + \frac{1}{11}v_2 $$