in reply to Hashes: Find similar entries!

Why is (3,9,4,2,1) more similar than (100,100,100,100,100)?

Do you mean (3,9,4,2,1) is more similar to (5,7,2,5,1) than (100,100,100,100,100) to (5,7,2,5,1)?

If you want some amount of similarity between two ordered sets, I would interpret them as vectors and look at the Cosine Similarity between the two. This will give you a measure for the "direction" of where the two vectors point, so you will likely also want to compare the length of the two vectors.

An alternative if your sets aren't really vectors would be to order them by size and compute the squared difference between each two numbers in the same place.

If your sets still are ordered but the cosine similarity doesn't give you equality when you want it would be to just calculate the squared difference between each of the set elements.

Replies are listed 'Best First'.
Re^2: Hashes: Find similar entries!
by Trace On (Novice) on Jan 08, 2016 at 08:12 UTC
    Distance! That's it! Thank you, guys!