How To Measure Any Distance With The Pythagorean Theorem

Hi People,

Please correct me if I am missing something here.

As stated above this theorem can apply to any orthogonal dimensions. In that sense if we need to measure the distance between people’s preference about movies then we have to first ensure that the three questions

  1. How did you like Rambo? (1-10)
  2. How did you like Bambi? (1-10)
  3. How did you like Seinfeld? (1-10)
    are actually orthogonal. That is to say, there is no relation between the response that any random person would give for any two of the three questions. For instance if any one who like Bambi is also likely to like Seinfeld, then these questions are not orthogonal. I am not a maths/stats expert but I feel this can be checked by calculating the correlation coefficient between the responses to any two questions. The coefficient for all pairs should be close to 0, only then we can apply Pythagoras Theorem.

On similar lines we can say that temperatures on Mon through Friday are not likely to be orthogonal. Rather they are likely to be linear. If it has been hot on Monday, Tuesday is more likely to be hot than cold. The same is the case with Age, Height and Weight.

@Min: I agree, it can be really eye-opening to see old results in a new light, and how “simple” equations can be responsible for so much.

@Gav: Thanks for dropping by, I hope you find it helpful.

@Sylvain: You’re welcome, it’s a lot of fun and I end up learning so much when revisiting topics I thought I “knew”.

@Dhwani: Great point. Strictly speaking, the distance function works best when the quantities are orthogonal (i.e. movement in one direction has no impact on the other), but “correlation” shouldn’t be a factor. (I’m not a stats expert either, so don’t quote me on this :slight_smile: ).

For example, it may be that everyone who moves North also moves East for some reason or another. But it doesn’t change how far they are from the starting point.

Similarly, there may be a correlation between liking Rambo and liking Bambi, but it doesn’t change the absolute distance between the preferences.

Having a correlation may cause preferences to be “clumped” along patterns (like being in the North-East) vs. being randomly distributed, but I think this is a separate issue from finding distance.

[…] his fault.Better Explained gets enthusiastic about Pythagoras. No Comments Leave a Commenttrackback addressThere was an error with your comment, please try again. name email (will not be published)url […]

Dear Kalid,

You write:
“For example, it may be that everyone who moves North also moves East for some reason or another. But it doesn’t change how far they are from the starting point.”

No, it doesen’t. But it changes how you can compute that distance. As an example: if you move first 3 units east and then 4 north, you are 5 units from the origin, according to Pythagoras. But if you first move 3 units east, and then 4 units north/east according to your comment, you are not 5 units from the origin. (you are slightly longer from the origin than 5 units in that case).

I forgot to say that I agree with Dhwani (post 18): it has everything to do with correlation.
Therefore, the description in you post is not correct for correlated data.

I also agree with oele and Josef (post 5 and 6) - there are hundreds of distance measures out there, each useful in a differenet application. While Euclidean distance is convenient and easy to compute, it may in many cases give a picture that is far from correct.

And Wouter Lievens (post 3): be careful, the measure you already use may or may not be better than Euclidean distance. There is nothing that says that Euclidean distance is the best measure for such cases.

[…] How To Measure Any Distance With The Pythagorean Theorem - […]

So where’s the link to download the source code? :wink:

@Thomas: Thanks for dropping by. I should have been more clear by what I meant with the term correlation.

If there’s a “physical” reason why moving East would also move North, then yes, distance can’t be measured using the theorem.

If moving East pushed you North as well (due to a strange gust of wind) then you couldn’t measure distance accurately, as someone moving East would have “free” distance in the North direction as well.

If there’s simply a “psychological” reason (i.e., everyone decides to move along a line where x = y) then the theorem can work. Imagine people all decide to walk along a path directly North-East; they aren’t required to, but just happen to do so. In that case there is a 1-1 correlation between their North and East location, but distance can still be computed fine.

@Clinton: Not sure what you mean about source code!

[…] Pythagorean rising: We’ve underestimated the Pythagorean theorem all along. It’s not about triangles; it can apply to any shape. It’s not about a, b and c; it applies to any formula with a squared term. […]

I don’t think kids realise when they learn this how important this is - I just used Pythagoras last week to calculate the area in my bay window. My girlfriend thought I was a genius.

For LLLL,

What was the shape of your bay window?

Wow, amazing!

This is a but a special case. The special portion is the fact that space must be euclidean, that is flat. This will fail if used in a curved space (like the one we live in) over a long distance. What you really want to talk about is the Metric Tensor on a Riemannian manifold.

In 3 dimensions the familiar pythagorean theorem is a special case of the law of cosines (http://en.wikipedia.org/wiki/Law_of_cosines) which contains the inner product. This formula does NOT extend to higher dimensions in a trivial way (the inner product term gets more complicated). As always be careful in generalizing a special case!

@Chris: Thanks, glad you liked it.

@George: Thanks for the info, it may be helpful for people who want to dive into more details [I may do a separate follow-up on these topics].

Good job. Just add a warning against abuse.

"Qualitative is nothing but poor quantitative."
Rutherford

"Not everything that counts can be counted, and not everything that can be counted counts."
Einstein

My heart is with old man Bert here. I’m sick of meaningless measures overdose. Think a moment before you produce your whatevermeter.

Hi Martin, thanks for dropping by. Yes, when you have a hammer everything starts looking like a nail.

It’s good to bend your brain with new uses, but all things in moderation. Don’t go trying to rank your favorite kid this way :).

Prior to reading your post, I had to determine if my 16 foot canoe would fit in the cheapest rental space. The dealer said (remarkably) that it might, if I could figure the length, width, height dimensions properly (I was surprised that he knew it could be calculated, and if so, why he was holding a job renting storage spaces). The result of my calculation (Pythagoras Theorem in 3 dimensions) predicted that I wouldn’t be able to close and lock the overhead door if the canoe were laid flat on the floor, but I might be able to it one end of the canoe were raised up to the ceiling in the storage space. Interesting post, and it certainly promises to go beyond the usual conceptual bounds of three dimensions.

Hi, I’m glad it was useful for you! (This is about as real-world as it gets).

Just be sure to leave a bit of buffer – the Pythagorean Theorem works well for things like strings or rods of zero-thickness; make sure the sides of the canoe don’t hit the corners :slight_smile:

hello, very nice article. i really enjoyed it. my friends are appreciating too [:)]