A little slice of Pi

Updated: Nov 20, 2020

Many will know that #Pi is an irrational number - an irrational number is any real number that cannot be expressed as the ratio of two integers.

Is Pi normal?

It is not yet known if Pi is a normal number - in other words, do all of its digits occur equally often? In 2016, the first 22 trillion digits were found to be normal, but sadly that's not a proof. The normality of Pi remains unproven, to this extent, it is the same as e (commonly known as Euler's number) and the square root of 2. If Pi is normal then it should encode every possible sequence. For example, it will contain an ASCII encoded version of the entire works of Shakespeare. It will also contain a description, in numeric code, of every event that has happened or will happen in the future.

The digits of Pi may never repeat but this does not mean it is random. Each of its digits are precisely determined and absolutely fixed. The third decimal digit is always 1 just as the fourth is always 5. The Pi searcher can find an arbitrary sequence of digits if they occur in the first 200 million digits of Pl. Incidentally, 31415926 occurs at position 50,366,472. If you look a little further, you will find 0123456789 at position 17,387,594,880.

What do the first million digits tell us?

I decided to take a further look with the help of my trusted friend Python. First I needed to generate a sufficiently accurate value for Pi, given my limited time, I stopped after a million decimal places. There are many places to download the data if you don't feel like writing the code to generate it.

The figure below shows how the digits zero to nine are distributed as we include more decimal places. Hover over any graph and click the expand button to show a larger version. At this scale, the chart showing the distribution of a million digits is showing how the lines for each digit's distribution are almost overlaid.

The last graph shows how sequence 999999 occurs at position 762 in the expansion of Pi. This is sometimes called the Feynman point who allegedly said he would love to recite pi to that position, ending with, '...0721134999999 and so on'. Perhaps giving the impression that it may end with an infinite number of 9s.

Even a visual inspection shows how the distribution of digits seems to even out as we use increasing levels of precision. If you prefer numbers, here's a summary for you.

The digit zero appears 99,959 times.

The digit 1 appears 99,758 times.

The digit 2 appears 100,026 times.

The digit 3 appears 100,229 times.

The digit 4 appears 100,230 times.

The digit 5 appears 100,359 times.

The digit 6 appears 99,548 times.

The digit 7 appears 99,800 times.

The digit 8 appears 99,985 times.

The digit 9 appears 100,106 times.

After the first million digits, the standard deviation for digit counts is 247.4.

Visualising Pi

A meaningless yet somehow compelling view of Pi's digits comes from simply drawing a line for each digit. The video below shows something like the first 100,000 digits wandering happily through space.

Each digit has a different colour; the digit determines the angle of its corresponding line. If you jump ahead and watch from 01:40, you may find a tortured mathematician, eerily recorded.

The code lives on GitHub for anyone who wants to do something a little differently.

Do you have a problem that you need a little help with? Please click below to find out more.