Distance from a vector to a subspace

  • Context: MHB 
  • Thread starter Thread starter smile1
  • Start date Start date
  • Tags Tags
    Subspace Vector
Click For Summary

Discussion Overview

The discussion revolves around finding the distance from a vector \(v=(2,4,0,-1)\) to a subspace \(U\) in \(R^4\), defined by a system of linear equations. Participants explore various methods to calculate this distance, including geometric interpretations and algebraic approaches.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • Some participants suggest finding a point \(a\) in the subspace \(U\) and calculating the length of the vector \(a-v\) to determine the distance.
  • Another approach involves defining the distance in terms of a metric space, leading to a quadratic function that can be minimized.
  • Some participants propose that the shortest vector connecting \(v\) to \(U\) is perpendicular to \(U\) and discuss finding a basis for \(U\).
  • There are suggestions to find an orthonormal basis for the orthogonal complement \(U^\perp\) and to project \(v\) onto this complement to find the distance.
  • One participant calculates the distance as \(\sqrt{14}\) based on their method involving projections onto \(U^\perp\).
  • Some participants express uncertainty about the correctness of their methods or calculations, with one admitting to misreading the question.
  • There is a discussion about the necessity of proving that the vectors obtained form a basis for \(U^\perp\), with references to the Gram-Schmidt process.

Areas of Agreement / Disagreement

Participants present multiple competing views on how to approach the problem, and no consensus is reached regarding the best method or the final answer.

Contextual Notes

Some methods rely on assumptions about the properties of the subspace and its orthogonal complement, and the calculations involve various mathematical steps that are not fully resolved in the discussion.

smile1
Messages
18
Reaction score
0
Hello everyone

Here is the question

Find the distance from a vector $v=(2,4,0,-1)$ to the subspace $U\subset R^4$ given by the following system of linear equations:
$2x_1+2x_2+x_3+x_4=0$
$2x_1+4x_2+2x_3+4x_4=0$

do I need to find find a point $a$ in the subspace $U$ and write the vector $a-v$ and find the length of it?
 
Physics news on Phys.org
smile said:
Hello everyone

Here is the question

Find the distance from a vector $v=(2,4,0,-1)$ to the subspace $U\subset R^4$ given by the following system of linear equations:
$2x_1+2x_2+x_3+x_4=0$
$2x_1+4x_2+2x_3+4x_4=0$

do I need to find find a point $a$ in the subspace $U$ and write the vector $a-v$ and find the length of it?

Hi smile, :)

Let \((X,\,d)\) be a metric space and \(U\subset X\). Distance between a point \(a\in X\) and \(U\) is defined as,

\[d(a,\, U)=\mbox{Inf }\{d(a,\,y):\, y\in U\}\]

In the given problem \(v=(2,4,0,-1)\) and take any vector \(u=(x_1,\,x_2,\,x_3,\,x_4)\in U\). Then,

\[d(v,\,u)=|(x_1,\,x_2,\,x_3,\,x_4)-(2,4,0,-1)|\]

This would give you a quadratic function with four variables. Since \(v\) satisfies the given equations you can reduce that into a quadratic with two variables. Then find the minimum of that quadratic (suggestion: use the second partial derivative test).

Hope this helps. :)
 
You could also use the fact that the shortest vector connecting $v$ to $U$ is perpendicular to $U$.

First find a basis in $U$. One way is to subtract the first equation from the second. Then you could pick any $x_3$, $x_4$, and $x_1$, $x_2$ would be uniquely determined. For example, $x_3=2$, $x_4=0$ gives vector $u_1=(0,-1,2,0)$, and $x_3=0$, $x_4=2$ gives $u_2=(2.-3,0,2)$. We have the following data:
\begin{align*}
|u_1|^2&=9\\
|u_2|^2&=17\\
(u_1,u_2)&=3\\
(v,u_1)&=-4\\
(v,u_2)&=-10
\end{align*}
Now state that the connecting vector is perpendicular to $U$:
\begin{align*}
(v-y_1u_1-y_2u_2,u_1)&= (v,u_1)-y_1|u_1|^2-y_2(u_2,u_1)=0\\
(v-y_1u_1-y_2u_2,u_2)&= (v,u_2)-y_1(u_1,u_2)-y_2|u_2|^2=0
\end{align*}
This gives two equations in $y_1$, $y_2$. The final answer is $|v-y_1u_1-y_2u_2|$.

All calculations should be rechecked.
 
smile said:
Hello everyone

Here is the question

Find the distance from a vector $v=(2,4,0,-1)$ to the subspace $U\subset R^4$ given by the following system of linear equations:
$2x_1+2x_2+x_3+x_4=0$
$2x_1+4x_2+2x_3+4x_4=0$

do I need to find find a point $a$ in the subspace $U$ and write the vector $a-v$ and find the length of it?
Yet another method is to find an orthonormal basis for the orthogonal complement $U^\perp$ of $U$. The two given equations say that the vectors $(2,2,1,1)$ and $(1,2,1,2)$ are in $U^\perp$. By a happy coincidence, the sum and the difference of those vectors, namely $(3,4,2,3)$ and $(1,0,0,-1)$, are orthogonal to each other. So if we divide them by their lengths, we see that the vectors $e_1 = \frac1{\sqrt{38}}(3,4,2,3)$ and $e_2 = \frac1{\sqrt2}(1,0,0,-1)$ form an orthonormal basis for $U^\perp$. The projection of $v$ onto $U^\perp$ is the vector $\langle v,e_1\rangle e_1 + \langle v,e_2\rangle e_2$, and the length of that vector is the distance from $v$ to $U$. I make it $\sqrt{14}$.
 
Sudharaka said:
Hi smile, :)

Let \((X,\,d)\) be a metric space and \(U\subset X\). Distance between a point \(a\in X\) and \(U\) is defined as,

\[d(a,\, U)=\mbox{Inf }\{d(a,\,y):\, y\in U\}\]

In the given problem \(v=(2,4,0,-1)\) and take any vector \(u=(x_1,\,x_2,\,x_3,\,x_4)\in U\). Then,

\[d(v,\,u)=|(x_1,\,x_2,\,x_3,\,x_4)-(2,4,0,-1)|\]

This would give you a quadratic function with four variables. Since \(v\) satisfies the given equations you can reduce that into a quadratic with two variables. Then find the minimum of that quadratic (suggestion: use the second partial derivative test).

Hope this helps. :)

Sorry, I guess my method is incorrect, as I have misread the question and calculated the distance from the point \((2,4,0,-1)\) to the subspace as opposed to the distance from the vector to the subspace. :)
 
Opalg said:
Yet another method is to find an orthonormal basis for the orthogonal complement $U^\perp$ of $U$. The two given equations say that the vectors $(2,2,1,1)$ and $(1,2,1,2)$ are in $U^\perp$. By a happy coincidence, the sum and the difference of those vectors, namely $(3,4,2,3)$ and $(1,0,0,-1)$, are orthogonal to each other. So if we divide them by their lengths, we see that the vectors $e_1 = \frac1{\sqrt{38}}(3,4,2,3)$ and $e_2 = \frac1{\sqrt2}(1,0,0,-1)$ form an orthonormal basis for $U^\perp$. The projection of $v$ onto $U^\perp$ is the vector $\langle v,e_1\rangle e_1 + \langle v,e_2\rangle e_2$, and the length of that vector is the distance from $v$ to $U$. I make it $\sqrt{14}$.

I have a little question that perhaps you could clarify. :) How do we know that \(e_1\mbox{ and }e_2\) form a basis for \(U^\perp\)? Don't we have to show that?
 
Sudharaka said:
I have a little question that perhaps you could clarify. :) How do we know that \(e_1\mbox{ and }e_2\) form a basis for \(U^\perp\)? Don't we have to show that?

they are obtained by using the Gram-Schmidt orthogonalization, so I think they are basis automatically, if you want to prove that just using the definition of basis.
Hope that helps.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
2
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K