# Distance

We define the Euclidean distance between two vectors \(a\) and \(b\) as the norm of their difference: \[\mathbf{dist}(a, b) = ||a - b||\] For one, two, and three dimensions, this distance is exactly the usual distance between points with coordinates \(a\) and \(b\). However, the Euclidean distance is defined for vectors of any dimension. import numpy as np u = np.array([1.8, 2.0, -3.7, 4.7]) v = np.array([0.6, 2.1, 1.9, -1. …