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.
In reply to Re: Hashes: Find similar entries!
by Corion
in thread Hashes: Find similar entries!
by Trace On
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |