Probability of success in each trial (0 < p ≤ 1)
Probability of success
Probability of failure
Cumulative distribution function (CDF).
Number of trials
P(X ≤ k)
Mean of the distribution
1 / p
Probability mass function (PMF).
Number of trials until first success (k ≥ 1)
P(X = k)
Generate a random sample using inverse transform sampling
Sample number of trials until first success
Variance of the distribution
(1 - p) / p²
Class representing the Geometric distribution. Models the number of Bernoulli trials needed for the first success.