## Exam 1

1. #### Question

Given two points $p=\left(3,4\right)$ and $q=\left(5,2\right)$ in a Cartesian coordinate system:
1. What is the Manhattan distance ${d}_{1}\left(p,q\right)$?
2. What is the Euclidean distance ${d}_{2}\left(p,q\right)$?
3. What is the maximum distance ${d}_{\infty }\left(p,q\right)$?

#### Solution

The distances are visualized below in green ( ${d}_{1}$), red ( ${d}_{2}$), and blue ( ${d}_{\infty }$).

1. ${d}_{1}\left(p,q\right)=\sum _{i}|{p}_{i}-{q}_{i}|=|3-5|+|4-2|=4$.
2. ${d}_{2}\left(p,q\right)=\sqrt{\sum _{i}\left({p}_{i}-{q}_{i}{\right)}^{2}}=\sqrt{\left(3-5{\right)}^{2}+\left(4-2{\right)}^{2}}=2.828$.
3. ${d}_{\infty }\left(p,q\right)=\underset{i}{max}|{p}_{i}-{q}_{i}|=max\left(|3-5|,|4-2|\right)=2$.