# Minimizing a distance metric where all dimensions are small

I'm minimizing distances between two 6 dimensional vectors. I have been using manhattan distance so far and it works ok but my problem would benefit from discriminating between the following two cases

case 1.
v1 = [1, 1, 1, 1, 1, 1]
v2 = [1, 1, 1, 1, 1, 4]
manhattan(v1, v2) = 3

case 2.
v1 = [1, 1, 1, 1, 1, 1]
v2 = [1.5, 1.5, 1.5, 1.5, 1.5, 1.5]
manhattan(v1, v2) = 3


I want to have a distance measure that prefers (smaller distance) case 2 because it ensures that v1 - v2 is small in all dimensions

There is an entire family of norms, the $$p$$-norms:

$$||x||_p := \big(\sum_{k=1}^n|x_k|^p\big)^{1/p},$$

which give rise to a distance through $$d_p(x,y):= ||x-y||_p$$.

The Manhattan distance is the case $$p=1$$. The Euclidean distance is the case $$p=2$$.

You may be looking for the maximum norm and its associated distance metric, which you get by letting $$p\to\infty$$:

$$||x||_{\max} := \max \{|x_k|, k=1, \dots n\}, \quad d_{\max}(x,y)=\max\{|x_k-y_k|, k=1, \dots, n\}.$$

This will be small if all entries of your two vectors are close together.