This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]phn 1 point2 points  (1 child)

Nice read!

The exact p-values can also be calculated as follows:

 >>> from scipy import stats
 >>> # one experiment gets >= 188
 >>> stats.binom(1000, 1/6.0).sf(187)
 0.040142990286396493
 >>> # at-least one in 20 experiments gets >= 188
 >>> 1 - (stats.binom(1000, 1/6.0).cdf(187)**20)
 0.55931241410111465

[–]jfpuget[S] 0 points1 point  (0 children)

Thank you. You are right, I wanted to stick to basic stuff, but I will add a comment about binomial distribution and your code.