I was asked why I didn't do a Pi day post. Sadly I didn't have any pie to celebrate, but I'll try and make up for it a bit late.

π is a wonderful number. Deeply related to so much as well as being irrational and transcendental. But it turns out I’ve never needed more than five or six digits. Randall Munroe (xkcd) nails it:

My sophomore quantum mechanics professor liked to add a few math problems to homework assignments. Nothing deep, but unusual to encourage critical thinking. On the 14th of march he gave a pop quiz. We had twenty minutes to calculate the probability that the ratio of two random numbers x and y, where each is between 0 and 1, is even.

It turned out this was his Pi day fun. (he was Swedish where Pi day would be the 22nd of July, but he used the American date convention). He didn’t grade it - either you saw it immediately or 20 minutes wasn’t long enough. He served apple pie afterwards. Apple, of course, for Newton although I’ve though cherry more appropriate as Einstein loved cherry pie and the 14th of March was his birthday.

Here's how I approached it:

I’m summing the areas for regions for ratios closest to even integers for all even integers by measuring triangles. The area for the region closest to 0 is 1/4, 2 is (1/3 - 1/5), 4 is (1/7 - 1/9) ... there’s a clear pattern. The pattern is almost the expansion of the arctangent of 1 which happens to be π/4. Adding 1 gets us there. The probability the ratio is even is 1/4 + 1 - π/4 or (5 - π)/4.

A more important point is things aren't always what they seem. Not only does π turn up, but our intuition about the answer was wrong. The component for 0 isn't symmetrical and that leads to a 46.46% percent probability rather than 50%.

Obvious first guess are often wrong and can lead to enormous problems. We're bad at probability and risk analysis. Not exactly a good thing given technology.

## Comments

You can follow this conversation by subscribing to the comment feed for this post.