https://media.giphy.com/media/l378lGXxr17Sc0imA/giphy.gif
This gif shows the disparity. Is it statistically significant? What causes it?
https://media.giphy.com/media/l378lGXxr17Sc0imA/giphy.gif
This gif shows the disparity. Is it statistically significant? What causes it?
On
Without going into the details of goodness-of-fit tests, you can start by asking a very simple question: What is the probability that I will get $95$ out of a $1000$ digits being 7 if the distribution of digits was "truly random"? (i.e., probability is $0.1$ for each of the digits).
This probability is simply given by the binomial distribution:
$$ {1000 \choose 95} \cdot 0.1^{95} \cdot 0.9^{905} \approx 0.037$$ Pretty low you might think. But what is the probability of having exactly 100 7?
$$ {1000 \choose 100} \cdot 0.1^{100} \cdot 0.9^{900} \approx 0.042$$ Not that different. In fact the probability of the first $1000$ digits to contain $95$ or $94$ 7s is higher than containing exactly $100$ 7s.
The randomness of the digits of $\pi$ has been extensively studied. Here's a interesting post that discusses the main points: http://thestarman.pcministry.com/math/pi/RandPI.html You might find this quote relevant:
"Does π's fixed pattern of digits appear as a random stream?" Generally speaking, I would have to say, "Yes." However, depending upon which particular decimal place of π that we stop to add up each of its ten digits1, we may find some peculiarities leading the average person to wonder if this is true.
An approximate 95% confidence interval for the proportion on 7's among $n = 1000$ independent trials with $P(7) = 0.1$ at each digit is $0.1 \pm 1.96\sqrt{(.1)(.9)/1000}$ or $(0.0814, 0.1186)$ so the fraction 0.07 I saw looking at the link is a little low.
However, there is no reason to suppose that digits of $\pi$ are independent, identically distributed with probability 0.1 each. Perhaps a fairer test would be a chi-squared goodness-of-fit test checking all ten digits against the equally likely model.
There has been some debate in the mathematical and popular literature about whether the digits of $\pi$ act as if they are random in this way. You can google around and see which 'authorities' you choose to believe. Once you decide that, you can ponder the digits of $e,$ and so on for other transcendental numbers.
Addendum: Here is an experiment with 1000 digits 0 through 9 from the well-vetted pseudorandom number generator 'Mersenne twister' implemented in R statistical software. For the seed I chose, all digits except 2 and 6 have relative frequencies of occurrence within the interval shown above.
But for a million digits all relative frequencies are accurate to within the anticipated three decimal places.