Finding the orthogonal projection of a vector on a subspace The title could include "subpace with more than one base vector", because that's what I'm having trouble with.
Say we have our subspace that is spanned by $\{(1, 0 ,1),(1, 1, -1)\} $ and we have the vector $(1, 2, 3)$. The subspace is already orthogonal, how do I find the orthogonal projection of the vector on the subspace? 
 A: There is a general answer to this question that doesn't depend on the vectors being given as orthogonal. Consider the orthogonal projection onto the span of $\{ a_1,a_2,\dots,a_n \}$. Define $A$ to be the matrix whose $i$th column is $a_i$. Then the projection is the vector $Ax$ such that $Ax-b$ is orthogonal to $Ay$ for every vector $y$. That means:
$$y^T A^T (A x - b) = 0$$
for every vector $y$. It is not too hard to show that this implies $A^T (Ax - b)=0$, i.e. $A^T A x = A^T b$. The solution to this system is $x=(A^T A)^{-1} A^T b$, and the projection itself is $Ax=A (A^T A)^{-1} A^T b$. 
When the columns of $A$ are orthonormal (meaning that they are orthogonal and have length $1$), $A^T A = I_n$, which makes the formula nicer: the projection is just $A A^T b$.
A: The subspace is spanned by every vectors $\vec v = a(101)+b(11-1)$. Now you want to know how much parallel is the vector $(123)$ to this subspace. Assuming that $(123) = a(101)+b(11-1)+c \vec w$ with another "unimportant" vector $\vec w$ that completes the orthonormal Basis.
Now take the scalar product with $(101)$ and you will see that $\vec w (101) = 0,(11-1)(101) = 0$ due to orthogonality. Then you get $a$. 
Multiplication with $(11-1)$ and $\vec w (11-1) = 0$ will lead to the coefficient $b$. 
A: There is a formula for the projection on a subspace $E$  when it has an orthogonal basis (which is used in the Gram-Schmidt algorithm to find orthonormal bases: if  $(u_1, \dots, u_r)$ is such an othogonal basis, the projection of a vector $v$ onto $E\,$ is:
$$\operatorname{pr}_{_E} v=\sum_{i=1}^r \frac{\langle u_i,v\rangle}{\langle u_i,u_i\rangle}\,u_i$$
Here, you obtain $\operatorname{pr}_{_E} v=(2,0,2)$.
