Minimum distance from a point to a subspace The subspace V in $R^4$ is the span of vectors $u = \frac 1{3} [1, -1, 1, 2]^T$ and $v = \frac 1 {5}[1, 2, 1, 1]^T$. Find the shortest distance from the point $P(1, 1, 1, 1)$ and the subspace. 
Don't really know where to start here so would really appreciate some hints and tips. I've looked up similar questions like this: Distance from point $(1,1,1,1)$ to the subspace of $R^4$ but don't really get the idea of it.
 A: The shortest distance between a point to a subspace is equal to the distance between the point to its projection.
To find the projection, we can use the Gram-Schmidt process.
Let $w=(1,1,1,1)^T$.
Let $u_1 = \frac{u}{\|u\|}$, and $v_1 = \frac{v-(v^Tu_1)u_1}{\left\|v-(v^Tu_1)u_1 \right\|}$, then $u_1$ and $v_1$ forms an orthonormal basis.
and its projection is $r=(w^Tu_1)u_1+(w^Tv_1)v_1$ and the distance is $\|w-r\|$.
A: A vector $v$ in the subspace $V$ is of the form $v=a(1,-1,1,2)+b(1,2,1,1)$. Now the distance from the  point $P(1,1,1,1)$ to the subspace  is the minimum distance between the points $P$ and $(a+b,-a+2b,a+b,2a+b)$ for all vales of $a$ and $b$. So the square of the distance
$D^2  =2(a+b-1)^2+(-a+2b-1)^2+(2a+b-1)^2$. Now minimum vales of $a$ and $b$ gives required distance.
Minimum values of  $a$ and $b$ are obtained by solving $\frac{\partial D^2}{\partial a}=0$ and $\frac{\partial D^2}{\partial b}=0$.
A: A vector of the span has coordinates
$$a (1,-1,1,2)+b (1,2,1,1)$$
the distance from $P(1,1,1,1)$ is minimum when the function
$$d^2(a,b)=2 (a+b-1)^2+(2 a+b-1)^2+(-a+2 b-1)^2\tag{1}$$
has a minimum. Its derivatives wrt $a$ and $b$ must be zero
$$\begin{cases}
14 a+4 b-6=0\\
2 a+7 b-5=0
\end{cases}
$$
$$a= \frac{11}{45},b= \frac{29}{45}$$
substitute in $(1)$ and get the distance $P,V=\frac{1}{3}\sqrt{\frac{2}{5}}$
