1
$\begingroup$

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 ?

  • 1
    @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.2012-03-29

1 Answers 1

1

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.

If I've misinterpreted what you propose to do, I suggest that instead of adding to the trail of comments you edit your question so it asks what you really want to ask.

  • 0
    There was a mapping in the programming which made the confusion , question answered . thanks2012-03-30