freemonoid.xyz


back

One in a million chance

Tuesday May 14 2024.

I’ve been wasting time on Turtle WoW lately and reminded of a classic problem in probability.

If a rare event has a 1-in-100 chance to occur, and you repeat it 100 times, it is guaranteed to happen right?

Not quite, turns out it is only \(\approx 63\%\). See how the chance grows with each attempt in the following table:

#tries chance
0 0%
1 1%
2 1.99%
3 2.97%
100 63.3%
200 86.6%
500 99.3%

Relevant here is the negative binomial distribution for it gives us the following formula for the chance of success after 100 attempts:

\[ 1 - \left( 1 - \frac{1}{100}\right)^{100} \,=\, 0.6339... \]

In fact, replace a 1-in-100 chance with 1-in-million chance, and the result will be about the same after a million attempts:

\[ 1 - \left( 1 - \frac{1}{1000000}\right)^{1000000} \,=\, 0.6321... \]

What is this magical 63% number? It turns out to be a constant related to Euler’s number given by the following limit:

\[ \lim_{n\to\infty} \left( 1 - \left( 1 - \frac{1}{n}\right)^{n}\right) \quad = \quad 1 - \frac{1}{e} \quad = \quad 0.63212055... \]