Euclidean distance score and similarity I'm just working with the book Collective Intelligence (by Toby Segaran) and came across the Euclidean distance score. In the book the author shows how to calculate the similarity between  two recommendation arrays (i.e. $\textrm{person} \times \textrm{movie} \mapsto \textrm{score})$ . 
He calculates the Euclidean distance for two persons $p_1$ and $p_2$ by
$$d(p_1, p_2) = \sqrt{\sum_{i~\in~\textrm{item}} (s_{p_1} - s_{p_2})^2} $$
This makes completely sense to me. What I don't really understand is why he calculates at the end the following to get a "distance based similarity":
$$ \frac{1}{1 + d(p_1, p_2)} $$
So, I somehow get that this must be the conversion from a distance to a similarity (right?). But why does the formular looks like this? Can someone explain that?
 A: To measure the distance and similarity (in the semantic sense) the first thing to check is if you are moving in a Euclidean space or not. An empirical way to verify this is to estimate the distance of a pair of values ​​for which you know the meaning.
A: As you mentioned you know the calculation of Euclidence distance so I am explaining the second formula.
Euclidean formula calculates the distance, which will be smaller for people or items who are more similar. Like if they are the same then the distance is 0 and totally different then higher than 0.
However, we need a function that gives a higher value. This can be done by adding 1 to the function(so you don't get a division-by-zero error and the maximum value remains 1) and inverting it. Like if distance 0 then the similarity score 1/1=1
Let say the Euclidean distance between item 1 and item 2 is 4 and between item 1 and item 3 is 0 (means they are 100% similar). These are the distance of items in a virtual space. smaller the distance value means they are near to each other means more likely to similar. Now we want numerical value such that it gives a higher number if they are much similar. So we can inverse distance value. But what if we have distance is 0 that's why we add 1 in the denominator. so similarity score for item 1 and 2 is 1/(1+4) = 0.2 and for item1 and item 3 is 1/(1+0) = 1
A: Euclidean is basically calculate the dissimilarity of two vectors, because it'll return 0 if two vectors are similar. While Cosine Similarity gives 1 in return to similarity. Somewhat the writer on that book wants a similarity-based measure, but he wants to use Euclidean. So, in order to get a similarity-based distance, he flipped the formula and added it with 1, so that it gives 1 when two vectors are similar. Go give it a check, try it with 2 vectors contain same values.
A: The inverse is to change from distance to similarity.
The 1 in the denominator is to make it so that the maximum value is 1 (if the distance is 0).
The square root - I am not sure. If distance is usually larger than 1, the root will make large distances less important; if distance is less than 1, it will make large distances more important. 
