Let $\mathbf{b}=(3,1,2,1)^T$. Find the closest point and the distance from $\mathbf{b}$ to the following subspaces: (a) the line in the direction $(1,1,1,1)^T ;(b)$ the plane spanned by $(1,1,0,0)^T$ and $(0,0,1,1)^T ;(c)$ the hyperplane spanned by $(1,0,0,0)^T,(0,1,0,0)^T,(0,0,1,0)^T$; (d) the hyperplane defined by the equation $x+y+z+w=0$.