lefalaf wrote: ↑24 August 2026, 02:32
I don’t know where the five std dev, or Barnard’s minuscule odds and “binomial function” come from, but they raise an eyebrow.
https://xkcd.com/1053/
The opening line of the Wikipedia article states,
Wikipedia wrote:
In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes–no question, and each with its own Boolean-valued outcome: success (with probability p) or failure (with probability q = 1 − p).
In other words, it's fairly basic statistics (which I think needs to be more widely taught in schools, but I accept most people's eyes glaze over at the very word "binomial"). So, you have this event where "success" has a probablility of p and "failure" has a probability of (1-p). The binomial distribution tells you how likely it is that you will get X successes in the course of N events.
So imagine flipping three (evenly weighted) coins. You would not be at all surprised if they all came up heads, right? That's a 12.5% likelihood. And if you
ask Wolfram Alpha it will tell you exactly that. But, to extend this to 100 coins, you would probably be pretty surprised if they all came up heads.
The odds here are 7*10^-31 of that happening. Indeed, 999,999 times out of 1,000,000 you would find the number of heads to be between 26 and 74. Anything outside that range, for 100 coin flips, is very unlikely. (Not impossible.)
If we extend it now to 100*100 or ten thousand coinflips, the range for 99.9999% likelihood falls between 4755 heads and 5245 heads. In other words, with 100 flips, anything below 25% or above 75% was a one in a million chance, but for 10,000 filips, anything below 47.5% or above 52.5% is a one in a million shot. For a million coin flips, the range narrows to 49.75%-50.25% -- outside that range is the one in a million changce. This is the
law of large numbers in action -- the more "trials" (coin flips in this case) attempted, the more you expect the long term average to converge to the true expected average.
Now, the numbers look different for rolling doubles because it's a ⅙ chance of "success", but the basic math still applies. For millions of rolls, you expect the overall percentage to be pretty spot on. For 1 million dice rolls, you would have a 99.9999% chance of finding the number of doubles to be in the 16.48%-16.85% range, and when you are looking at 218 million rolls, the range is narrower still (the 99.9999% chance range is between 36306420 and 36360252 doubles rolled, which works out to between 16.654% and 16.679%), and outside that range, even the apparently negligible difference of 16.61% is extraordinarily unlikely.
How unlikely? If you set every computer on the internet to rolling 218 million pairs of dice and they each did it a thousand times a second, the entire lifetime of the universe could go by without seeing as low as 16.61% doubles. Indeed, a million lifetimes of the universe could go by, and you wouldn't expect to see it. At a decillion universe lifespans, it starts to become possible, but still very unlikely. Do you see where I'm going? This is so extraordinarily unlikely, that something is clearly wrong.
It's not the underlying random_int() method, I'm pretty confident of that, but somewhere along the way, something is wrong. Is it the statistics collection? Is it that some doubles are getting disregarded somehow (like the initial roll of the game was suggested)? Is it something else? But something is wrong.