Function cmb_random_binomial

Function Documentation

unsigned cmb_random_binomial(unsigned n, double p)

Binomial distribution, number of successes in n independent Bernoulli trials each with probability p.

Models a drawing process with replacement (or from an infinite pool).

Mean np, variance np(1-p).

Performs the calculation by simulating the experiment.

See also https://en.wikipedia.org/wiki/Geometric_distribution