<s>[INST] Finding the best solution to an inconsistent system $A\mathbf{u} = \mathbf{b}$. Let $A = \begin{bmatrix}
-1 & 1 \\
2 & -1 \\
1 & 1
\end{bmatrix}$ and $\mathbf{b} = \begin{bmatrix}
1 \\
2 \\
0
\end{bmatrix}$.
1. Find a "best solution" to the inconsistent system $A\mathbf{u} = \mathbf{b}$.
2. Find the orthogonal projection of $\mathbf{b}$ onto the column space of $A$.  
For the second question the column space of $A$ has vectors that are all linearly independent. We first find the projection matrix given by $P = A(A^TA)^{-1}A^T$. Lets first calculate $A^TA$
\begin{equation*}
A^TA = \begin{bmatrix}
-1 & 2 & 1 \\
1 & -1 & 1
\end{bmatrix}
\begin{bmatrix}
-1 & 1 \\
2 & -1 \\
1 & 1
\end{bmatrix} = \begin{bmatrix}
6 & -2 \\
-2 & 3
\end{bmatrix}.
\end{equation*}
This means that
\begin{equation*}
(A^TA)^{-1} = \frac{1}{14}\begin{bmatrix}
3 & 2 \\
2 & 6
\end{bmatrix}.
\end{equation*}
Hence,
\begin{equation*}
\begin{split}
P = A(A^TA)^{-1}A^T &= \frac{1}{14}\begin{bmatrix}
-1 & 1 \\
2 & -1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
3 & 2 \\
2 & 6
\end{bmatrix}
\begin{bmatrix}
-1 & 2 & 1 \\
1 & -1 & 1
\end{bmatrix} \\
&=  \frac{1}{14}\begin{bmatrix}
-1 & 1 \\
2 & -1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
-1 & 4 & 5 \\
4 & -2 & 8
\end{bmatrix} \\
&= \frac{1}{14}\begin{bmatrix}
5 & -6 & 3 \\
-6 & 10 & 2 \\
3 & 2 & 13
\end{bmatrix}.
\end{split}
\end{equation*}
So the orthogonal projection of $\mathbf{b} = (1,2,0)$ onto the column space of $A$ is
\begin{equation*}
\frac{1}{14}\begin{bmatrix}
5 & -6 & 3 \\
-6 & 10 & 2 \\
3 & 2 & 13
\end{bmatrix}
\begin{bmatrix}
1 \\
2 \\
0 \\
\end{bmatrix} = \frac{1}{14}\begin{bmatrix}
-7 \\
14 \\
7
\end{bmatrix} = \begin{bmatrix}
-1/2 \\
1 \\
1/2
\end{bmatrix}.
\end{equation*}
Not sure what is meant by the "best solution" to the system. Any would help would be great!!!
 [/INST] Actually there are three lines $$-x+y=1, 2x-y=2, x+y=0~~~(1)$$ which make a triangle. 
pre-multiply the given inconsistent equation $$AX=B,~~  A=\begin{bmatrix} -1 & 1\\ 2 & 1 \\ 1 & 1 \end{bmatrix}, B=\begin{bmatrix} 1 \\ 2\\ 0 \end{bmatrix} ~~~~(2)$$ by $A^{T}$ to get $$ A^T A X= A^T B$$ which is nothing but $${\cal A} X= {\cal B},~~ {\cal A}_{2 \times 2},~~ {\cal B}_{2,1} ~~~(3)$$ You can then solve (3) for two unknowns $(x_0, y_0)$. This point $P(x_0, y_0)$ is inside the triangle mentioned above. This solution is a representative approximate   solution of the inconsistent  equations (1),(2).
Here in your case $${\cal A}=\begin{bmatrix} 6 & -2 \\ -2 & 3 \end{bmatrix}, ~~{\cal B}=\begin{bmatrix} 3 \\ -1 \end{bmatrix} \Rightarrow X={\cal A}^{-1} {\cal B}\Rightarrow X=\begin{bmatrix} 1/2 \\ 0 \end{bmatrix} \Rightarrow ~~x_0=1/2, y_0=0.$$ So $(1/2,0)$ is representative  solution of these inconsistent/ overdetermined equations (1) and (2). Further it will be interesting to see if it is also least square or the best solution to these equations.
</s>