# Taxicab distance , city block distance, Manhattan distance

Is defined in Wikipedia http://en.wikipedia.org/wiki/Taxicab_geometry

But I saw it as another way of calculating it for vectors and similar

$$d = \mathrm{num}_1 + \mathrm{num}_2 - 2 \times \mathrm{intersect}$$

• $d$= distance
• $\mathrm{num}_1$ = number of values in left vector
• $\mathrm{num}_2$ = number of values in right vector
• $\mathrm{intersect}$ = intersection number of overlapping values

Is this right ? and how the equation becomes ?

-
What is the "number of values" in a vector? And what is the "intersection number of overlapping values"? – Chris Eagle Mar 29 '12 at 18:12
It is not clear what you do. I would like it if you work out an example using your formula here. So, we'll all understand what num1, num2 and intersect mean. – user21436 Mar 29 '12 at 18:13
We can consider vector as a SET , so num1 = total numbers in the set1 , – tnaser Mar 29 '12 at 18:16
I not dealing with points , but numbers in a sets. I want to compare the sets to each others to find show similar they are – tnaser Mar 29 '12 at 18:21
@tnaser: You seem to be considering the size of the symmetric difference $A\Delta B$. You might want to look up Hamming distance, which is close in spirit, and has a taxicab distance character. And intersection is quite different from symmetric difference. – André Nicolas Mar 29 '12 at 18:36

I think we've clarified that you are suggesting defining the distance between two finite sets $A$ and $B$ to be the number of elements of $A$, plus the number of elements of $B$, minus twice the number of elements in the symmetric difference of $A$ and $B$. But this would make lots of distances negative. E.g., if $A=\{{1,2,3\}}$ and $B=\{{4,5\}}$ then since $A$ and $B$ are disjoint their symmetric difference is their union and your formula gives $3+2-2\times5$ which is negative 5.