Function cmb_random_geometric
Defined in File cmb_random.h
Function Documentation
-
unsigned cmb_random_geometric(double p)
Geometric distribution, a discrete parallel to the exponential distribution, returns an integer value in
[1, oo).Models the number of trials up to and including the first success in a series of consecutive Bernoulli trials each with probability
pof success.Mean
1/p, variance(1-p)/p^2.Performs the calculation by simulating the experiment.
See also https://en.wikipedia.org/wiki/Geometric_distribution