distance between two person.

person A like to watch movie by 3 unit. person B like to watch movie by 4 unit.

in this case we can tell the distance between person A and B. person A is 1 unit away from person B.

we can just subtract 3 from 4.(or subtract 4 from 3 and make it absolute value)

what if there are 2 factor? person A like to watch movie by 3 unit. person B like to watch movie by 4 unit. person A like to read book by 4 point. person B like to read book by 3 point. they are sqrt(2) unit away

see the picture I attached for reason does it make sense?


  • $\begingroup$ What are you using these distances for? $\endgroup$
    – lynn
    Commented Jul 9, 2014 at 3:06
  • $\begingroup$ I've learn this from some website. and I just wonder if it is correct. maybe it's useful for social network algorithm. e.g. find person who has similar interest. $\endgroup$
    – Taeyun
    Commented Jul 9, 2014 at 3:11
  • 1
    $\begingroup$ In answer to your last question, your calculation is correct; you would use the "distance formula", which is based on the Pythagorean Theorem. $\endgroup$ Commented Jul 9, 2014 at 3:13
  • $\begingroup$ I wonder if the approach make sense.(and why) $\endgroup$
    – Taeyun
    Commented Jul 9, 2014 at 3:14
  • $\begingroup$ The Euclidean distance has an arbitrary character, but it is not obviously terrible, and has pleasant technical properties, so why not? $\endgroup$ Commented Jul 9, 2014 at 3:22

2 Answers 2


Well done, you are correct! You see that little red triangle you created at the top? The hypotenuse will be your distance. We know that each side is 1 unit long and so by the Pythagorean theorem we can calculate our hypotenuse.

s^2 + s^2 = h^2 (pyth)

1^2 + 1^2 = h^2


sqr2 = h

Sorry for all the ^2 and so on. Still trying to figure out how to use the math functions on this site.

A graphical solution

Hope this helps :)

  • $\begingroup$ Please keep in mind that I approach these questions from a high school perspective so obviously this is a very straight forward way of interpreting this question. Obviously using the distance formula will work just as well. $\endgroup$
    – Bearboots
    Commented Jul 9, 2014 at 9:33

Without getting too far into norms, this is working on the distance between two points using the $L_2$ norm, which is the Pythagorean Theorem for many variables: $\sqrt{(x_1-y_1)^2+(x_2-y_2)^2+(x_3-y_3)^2}$.

The only other "distance" that would make sense would be the Manhattan distance (which is the $L_1$ norm). This is the distance if you only walked on the grid lines: $|x_1-y_1|+|x_2-y_2|+|x_3-y_3|$ which is just the sum of the distances in each category. So the difference in books plus the difference in movies. For your example, it would be 2.

Both are acceptable ways to determine how close two things are.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .