Pi vs. tau: Ultimate Smackdown

Spoiler alert: there's only a 0.1% chance any given 1-800 number will be found in pi or tau.

What's tau, you ask? Tau is two times pi, or as mathematicians like to put i, τ = 2 π. It turns out that in many endeavors, 2π is a more useful number in calculations than π.

pi ≅ 3.1415926535... et cetera ad infinitum
tau ≅  6.2831853071... yadda yadda

Tau is the brainchild of Michael Hartl, who launched a website in 2010 to suggest it, complete with a manifesto, and it's gotten a certain amount of traction. Personally, I like tau's unique combination of utility, whimsy and hubris for taking on the most famous fancy number in the world.

In honor of Tau Day 2014 (6/28, naturally), I've decided to settle this thing once and for all with a series of competitions between pi and tau to determine which is the better number. More useful in geometry? Better for calculating flow rate in pipes? Meh, who cares? I'm more interested in which one displays more interesting arbitrary properties.

In order to make this comparison, I calculated tau to one billion (1,000,000,000) digits, since only 100,000 digits were available. I am making the fruits of my labor available to all, you can download the 390 MB compressed text files here. That's right, baby, I singlehandedly increased the available digits of tau by a factor of 10,000. How did I do it? Well, I took pi and ... wait for it ... I multiplied it by two. Thank goodness I learned how to carry the one over 500 million times. Hey, it took my computer almost twenty minutes, that's an eternity for a multiplication (Yes, I did it in batches).

Before the games begin, I'd like to encourage those of you for whom this post just isn't geeky and long enough to check out my companion blog, prooffreaderplus, which has more data, more graphs, more ruminations. The thinking kind of rumination, not the cow kind. Oh, and there's a related webcomic I published earlier today too.

And yes, I realize many of the results of this competition would be different if humans normally had 12 fingers.


Round one: How "randomesque" are the digits?

I'm using "randomesque" because random is totally the wrong word (see prooffreaderplus for more in that vein), but you know what I mean: are the digits uniformly distributed so that there are about the same number of zeroes, ones, twos, etc cumulatively at any given digit? Let's look at the cumulative digit averages (for an equal distribution it would be 4.5) and the r-squareds compared to a uniform distribution:


You can see that early on, tau is consistently above the ideal average, and pi, except for a brief surge before digit 162, is below. This is similar to the random walk simulation that computer programmers and others learn. We would expect a randomesque number to dip above and below the line, which pi does more often than tau. Over the first 1,000 digits, pi is closer to 4.5 than tau 59 times more than the reverse; so let's call pi the winner by a nose.

A randomesque number should have a high r-squared compared to equal distribution. This one is tough to call; on the one hand, pi's R squared is greater than tau's 80% of the time in the first 1,000 digits. However, the biggest differences between the two belong to tau early on. I call this a draw.

This round goes to pi by the slimmest of margins. Can tau make up the gap in the second and final round? Isn't this exciting? Are you not entertained?


Round two: How many totally arbitrary patterns can we find?

This competition is sort of the opposite of the previous, since the more "randomesque" a number is, there fewer patterns we should find. But it's human nature to want contradictory things (freedom and security? yeah, I went there), so here goes.

First of all, I have some devastating news. As mentioned above, the odds of finding a particular 11-digit number among the first billion are approximately 0.9949%, so it's understandable that, tragically, the phone number corresponding to 1-800-SIR-MIX-A-LOT does not appear in the first billion digits of either pi or tau. (And yes, I truncated it to 11 digits, 1-800-SIR-MIX-A-. The chance of finding a fourteen-digit number is 0.0009989%.)

Thank you to self-described tauist Ben Weiss, who went above and beyond the call by actually verifying one of the numbers below; it was, erm, a little off. I verified some of the results and thought that meant they were all correct. Thankfully, nothing substantial was wrong, and I've corrected the mistakes. I think. Caveat emptor, always.

"Jenny's number" (867-5309) is a different story: pi has it earlier (digit 9,202,590 to 10,224,730 for tau) and more often (102 to 94 times). A point for pi, and a well-deserved acknowledgement of the genius of Tommy Tutone.

The first possible 1-800 number in tau is 1-800-647-6185 at digit 8985, over 14,000 digits earlier than pi's 1-800-469-6169. A point for tau. (A Google search of both numbers turns up nothing; too bad, one of them could have had a great claim to fame! I'm too chicken to try dialing them, let me know if you do.)

How about repeated digits? It's a wash. They both have the same maximum number of consecutive repeated digits at almost the same position, which makes sense since τ = 2 π: pi's 666666666667 at digit 45,681,780 becomes tau's 933333333333. Draw.

Tau wins the Fibonacci sequence search: pi only goes up to 11235813 at position 48,300,973, but most of the way to a billion, at 809,073,288, tau adds the next number, 21.
Pi edges tau in consecutive even, odd, prime and binary numbers, but tau takes it away with longest stretch without a number: more than a third of the way to a billion, at digit 362,783,626, there is a stretch of 210 digits without the number 6, blowing away pi's 196-digit stretch without an 8. This one to tau by a nose.

Finally, the coolest thing in my opinion is for a number to recapitulate itself. At digit 50,366,471 pi has 31415926... eight digits, not bad. What about tau? It gets one digit, recapitulating itself to nine places almost halfway to a billion, at position at 405,747,242! Not only that, tau recapitulates pi even better than pi does: 9 digits, only at position 52,567,169!

By my count, we have a winner.

And the winner is:


If you want to calculate the circumference of any of those firework circles, I know a good number you can use. And if any other number objects, they can shut their pi hole.

Webcomic #15: A Little Knowledge...


The Monty Hall Problem is cognitive Three-Card Monte


(See what I did there in the title?)

The Monty Hall Problem is a rather famous brain teaser, a rare mathematical puzzle that entered pop culture so successfully it was featured in a movie. I'm not that interested in providing yet another explanation of its counterintuitive correct answer; there are dozens on the Internet, for example here and here and here and here and here.

What fascinates me is why so many smart people get the answer wrong: I'll admit, the first time I encountered it, I picked the intuitive, incorrect answer. When The Problem first became famous in a newspaper column in 1990, over 1,000 Ph.D.s wrote letters to argue argue that the correct solution was, in fact, wrong; one world famous mathematician took a lot of convincing before he came around. Like most people when their backs up are against a wall, they dig their heels in, and when they are finally shown their error to their satisfaction (often with the help of computer simulations), they grumble that the question was posed ambiguously (for example, it doesn't explicitly state that space aliens aren't manipulating Monty Hall's behaviour... okay, I'm exaggerating, but that's the tenor of it).

Here's a quick rundown of The Problem. You're on a game show (presumably Let's Make a Deal, which Monty Hall hosted off and on for over 30 years), and there are three doors: you get whatever is behind the door you choose. One has a car, the other two have goats. (The delicious cheese isn't a bad consolation prize, if you ask me.)

You make a preliminary choice, then Monty opens one of the other two doors to reveal a goat. You can either stick with your original choice or choose the other unopened door. Should you change? Should you stay? Does it matter?

Short answer: it matters. You should change to the other door, you double your chances of winning the car. Most people instinctively think it doesn't matter whether they stick or change.Once it's explained, it takes a while to process, but eventually it's like an optical illusion: you couldn't see it at all at first, and now you can't not see it, and it's difficult to imagine why other people don't see it too. (Again, I'm not going to get into the explanation, other people have done it far more thoroughly than I ever could, click the links above or Google it if you need it proven to you).

Studies have shown that psychology plays a factor in perception (people want to stick with their first choice for emotional reasons), and I'll buy that, but it doesn't explain why really, really smart people are so prone to making fools of themselves trying to prove a fallacy.

Actually, I think the answer is rather simple: it's a mental card trick. The Problem is like a short con artist playing Three-Card Monte, making you think the queen is moving when it's staying in one hand. The problem has the appearance of randomness when it is anything but: the participation of Monty Hall himself in the Monty Hall Problem is what changes the odds.

If you first pick a door with a goat behind it, you don't know what you've just picked -- but Monty does. He has to, otherwise he has a 50% chance of ruining the game by revealing the car. (Unless that makes you win the car, but that would be a different game, and much less of a Problem in both senses of the word). Here is the kicker: Monty is constrained in what door he opens for you; it is not a random selection. He has to open a door with a goat: by doing so, he has passed information to you and changed the odds of the game. He has the appearance of a random player, but he is anything but.

(At this point, most people still don't believe Monty has passed information to the player. He has, I guarantee it, Google it and eventually your brain will warp enough to understand how. I'll dispel the most common objection right now: if you picked the door with the car first, Monty's choice is indeed random, but you've only got a 1 in 3 chance of that happening. Two out of three times, Monty is 100% constrained, which means overall he's 66% constrained. Now back to your regular programming.)

There's been a lot of academic attention on Bayesian probability in the past decade, for good reason: it works. The Monty Hall problem is a textbook (literally) demonstration as to the value of Bayes' theorem. I won't get into the details, I'll just pass along the best analogy of the Bayesian approach I ever heard: If you toss a coin and get heads nine times in a row, a traditional mathematician will say the chance of a head on the next toss is 50% because each toss is an independent event. A Bayesian mathematician will say the chance of a head on the next toss is just about 100%, because given the fact that you got nine heads in a row, it's a virtual certainty that you're using a two-headed coin.