Distance from vector to a subspace

linear algebra

Determine the distance of $v = (1,2,3)^T$ from the subspace $V =\operatorname{span}(v_1,v_2,v_3)$ where $v_1=(1,1,0)^T, v_2=(0,1,1)^T, v_3=(2,4,2)^T.$

Using Gram-Schmidt I obtain the basis $\left[ \begin{array}{c} \frac{\sqrt{5}}{5} \\\\ 0 \\\\ \frac{2 \sqrt{5}}{5} \end{array} \right], \left[ \begin{array}{c} – \frac{4 \sqrt{5}}{15} \\\\ \frac{\sqrt{5}}{3} \\\\ \frac{2 \sqrt{5}}{15} \end{array} \right], \left[ \begin{array}{c} 0\\\\ 0 \\\\0 \end{array} \right]$ for $V.$ Now the projection from $v$ to the subspace $V$ $$\hat{v} = \frac{v \cdot v_1}{v_1 \cdot v_1}\cdot v_1 + \frac{v \cdot v_2}{v_2 \cdot v_2}\cdot v_2 + \frac{v \cdot v_3}{v_3 \cdot v_3}\cdot v_3 = \begin{bmatrix}\frac{1}{3}\\ \frac{4}{3}\\ \frac{10}{3}\end{bmatrix}$$ so the distance would be $\|v-\hat{v}\|= 1$, but this seems not to be correct. What might I be doing wrong? The orthonormal basis should be enough to measure the distance just from the projection vector?

Best Answer

Simple test of row reduction will show that subspace V has dimension 2 which is a plane. $v_1,v_2$ can be taken a basis, take a cross-product $v_1\times v_2 = (1,-1,1)$ which is the normal('s direction ratios). Equation of plane that represents $V$ is given by $x-y+z=0$ and using distance formula $$d=\left|\frac{ax_1+by_1+cz_1-d}{\sqrt{a^2+b^2+c^2}} \right| = \frac{1-2+3}{\sqrt{3}}=\frac{2}{\sqrt3}$$

Related Question