Special Distance function

51 Views Asked by At

This is my first post. I am not a professional mathematician, but there is a question that is relevant to the work I am doing. (Please forgive me if I make any errors)

Say I got a vector $\vec{x}=(x_0,x_1,...,x_n)$ and another one $\vec{y}=(y_0,y_1,...,y_n)$ , we all know about the euclidean distance. In the case that $x_i=y_i \, \forall{i}$ then the distance is 0.

Now imagine another vector $\vec{z}=(x_2,...x_n,x_0,x_1)$. As you can see the elements of the vector are the same as with $\vec{x}$, just rotated somehow.

My question is, can we define a distance function that will consider a distance 0 for all different permutations where the order is maintained of the vector x and a distance other than 0 for other vectors?

Edit: to make things clearer. My apologies

1

There are 1 best solutions below

4
On

You can sort the coordinates of the two vectors $\vec{x}$ and $\vec{y}$ first and then use the euclidean distance.