I was reading some notes about PI and as a typical IT guy I have decided to test some algorithm but before I wanted to check number quantity per decimal length (explanation in next paragraph). For resource I have used: http://www.piday.org/million.php there I took 1000000 decimal and wrote a small application to see how many times 1,2,3,4,5,6,7,8,9 and 0 numbers are used. And I get some interesting results and wanted to share with you.

i.e. in first 100000 decimal total 9999 0(zero) exist. Generally total number * 100000 very close to decimal length/10;


total of 1000000 decimal: 4499934

total of 100000 decimal: 449333

total of 10000 decimal: 44894

total of 1000 decimal: 4476

total of 100 decimal: 477

total of 10 decimal: 41

Do you think it can be interesting? If someone wants I can share full results. (Can be useless information but I was doing just for fun, so dont judge me:))


(I'd post this as a comment, but ran out of space.)

Your results are not surprising. Partly because there is no (known) reason why any one digit should occur more than other digits, many mathematicians believe that all digits $0$ to $9$ occur with about equal frequency. In technical terms, it is believed that $\pi$ is a normal number.

So among the first $N$ digits, you should expect to see the digit $0$ about $N/10$ times, the digit $1$ about $N/10$ times, and so on: each of the ten digits about $N/10$ times. This approximation gets (relatively) better as $N$ becomes large. So the sum of the first $N$ digits will roughly be $$\begin{align} &\frac{N}{10}(0) + \frac{N}{10}(1) + \frac{N}{10}(2) + \dots + \frac{N}{10}(9) \\ =& \frac{N}{10} \left( 0 + 1 + \dots + 9 \right) \\ =& \frac{N}{10} (45) \end{align}$$ which is what you're seeing.

  • $\begingroup$ Good explanation, thank you! :) $\endgroup$ – burak Nov 11 '11 at 13:19

The subject has been much studied. For any base $b$, there is a stronger notion called "$b$-normal number" and an even stronger notion called "normal number." For some details, please see this Wikipedia article. Roughly speaking, a number is $10$-normal if for any integer $k$, every sequence of $k$ digits occurs in the long run with equal frequency. So you would have equality not only for single digits. Each pair of adjacent digits would occur with long run frequency $1/100$, and so on.

In the measure-theoretic sense, "almost every" real number is $b$-normal to every base $b$. However, although normal numbers are ubiquitous, it is exceedingly difficult to produce explicit examples, and even more difficult to verify that an explicitly specified number is normal.

It has been long conjectured that $\pi$ is $b$-normal to every base, and in particular is $10$-normal. However, there is so far no proof, and there are no known techniques that might lead to a proof. Computations far beyond those that you have undertaken are consistent with the conjecture that $\pi$ is $10$-normal. The conjecture has been one of the motivations behind calculations of $\pi$ to enormous numbers of digits.

  • $\begingroup$ Thank Andrea!, I will read related articles first and re-design application. If I understand correct, cant I use modulus to introduce a new sequence to see new results? $\endgroup$ – burak Nov 11 '11 at 13:27
  • $\begingroup$ There are a number of ways one could use modulus calculations. For example, on could look at the sequence $3$, $31$, $314$, $3141$, and so on modulo some number $m$. If $m=10$ you just get the digits, but if you use $m=3$, or $m=7$, you may get something interesting. I think $10$-normality implies that the sequence you would get has long run frequency $1/m$ for each of $0, 1,\dots, m-1$, but have not written out the details. $\endgroup$ – André Nicolas Nov 11 '11 at 14:11
  • $\begingroup$ ok it is clear now as PI based on mod10 so there is no logic to test with different condition. If we would use mod6 => 0,1,2,3,4,5,10,11,12,13,14,15,20,... etc then decimal area will extend also, so first I will need to confirm if PI stays same or calculate a new PI number with million decimal:) $\endgroup$ – burak Nov 11 '11 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.