Skip to main content

geometric_distribution

Function geometric_distribution 

Source
pub fn geometric_distribution<U>(uniform_generator: &mut U, p: f64) -> f64
Expand description

The number of failures before the first success in independent trials of probability p (P(k) = (1 − p)ᵏ p), by inversion of the exponential: ⌊ln(1 − u) / ln(1 − p)⌋.