[Math] Calculate the distance of the point $(1,1,1,1)$ from the subspace $W$.

linear algebravector-spaces

This is a duplicate question.

Let $W$=span$\left(\frac{1}{\sqrt{2}}(0,0,1,1),\frac{1}{\sqrt{2}}(1,-1,0,0)\right)$ be a subspace of the Euclidean space $\mathbb{R^4}$. Then the square of the distance from the point $(1,1,1,1)$ to the subspace $W$ is equal to_____?

So this question is already been asked and has an accepted answer here.

But I didn't understand the answer fully. To be honest, I didn't get the idea at all. The answer is talking about some distance $r_{AA_w}$ I don't know nothing how to get that.

So by this question, I want to know about the concept behind the distance of a point to a subspace. How to calculate this distance and what is the idea behind this? If someone can explain this to me then it would be really helpful. Thanks.

Best Answer

Start with simple cases: What’s the distance from a point to a line? How about to a plane? After a bit of experimentation, you might hit upon the idea that it’s the minimum distance between that fixed external point and any point on the line/plane. Simple geometric considerations show that this minimum distance is obtained when we measure it in a direction perpendicular to the line/plane, and so the nearest point to the fixed external point is the latter’s orthogonal projection onto the line/plane (labeled $\pi A$ in the diagram).

enter image description here

If we subtract this projection from the original point, we get a vector that’s orthogonal to the line/plane (called the orthogonal rejection from the line/plane), so the distance we’re looking for is equal to the length of this difference vector.

One can prove in various ways that this holds in general, namely, that the minimum distance from a point to an $m$-dimensional subspace lies along a direction that’s perpendicular to it. We’ll just take that as given. So, to compute this distance, you project the point onto the subspace and find the length of the difference between that projection and the original point.

There are many ways to construct this projection, depending on what you’re starting with. For this problem, you’ve got an orthonormal basis for $W$ (verify that for yourself), so you can use what you might recognize as a step in the Gram-Schmidt process, which computes successive orthogonal rejections from ever-growing subspaces. So, letting $\mathbf w_1$ and $\mathbf w_2$ be the two basis vectors of $W$, and $\mathbf v=(1,1,1,1)^T$, you would compute $\mathbf v-(\mathbf v\cdot \mathbf w_1)\mathbf w_1-(\mathbf v\cdot \mathbf w_2)\mathbf w_2$ and then compute the norm of this vector.