Today (3/14) is Pi Day, an informal occasion celebrated by math lovers around the world.1 Even interested non-mathematicians (such as yours truly) can find the infinitude of pi attractive and compelling. One part of its allure is the way it pops up in the most unexpected places. For one example, it appears in the equation for Einstein’s General Relativity:
Recently, I mentioned mathematician Eugene Wigner and his famous paper, The Unreasonable Effectiveness of Mathematics in the Natural Sciences (1960). That paper begins with a story about two former classmates discussing their jobs. One became a statistician, and he shows his friend some of his work. But the friend is a bit incredulous:
"And what is this symbol here?" "Oh," said the statistician, "this is pi." "What is that?" "The ratio of the circumference of the circle to its diameter." "Well, now you are pushing your joke too far," said the classmate, "surely the population has nothing to do with the circumference of the circle."
And it can seem a bit of a puzzle, all the places pi pops up. To some extent, it is a matter of things in nature being cyclic — circular (orbits, days, seasons, monthly cycles, all manner of vibration and sound, plus myriad ecological and geological cycles). For that matter, the very notion of rotation.
What Exactly Is Pi?
Pi is a number, the number 3.141592653589793… — those digits continue in what seems random fashion forever. These decimal digits never enter a repeating cycle, so pi is an irrational number.2 Pi is also a transcendental number3 — there is no algebraic formula, no polynomial, to calculate it. Such can only approximate it or, more typically, converge on it.4
Despite being transcendental, pi is easily defined:
It’s just the ratio between a circle’s circumference and its diameter. Nothing more complicated than that.5 The fascinating thing is how something that simple turns out to transcend any algebraic expression.
Perhaps you shared my initial confusion regarding the famous formula for calculating the circumference of a circle:
Where r is the circle’s radius. What’s the “2” doing there? And if pi is the ratio of circumference to diameter, why does the formula use the radius? The diameter is twice the radius, so why not drop the “2” and use the diameter?
Where d is the diameter. So much cleaner, and no constant. For years I puzzled why the formula was 2πr rather than just πd.
As it turns out, while that might make some sense in the specific case of a circle’s circumference, in the wider context of geometry, radius is the only way to go. As a simple example, diameter doesn’t make as much sense when describing an arc (part of a circle), but radius does.6
Note that we can easily derive the circumference formula:
Diameter is twice the radius, so:
I’ll return to this at the end of the post to show you something cool that you may (or may not) know. For now, back to pi and its transcendental digits.
The Infinite “Random” Digits of Pi
The digits of pi are thought to be normal. Here the normal word normal means the digits of pi, ‘0’ through ‘9’, all occur with the same frequency. Also, any specific finite sequence of digits occurs with the same frequency. Obviously, the longer the specific sequence, the lower the probability of its occurrence.
Because pi is transcendental, there is no pattern to the digits. They are indistinguishable from a sequence generated by repeatedly throwing a fair ten-sided die. They are specifically the digits of pi, but they are otherwise random.
This means any specific finite sequence of digits is somewhere in pi.
Anything we call data is a finite sequence of digits, so — and this is the part I love — every text, every digital tune, every digital video, every electronic document of any kind exists somewhere in the digits of pi.
FWIW, I derived a formula that seems to work:
This gives the frequency of occurrences (occurs) given pi-digits worth of digits and the length of the sequence sought. I derived this while playing around with a file I downloaded containing ten million digits of pi. I ran frequency counts on the digits, and they match the formula.
For example, six-digit sequences:
So, for any possible six-digit sequence, there should be, on average, eight occurrences of it in those ten million digits of pi. When I scanned the file searching for all repeating six-digit sequences (such as “111111” or “777777”), here’s what I found:
000000: 4 occurrences
111111: 8 occurrences
222222: 9 occurrences
333333: 5 occurrences
444444: 9 occurrences
555555: 8 occurrences
666666: 9 occurrences
777777: 11 occurrences
888888: 15 occurrences
999999: 9 occurrences
An average of 8.7 occurrences per sequence, so very close to the formula. It seemed to scale for other sequence lengths. (I only have the ten-million-digits file, so can’t test it with a larger version of pi.)
I did find that the frequencies of the individual digits were very nearly flat:
0: 999440 ( 9.994400, +0.005600)
1: 999333 ( 9.993330, +0.006670)
2: 1000306 (10.003060, -0.003060)
3: 999964 ( 9.999640, +0.000360)
4: 1001093 (10.010930, -0.010930)
5: 1000466 (10.004660, -0.004660)
6: 999337 ( 9.993370, +0.006630)
7: 1000207 (10.002070, -0.002070)
8: 999814 ( 9.998140, +0.001860)
9: 1000040 (10.000400, -0.000400)
After the digit, the first number is the count of occurrences. The numbers in parentheses are the percentage of occurrences and the deviation from the expected percentage of exactly 10%. All ten digits are very nearly equally represented. One assumes the numbers only get closer to exactly 10% with more digits.
Having at least a modicum of confidence in our equation, let’s try it on something big. But let’s start small. Suppose we have 100-quintillion digits of pi, and we’re looking for a sequence that’s only 20 digits long:
(Easy math because the 10²⁰ values cancel.) This tells us that, despite having 100-quintillion digits of pi, there is a less than certain chance of finding any given 20-digit sequence.
Now consider finding your favorite digital tune. Rather than a piddling 10²⁰, the denominator becomes something like 10⁵⁰⁰⁰ (or likely more). Which means you need an equal number of digits of pi to give that same 0.8 occurrence frequency.
Some estimates place the number of elementary particles in the entire universe between 10⁸⁶ to 10⁹⁷, so there’s no way to even begin to write down 10⁵⁰⁰⁰ digits of pi.
But in principle, any finite number exists somewhere in pi.
And any finite chunk of information is a finite number. See:
Welcome to Story Space
Story space is the infinite Platonic realm of all possible stories. This isn't a new idea and certainly doesn’t originate with me. In 1941, Argentine author Jorge Luis Borges wrote about a version in his surreal short story The Library of Babel.
In a sense, the digits of pi — of many transcendental numbers — comprise Borges’s Library of Babel. We might seek sensible digit sequences, something specific we’re looking for, but in both the Library and in pi, each and every possible sequence occurs given enough digits.
(Remember that 6746367425 — a seeming random sequence — is as specific as 1234567890 or 5555555555 when talking about possible digit sequences. All three occur with the same frequency. Their content doesn’t make them special. The formula above depends only on sub-sequence length, not its content.)
Have Some Pi Today
I’ll leave you with something you may not have noticed. The formula for the circumference of a circle is 2πr, and the formula for its area is πr². It wasn’t until some years ago that I noticed:
The derivative of the area formula is the circumference formula. This is true of spheres, as well. The derivative of the formula for volume is the formula for surface area:
This is no coincidence, and there’s a good reason it’s true. I’ll explain another time, but for now the one-word reason is integration.
Until next time…
The icing on the cake is that it’s also Einstein’s birthday today. He’s 146 today!
Rational numbers always terminate with a repeating decimal segment. For instance: 11/13 = 0.846153846153846153… — the 846153 segment repeats indefinitely. The repeating segment can also be a single digit: ⅓ = 0.333… — repeating threes.
Even the number 1, as a rational number, is technically 1.000… — repeating zeros.
The square root of two is also irrational — its digits don’t repeat — but it is not transcendental because it has the algebraic formula √2.
[See Proof of the Irrational]
To obtain however many digits of pi you desire.
The other famous transcendental number, Euler’s number e, has a rather more complicated origin story.
A more complicated example: the radius is the scaling factor in trigonometry.
The tech bros and the mathematicians before them have been trying to square the circle, since forever, and to this date they still have not solved the equation beyond a decimal approximation. π is unsolvable; math lists π as an irrational number.
The circle remains un broken, un squared.
Happy Pi day!
One small point of contention: I think it's not necessarily true that every finite sequence of digits exists somewhere in the digits of pi. It might intuitively appear that way because the digits are infinite and appear to be random. But if they are truly random, then there cannot be a preference for any infinite sequence of digits over any other, in which case all of the infinite sequences which lack our specified finite sequence have as good a chance as all those which contain it.
Looking at it digit by digit, it's clear that as we consider more random digits tending to infinity, the odds of a particular finite sequence not appearing tend towards 0. But that doesn't mean that we can say the odds actually are 0 when the number of digits equals infinity. If anything, I think we should consider the odds as infinitesimal, but not 0. I think we have to allow infinitesimals if we're to talk about infinite random sequences, as otherwise we find that every infinite sequence has a probability of 0... And then since there are infinite finite sequences, it's quite possible some of them might accomplish that infinitesimally unlikely feat of escaping pi.