Function cmb_random_pascal

Function Documentation

static inline unsigned cmb_random_pascal(const unsigned m, const double p)

Pascal distribution an alias for the negative binomial distribution, cmb_random_negative_binomial(), the number of failures before the mth success in independent Bernoulli trials each with probability p, sampled with replacement (or equivalently from an infinite pool).

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