# 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

1
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

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. – André Nicolas Mar 29 '12 at 18:36
show 3 more comments

## 1 Answer

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.

-

There was a mapping in the programming which made the confusion , question answered . thanks – tnaser Mar 30 '12 at 15:25
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 16, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9428130984306335, "perplexity_flag": "head"}