2 ms·
It turns out not to matter (since the numbers are so small) but your math implies that 10^305 people guessing would give a probability of about 9,300 that at le
by grayclhn 11y ago
It turns out not to matter (since the numbers are so small) but your math implies that 10^305 people guessing would give a probability of about 9,300 that at least one of them is right on all 1000 coin flips. Since probabilities can't be larger than 1, that's a bit of a problem.
For anyone interested, the full set of steps (that produces a numerically identical result):
Prob[1 or more in 1,000,000 right]
= 1 - Prob[all 1,000,000 wrong]
= 1 - Prob[person 1 is wrong AND person 2 wrong AND ... person 1,000,000 wrong]
= 1 - Prob[person 1 is wrong]^1,000,000
= 1 - (1 - 0.5^1000)^1,000,000
= 1 - exp(1,000,000 * log(1 - 0.5^1000))
= 1 - exp(1,000,000 * log1p(-0.5^1000))
≈ 1 - exp(1,000,000 * -9.33 × 10^-302)
= 1 - exp(-9.33 × 10^-296)
= -expm1(-9.33 × 10^-296)
= 9.33 × 10^-296
log1p(x) = log(1 + x) but is more accurate when x is near zero.
expm1(x) = exp(x) - 1 but again is more accurate when x is near zero.
Both are necessary here to get a result other than "0".
- SamReidHughes 11y agoIt's perfectly reasonable to approximate a+b=a+b(1-a) when combining rare events without announcing it to everybody. Likewise with n repetitions of that.
- grayclhn 11y agoFair enough, but it's also reasonable to approximate 9.33 × 10^-296 as 0. I felt like doing the calculations :)
- deleted 11y ago[deleted]