Function cmb_random_negative_binomial
Defined in File cmb_random.h
Function Documentation
-
unsigned cmb_random_negative_binomial(unsigned m, double p)
Negative binomial distribution, the number of failures before the
mth success in independent Bernoulli trials each with probabilityp, sampled with replacement (or equivalently from an infinite pool).Mean
m(1-p)/p, variancem(1-p)/p^2. Equal to a geometric distribution form = 1.Used to model e.g., the number of bits (or packets) that need to be sent to successfully transmit an m-bit (or -packet) message. Also known as the Pascal distribution.
Performs the calculation by simulating the experiment.
See also https://en.wikipedia.org/wiki/Negative_binomial_distribution