MHB Distance from a vector to a subspace

  • Thread starter Thread starter smile1
  • Start date Start date
  • Tags Tags
    Subspace Vector
Click For Summary
SUMMARY

The distance from the vector \(v=(2,4,0,-1)\) to the subspace \(U\subset \mathbb{R}^4\), defined by the equations \(2x_1+2x_2+x_3+x_4=0\) and \(2x_1+4x_2+2x_3+4x_4=0\), can be calculated using the projection onto the orthogonal complement \(U^\perp\). The vectors \((2,2,1,1)\) and \((1,2,1,2)\) form a basis for \(U^\perp\). By applying the Gram-Schmidt process, the orthonormal basis vectors \(e_1\) and \(e_2\) are derived, leading to the conclusion that the distance from \(v\) to \(U\) is \(\sqrt{14}\).

PREREQUISITES
  • Understanding of metric spaces and distance definitions.
  • Knowledge of linear algebra concepts, particularly subspaces and orthogonal complements.
  • Familiarity with the Gram-Schmidt orthogonalization process.
  • Ability to work with quadratic functions and optimization techniques.
NEXT STEPS
  • Study the properties of metric spaces and distance functions in linear algebra.
  • Learn about the Gram-Schmidt process for orthogonalization in vector spaces.
  • Explore the method of projections in linear algebra, particularly onto subspaces and their orthogonal complements.
  • Investigate optimization techniques for minimizing quadratic functions in multiple variables.
USEFUL FOR

Students and professionals in mathematics, particularly those focusing on linear algebra, optimization, and geometric interpretations of vector spaces. This discussion is beneficial for anyone looking to deepen their understanding of distances in vector spaces and subspace projections.

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
3K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
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
1K