# Distance measure for binary arrays

Basically if I have binary sequence that I want to check against, and I want to determine how far other binary sequences are to this first sequence, what is the most appropriate measure to use.

The distance measures i have seen, like Manhattan etc., all give numeric values indicating ultimately the difference, not how far one sequence is from another.

For example -

A - 0101000010

B - 0000000010

C - 0101000000

D - 0000000100

C is much closer in similarity to A, than B is. I want a measure that calculates a percentage of the relative distances between all the values seen. The distance measures would score B and D the same - I want to show that D is actually further in similarity than B, and that C is the closest.

I have tried SOkal-SneathIV and other distance measures from "A Survey of Binary SImilarity and Distance Measures", 2009 - however for the sequences which have the same mismatches (regardless of position) end up with the same score - whereas I want the position reflected in the measure.

Thanks, U.

Here is a relatively standard distance measure for binary sequences: $$d(x,y) = 2^{-n}$$ where $$x$$ and $$y$$ have the same first $$n$$ digits and differ thereafter.