# Sunday Function

Time for a vacation! Grab a globe of the earth and pick a random number between 0 and 180 degrees for your latitude and between 0 and 360 for your longitude and set off on your vacation. It’s exciting! You’re bound for anywhere on earth, and every obscure location has the same probability of being chosen!

“Not so fast,” the stern voice of vector calculus intones. “In fact not every location is equally probable. You’re most likely to be visiting one of the polar regions if you pick a location using your method.”

Why is this? Picture abstractly a globe of the earth with a latidude and longitude grid laid over it, like so:

What you’ve done is to pick a latitude and longitude with uniform probability. This means you’re equally likely to end up in any one of those square-ish grid sections. But the grid sections each contain less area as you get closer to the poles and so the grid density per area increases as you go farther from the equator. There’s more opportunities to land near a pole than elsewhere.

Well, you have nothing against the polar regions but you don’t want to be biased. How can you pick a latitude and longitude such that every location has equal probability? The answer is that you need a weighting function to artificially even out the probabilities. This is called in vector calculus the differential element of solid angle. For spherical coordinates it’s our Sunday Function:

So as you go toward the equator the sine of the angle between your location and the earth’s polar axis approaches a maximum and therefore the probability density reaches a minimum. Correcting for this requires a little bit of manipulation from this formula which I will skip, but you can read about the technical details here. Once you do the correction, you can pick latitude and longitude weighted in such a way as to make your random location uniformly distributed on the surface of the earth.

Now you’ll probably end up vacationing in the ocean, but I’ll leave correction for that as an exercise for the reader!

1. #1 Jasper
October 19, 2008

A good Sunday Function choice.

2. #2 Uncle Al
October 19, 2008

Pacoima, CA. damn.

3. #3 Carl Brannen
October 19, 2008

The other day I was asked to explain why physicists use non commutative groups to one of my young relatives. I asked her, “suppose you were somewhere on the earth. You walk 1 mile north, than 1 mile east, then one mile south, and finally 1 mile west. Do you end up where you started?”

On getting an answer of “yes”, I said, okay, “what about 100 miles?” “1000 miles?” Getting out a globe, I showed that, indeed, you clearly don’t get back where you started for 1000 miles, and so this suggests that you only get back to where you started approximately for the 1 mile case.

4. #4 Pseudonym
October 19, 2008

And, of course, thanks to Archimedes, if you pick “z” randomly rather than latitude, you don’t need a weighting function.

5. #5 Nick
October 20, 2008

I don’t think the premise here is correct!

while it i’s true there is less area closer to the poles, the probability that you will pick any particular latitude is the same.

You have equal probability of picking the equator as you do the poles, or any latitude in between.

It is true, however, that it is more likely that places near the poles will be more likely to be within a specified distance to a meaningful location (such as a city), because the distribution of random locations will be denser, but there is no difference in the probability that the location you choose will be any specific latitude.

6. #6 Matt Springer
October 20, 2008

That’s actually the main issue – that a random latitude and longitude isn’t equivalent to a random piece of area. Your odds of landing on a specified square mile in Barrow, Alaska are significantly higher than your odds of landing in a specified square mile in Equador.

7. #7 Nick
October 21, 2008

I agree, but the way you stated the premise: “There’s more opportunities to land near a pole than elsewhere.” That statement is not correct.

Looking only at latitude, you are equally likely to choose a high number as a low number.

Looking at longitude, there are equally many degrees of longitude at 89 degrees as there are at the equator.
That the random locations are closer makes no difference, they are still distinct locations.

The only reason area would come into the picture is if you were to say that if two locations were within a specified distance of one another, they count as the same location.

It seems like you are treating degrees of latitude and longitude as units of distance, but they are units of angle.
It doesn’t matter how big the circle is a degree is still a degree, whether it’s length is an inch or a mile.

8. #8 Matt Springer
October 21, 2008

Actually looking at things in terms of area is inescapable. The probability of landing on any given location is exactly zero everywhere, as there’s an infinite number of possible locations. The differential area element represents an areal probability density, which only makes sense integrated over some area.

9. #9 Paul Murray
October 22, 2008

“while it i’s true there is less area closer to the poles, the probability that you will pick any particular latitude is the same.”

True, you will not be more likely to be near the pole, rather, your chance of being within Antarctica will be larger than one would expect, given Antarctica’s area. You have a better chance of winding up in a given square metre in Antarctica than a given square metre in Barbados.

10. #10 Spinoza
October 23, 2008

“You’re most likely to be visiting one of the polar regions if you pick a location using your method.”

This is misleading. I read that to mean you’re likelier to be closer to the pole than the equator.

“Your odds of landing on a specified square mile in Barrow, Alaska are significantly higher than your odds of landing in a specified square mile in Equador”

This is correct.

There are far fewer specifiable square miles within a given distance of either pole than there within the same distance of the equator. Therefore, your chance of landing within a given distance to either pole should be the same as your chance of landing within the same distance from the equator.