Measure distance in n dimensions with Pythagoras (betterexplained.com)
Very simple, but there are some good examples here about how you might do this to quantify similarity in users based on their expressed preferences. Simple techniques are often best.
11 comments
[ 5.8 ms ] story [ 27.7 ms ] threadWhile the method presented is really simple, it's tricky to think of it as "intuitive" when n>3 without looking at a proof.
Additionally, while they /are/ harder to access, reading and understanding various proofs in Math can be an even more beautiful and enlightening experience than just seeing the practical result.
Maybe it's the difference between realizing that setf can be using on all the generalized variables and actually reading the source and seeing why. Math is full of clever hacks.
From http://www.jgc.org/tsc/
Camouflage (GWI!Camouflage!HTML) What: Like Invisible Ink, but instead of using identical colors (e.g. white on white) use very similar colors. Date added: June 2, 2003 Example from the wild: The colors 1133333, 123939, and 423939 are chosen to be very similar without being the same)
<table bgcolor="#113333"><tr><td><font color="#123939">those rearing lands</font><br> <table><tr><td><br><font color="yellow" size=5><b>Plasticine sex-cartoons.</b></font><br> <font color="#423939">eel harness highest</font><br> <font color="white" size=3>Absolutely new category of adu1t sites. </td></tr></table> <font color="#123939">nobody jets held<br>Northumbria- diamond sleep</font></td></tr></table>
%See for example: http://en.wikipedia.org/wiki/Distance
http://en.wikipedia.org/wiki/Metric_space
edit: read the second section on how to establish something is a metric space. (in the wiki article)
But finding the distance between two N-D points isn't really hard at all.
What is hard is finding the distance between a point and a set of points. Or a set and a set.
Doing exhaustive search is wasteful.
If you're interested, look in to K-D trees as a real solution. Best-bin-first modified K-D trees are the basis of the SIFT object instance recognition feature matching algorithm. Break an image into a set of ND features. Matching a geometrically consistent subset of those features to a previously seen object works extremely well.
The algorithm is general. Change and add features to make it more powerful or faster. But the idea of using a set of ND linear features to describe an object should last for years.