# Subspaces in Linear Algebra

Find the $\operatorname{Proj}_wv$ for the given vector $v$ and subspace $W$. Let $V$ be the Euclidean space $\mathbb{R}^4$, and $W$ the subspace with basis $[1, 1, 0, 1], [0, 1, 1, 0], [-1, 0, 0, 1]$

(a) $v = [2,1,3,0]$

ans should be - $[7/5,11/5,9/5,-3/5]$

My attempt at the solution was basically we can find the basis perpendicular to $W$ as $[ 1,-2,2, 1]$ then, $[2, 1, 3, 0] = a[1, 1, 0, 1] + b[0, -1, 1, 0] + c[0 ,2, 0,3] + d[1,-2,2,1]$ We solve for $a,b,c,d$ and get $a = 16/3,b=29/3,c=-2/3,d=-10/3$ now the problem is what do I do from here?

-
To type $\mathbb{R}^4$, type $\mathbb{R}^4$. – Arturo Magidin Nov 29 '11 at 22:54
If you find a basis for $W^\perp$ that is orthogonal to $W$, say with Gram-Schmidt, finding the projecting is much easier. – Joe Johnson 126 Nov 29 '11 at 23:10
Or, finding an orthonormal basis for $W$ itself makes finding the projection very easy. – Arturo Magidin Nov 29 '11 at 23:15

You can do it that way (though you must have an arithmetical error somewhere; the denominator of $3$ cannot be right), and the remaining piece is then simply to take $a[1, 1, 0, 1] + b[0, -1, 1, 0] + c[0 ,2, 0,3]$, forgetting the part perpendicular to $W$.
However, it is much easier to normalize your $[1,-2,2,1]$ to $n=\frac{1}{\sqrt{10}}[1,-2,2,1]$ -- then the projection map is simply $v\mapsto v - (v\cdot n)n$. (If you write that out fully, the square root even disappears).
I did that and I end up getting $(9/5,3/5,9/5,0)$. Just redid it here to see if I had made an error - bit.ly/s9wIOw on WolframAlpha – eWizardII Nov 29 '11 at 23:33