Hacker News new | ask | show | jobs
by timr 1341 days ago
The part where you did rand() < 0.8 ? 1 : 0 is fine. That's a Bernoulli trial with p=0.8

The part where you did this in a loop, with two calls per iteration, and then divided the counts and called it a percentage is wrong. It's certainly not a Binomial distribution. It's just the ratio of two binomial random variables.