The Distance Between Two Vectors
The Distance Between Two Vectors
Sometimes we will want to calculate the distance between two vectors or points. We will derive some special properties of distance in Euclidean n-space thusly. Given some vectors $\vec{u}, \vec{v} \in \mathbb{R}^n$, we denote the distance between those two points in the following manner.
Definition: Let $\vec{u}, \vec{v} \in \mathbb{R}^n$. Then the Distance between $\vec{u}$ and $\vec{v}$ is $d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| = \sqrt{(u_1 - v_1)^2 + (u_2 - v_2)^2 ... (u_n - v_n)^2}$. |
We will now look at some properties of the distance between points in $\mathbb{R}^n$.
Theorem 1 (Symmetry Property of Distance): If $\vec{u}, \vec{v} \in \mathbb{R}^n$ then $d(\vec{u}, \vec{v}) = d(\vec{v}, \vec{u})$. |
- Proof: We note that $d(\vec{u}, \vec{v}) = || \vec{u} - \vec{v} || = \sqrt{(u_1 - v_1)^2 + (u_2 - v_2)^2 ... (u_n - v_n)^2}$ and that $d(\vec{v}, \vec{u}) = || \vec{v} - \vec{u} || = \sqrt{(v_1 - u_1)^2 + (v_2 - u_2)^2 ... (v_n - u_n)^2}$. To show these are equal, we must only show that $(u_i - v_i)^2 = (v_i - u_i)^2$ for $1 ≤ i ≤ n$ and $i \in \mathbb{N}$.
- Notice that $(u_i - v_i)^2 = u_i^2 - 2u_iv_i + v_i^2 = v_i^2 - 2u_iv_i + 2u_i^2 = (v_i - u_i)^2$. It therefore follows that $d(\vec{u}, \vec{v}) = d(\vec{v}, \vec{u})$ as the value underneath the square roots is equal. $\blacksquare$
Theorem 2 (Non-Negativity of Distances): If $\vec{u}, \vec{v} \in \mathbb{R}^n$ then $d(\vec{u}, \vec{v}) ≥ 0$. |
- Proof: Since $d(\vec{u}, \vec{v}) = || \vec{u} - \vec{v} || = \sqrt{(u_1 - v_1)^2 + (u_2 - v_2)^2 ... (u_n - v_n)^2}$ and $(u_i - v_i)^2 ≥ 0$ for all $1 ≤ i ≤ n$, $i \in \mathbb{N}$ then clearly $d(\vec{u},\vec{v}) ≥ 0$. $\blacksquare$
Theorem 3 (The Triangle Inequality of Distances): If $\vec{u}, \vec{v}, \vec{w} \in \mathbb{R}^n$ then $d(\vec{u}, \vec{v}) \leq d(\vec{u}, \vec{w}) + d(\vec{w}, \vec{v})$. |
- Proof: We will begin by operating on the lefthand side:
\begin{align} d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| \\ d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{w} +\vec{w} - \vec{v} \| \\ d(\vec{u}, \vec{v}) = \| (\vec{u} - \vec{w}) + (\vec{w} - \vec{v}) \| \\ d(\vec{u}, \vec{v}) \leq || (\vec{u} - \vec{w}) || + || (\vec{w} - \vec{v}) \| \\ d(\vec{u}, \vec{v}) \leq d(\vec{u}, \vec{w}) + d(\vec{w}, \vec{v}) \quad \blacksquare \end{align}
Example 1
Determine the Euclidean distance between $\vec{u} = (2, 3, 4, 2)$ and $\vec{v} = (1, -2, 1, 3)$.
Applying the formula given above we get that:
(2)\begin{align} d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| = \sqrt{(2-1)^2 + (3+2)^2 + (4-1)^2 + (2-3)^2} \\ d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| = \sqrt{1 + 25 + 9 + 1} \\ d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| = \sqrt{36} \\ d(\vec{u}, \vec{v}) = \| \vec{u} - \vec{v} \| = 6 \end{align}
Therefore $d(\vec{u}, \vec{v}) = 6$.