          ## Frequency of Each Digit of Pi

Home : Pi : One Calculation

in first 100 digits of pi
 0 8 1 8 2 12 3 12 4 10 5 8 6 9 7 8 8 12 9 13

in first 1,000 digits of pi
 0 93 1 116 2 103 3 103 4 93 5 97 6 94 7 95 8 101 9 105

in first 10,000 digits of pi
 0 968 1 1026 2 1021 3 975 4 1012 5 1046 6 1021 7 969 8 948 9 1014

in first 100,000 digits of pi
 0 9999 1 10137 2 9908 3 10026 4 9971 5 10026 6 10028 7 10025 8 9978 9 9902

in first 1,000,000 digits of pi
 0 99959 1 99757 2 100026 3 100230 4 100230 5 100359 6 99548 7 99800 8 99985 9 100106

in first 10,000,000 digits of pi
 0 999440 1 999333 2 1000306 3 999965 4 1001093 5 1000466 6 999337 7 1000206 8 999814 9 1000040

 Great Pi Day Gift! Los Boludos Made with original vintage vacuum tubes!       #### Zero

Why does zero lag behind in the count. It is a perfectly upstanding digit? Just had to ask, its a retorical question. I am sure it has been asked before by greater minds.

sincerely

DMA

-- Douglas Abbott

#### Why zero lags

Obviously, some digit will lag. Which digit has a reason to lag? None has a reason to lag. Zero is none. Therefore, zero lags.

-- Larry Hosken

#### Wait a minute

Looking over the graph of the first 10,000,000 digits, now I think that the question was wrong. Zero isn't the worst lagger. Behold--
0: 999440
1: 999333.

Therefore, I would like to amend my answer to "Will some digit lag? Empirical evidence suggests that one must. Therefore, one lags."

-- Larry Hosken

#### Zero Is not at all a lacker

If you look closly enough you see that zero is never a slacker that it is eather ahead of a number or it is tied with another slacking number...GO ZERO!!!!!!!!!

#### Lagging digits

Assume we take Pi out to an infinite amount of decimal places. We cannot determine the last digit of Pi, because there is no last digit, the string of random numbers goes to infinity. However, because there is no repeating pattern in the decimal portion of Pi we can assume that all numbers are equally likely to be the next number in the sequence as the length of the decimal portion goes to infinity. This in effect defines the next number in the infinite sequence as a random event. This means that each number is equally likely to be the next number so each has a 1/10 chance. Therefore, the occurence of each digit should be equal once we reach an infinite number of decimal places.

This is supported by looking at the differences between the occurence of each number over time as compared to the total number of occurences. The percentages shrink rather rapidly as the order of magnitude of the number of occurences increases.

The implications of this on the upcoming digits in the sequence are rather interesting, as this would mean that zero is actually more likely to occur than the other numbers, something of a paradox considering the random nature of the decimal place string.

-- chris campbell

#### Re: Lagging digits

Chris,

Your statement, "However, because there is no repeating pattern in the decimal portion of Pi we can assume that all numbers are equally likely to be the next number in the sequence ..." isn't actually correct.

Here is a counterexample. Take the number 1.01001000100001000001... It has no repeating pattern, yet not all digits are equally likely.

It has been conjectured that pi is "normal" which, mathematically speaking, means that all digits are equally likely and that other properties of randomness are adhered to. However, this has yet to be proven.

#### My penny's worth

Surely Chris's comment above that "zero is more likely to occur" is just an example of the innate problem with probability people seem to have. If I flip a coin ten times and it lands tails-up seven times, that does not mean that my next coin flip is more likely to be heads to "even the score". If you bet on a horse ten times and it lost every time, you wouldn't bet on it again as it was now due a win...

Were pi to be calculated to infinity, then - assuming it's a normal number - then working from the fists 10,000,000 digits we would expect an infinite number of fours and infinity-minus-1653 zeroes.

BTW Eve I think you need to bring back the green antenna photos. I was just leafing through a 1995 copy of Mac Format magazine and saw you beaming out at me as 'one of the coolest sites on the web'.

-- Aidan Merritt

#### And another thing...

If you really want to take this to it's logical extreme, work out the frequencies of 1 and 0 in the binary expression of pi. Intuition tells me that 1 would be way ahead, but I can't explain why I think this.

-- Aidan Merritt

#### Binary Digits

A quirky article by Mike Keith talks about drawing binary digits of pi on a hexagonal grid and then staring at the result until you can convince yourself you see a picture there.

Towards the end, he points out that in the first 1000 binary digits, zero appears more frequently than one. Around bit 164, it's much more common than you would expect.

-- Larry Hosken

#### binary

is anyone aware of a site where the pattern of binary is used to draw a "diagram"

ta

-- scotty pi

Can you put pi up on the comment board?!
Image: Abstract.bmp

-- Emily Harte

#### Pi R square

Any discussion of Pi, aside from its esoteric side, always brings a smile to my face. As best I can remember, it was on Beverly Hillbillies where I first heard:

"Pi R square" ..."no, it's not"... "It certainly IS" ..."No, any fool knows: CORNBREAD are square, Pie are ROUND!"

Maybe it's even older than that... anybody know fer shure? Charles Husbands

-- Charles Husbands

#### Memorizing PI

I got started being interested in pi when I visited my brother last month and my 14 year old nephew told me he would get an extra 30 points in math if he could memorize pi to the 74th decimal place. I helped him figure out ways to remember the numbers and am happy to say that my nephew called me a couple of weeks ago to tell me that he did get the extra points.

I never memorized numbers longer than 16 digits before (my credit card numbers) or rather 19 numbers if you can really count my checking number which includes the routing number. I was curious to find out how far I can memorize pi. I have adopted the credit card system, by separating the numbers in pi in groups of 4s. So far I am only up to the 30th group of 4's. That's 120 numbers. Wow!!! Not being a genius, and being a grandma, I am rather impressed with myself, LOL!!!

So I have issued a challenge to my 3 children, my 4 grandchildren that I would pay \$1 for each group of 4's they could remember both in sequence and at random. Thus each would be able to earn up to \$60.

I love to play blackjack, therefore I remember pi by associating the numbers with the game.

For instance: group 2 is 9265 = 2 double down hands, group 4 is 7932 = 21, group 5 is 3846 = 21, group 8 is 7950 = 21, group 15 is 4944 = 21, group 21 is 8628, happy that the dealer has 3 eights instead of 3 sevens! :)

Group 16 = 5923, my ex husband's work extension, not that I care because I don't have his phone number (I deleted them from my cell phone as well as from my own memory). :))

I was born in the 105th group of 4's in pi after the decimal point. I told my 3 kids I would give them \$200 each if they tell me theirs...well I'm just relieved that I have only 3 children. I would be broke otherwise, heh! I had to tell my nieces and youngest son's fiancee the offer was good only for my 3 children, much to their dismay.

Well, I've just memorized 3 more groups. Maybe I will let the kids to up to 50, depending on how far I can go by Feb. 16 weekend, which is when I will see all of the grand/kids. First I will demonstrate that even I can recite the numbers, sequentially or at random. So I am not asking them to memorize anything that their old mother/grandma cannot do herself. Oh, I'm up to group 36 now.

#### other bases

Pi is obviously going to look different if we calculate it in base 8 or base 12 or any base other than 10. Do we have any workups available of what the digit frequency looks like if we use some other base? Do we still have 'laggers', and -- if so -- are they the same ones? I doubt that they would be the same, but it would be an interesting experiment.

-- Jonathan Elliott

#### Because...

If (assumption) the digits of pi are pseudorandom, zero will tend to lag, depending on how you average things out. We choose by tradition not to write in a trailing zero after the decimal point, so any 'lengths' of pi that would otherwise terminate with a zero, don't. The non-zero digit that precedes the zero gets a double score!

-- Julian P

#### pi in base 2

I've been looking at the frequency of the digits of pi in base 2. So far up to the first 400 bits, 0 occurs 57% of the time, 1 occurs 43 % of the time. Running a chi-square test on this gives a result of this being random of only 7%. In other words with this initial sample, there is enough of a bias to warrant further testing. I also ran a test on 2 digit bits and the bias is even stronger. Does anyone know of a site that has pi in base 2 or am i going to have to convert a base 10 site?

#### Improper Math

@ chris campbell, post "lagging digits".

"The implications of this on the upcoming digits in the sequence are rather interesting, as this would mean that zero is actually more likely to occur than the other numbers, something of a paradox considering the random nature of the decimal place string."

This is an improper usage of the law of averages. The law of averages does not take in to account events previously occurred. It merely states that as more trials occur, or the limit of trials approaches infinity, the experimental probability should converge on the theoretical probability. I agree with the idea that if you look from zero the proportion of any digit to total (experimental probability) should approach the theoretical probability; henceforth, the difference should occur more often to have the proportion equal out; however, it still an improper usage of determined fact.

-- Stephen Unknown

#### Shannon entropy of pi

I recently made a C program to calculate the entropy of pi in digits of base 256 (like bytes) and I got 8 this means that the "disorder" of the digits is maximum and you cannot compress the digits because Shannon entropy says that you will need 8 bits to represent each byte (no compression at all) recently made another C programm to average the PI digits and all the first 10 million digits have the same probabilities with digits in base 10 of arbitrary len. The shannon entropy program can be found here If you are going to apply it to PI you will need to get PI in bytes (not base 10)

-- Eduardo Ruiz Duarte

#### Pi digits are equiprobable

Theoretically, each decimal digit of Pi can be viewed as independent of the other, and the events may be hypothesized as equiprobable, with probability, 0.10.

Observably, the discrepancies between the proportion of the digits, for the first set of 100 digits are so pronounced. However, as the set of digits increases, through 100,000 up to 10,000,000 ,these discrepancies in proportion decreases, and ,eventually, converges to zero.

In other words, the theoretical probabilities and the relative frequencies of the digits almost coincide, according to the law of large numbers, hence the leveling of the bars in the last chart. Thus, the decimal digits of Pi are equiprobable each with probability 0.10 of occurrence.

#### Mathematical beauty in the eyes of the beholder

Theoretically, each decimal digit of Pi can be viewed as independent of the other, and the events may be hypothesized as equiprobable, with probability, 0.10.

Observably, the discrepancies between the proportion of the digits, for the first set of 100 digits are so pronounced. However, as the set of digits increases, through 100,000 up to 10,000,000 ,these discrepancies in proportion decreases, and ,eventually, converges to zero.

In other words, the theoretical probabilities and the observed relative frequencies of the digits almost coincide, according to the law of large numbers, hence the leveling of the bars in the last chart. Thus, the decimal digits of Pi are equiprobable each with probability 0.10 of occurrence.

'pi' is to Genesis 1:1 as ?e? is to John 1:1. There are many examples, which are clearly beyond the capability of human authorship ? not even in field of Actuary.

#### Pi in base 2

There are some obvious factors that must be considered - for the numbers 0-9 in base 10, each number occurs only occurs once, and thus in a completely random normal number, it each digit would have a 1/10 chance of appearing in any one place and would thus be expected to appear 10% of the time. In binary there are only two digits - 0 and 1 - but do they both have the same frequency? Think of the process of getting pi in binary. You would start with base 10. Do the numbers 0-9 in dec, when converted to binary, yield just as many 0's as 1's? Well, in fact, no. There are eleven 0's and fifteen 1's. From this knowledge, you would expect the infinite expansion of pi would be comprised of about 42.3% zeros and 57.7% ones. That's close to 57% ones, so problem solved.

-- Troy Dana

#### too smooth?

The number of each digit seems to deviate too little from the expected. For the first n digits of pi, we can model the number of occurrences of any specific digit as the sum of n independent identically distributed Bernoulli random variables each with 10% (p=0.1) probability of being one and 90% (q=0.9) probability of being zero. The average of such is np which, for n=10,000,000 (ten million) is 1,000,000. The standard deviation is sqrt(npq)=948. And yet the most deviate digit is 1 which lags its expectation by only 667. So none of the ten digits fall more than 0.71 standard deviations away from the expected value. Small sample size or a hint of some deep truth about pi?

I suspect small sample size because if we back up to the first million digits, we get a standard deviation of 300 which is exceeded by 5s and 6s.

-- Fred Phelps

#### On randomness of pi digits

The question about other bases is insightful: because what appears more frequently in one base might not appear more frequently in another base; indeed, the pseudorandom nature of the digits appearing would implicate that unless there is a relationship between pi and your particular base, you might expect that for any string of digits there is a random frequency, AND a random distribution.

Which would then imply that you will see zero eventually overtake every other digit, and then go back to least frequent again.

But is that a good assumption?

If I wanted to look for a relationship between pi and base ten, I think I would look at the Julia set fractal, where PI appears. I would base a calculation of pi off that. Then I would look to see if the spiral that was involved in that calculation had any relationship to a frequency of ten:1. If I found no such relationship, then I would look for a DIFFERENT location, and a different calculation of PI.

IF somehow I ran out of all the calculations available in the julia set (I suspect the number of such calculation are going to be infinite, but with classification,suppose we could cnfirmably run out), that's okay. The Julia set is only a 2-D fractal, and one class of fractal. There are others.

-- Michael Rudmrn