# Geometric distribution

The geometric distribution is a discrete probability distribution that models the waiting time until the first success in a sequence of independent trials, each of which has two possible outcomes and a fixed success probability p<sup>[1](https://www.britannica.com/topic/geometric-distribution)</sup>. It is the only discrete distribution with the memoryless property and is a discrete analog of the exponential distribution<sup>[2](https://mathworld.wolfram.com/GeometricDistribution.html)</sup>.

| Key fact | Detail |
|---|---|
| Definition | Trial number of the first success in independent Bernoulli trials with constant success probability p; three conditions: two outcomes, independence, constant p<sup>[3](https://online.stat.psu.edu/stat414/book/export/html/679)</sup> |
| Two conventions | N = trial number of first success on {1, 2, …}, or M = N − 1 = number of failures before the first success on {0, 1, …}<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup> |
| pmf and tail | f(k) = (1−p)^(k−1) p for k ≥ 1; P(N > n) = (1−p)^n<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup><sup> • </sup><sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup> |
| Mean and variance | E(N) = 1/p, var(N) = (1−p)/p²; for the failures convention, E(M) = (1−p)/p with the same variance<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup> |
| Memorylessness | P(N > n + m \| N > m) = P(N > n); the geometric is the only discrete memoryless distribution<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup><sup> • </sup><sup>[2](https://mathworld.wolfram.com/GeometricDistribution.html)</sup> |
| Negative binomial link | geometric(p) equals negative_binomial(1, p)<sup>[6](https://live.boost.org/doc/libs/1_85_0/libs/math/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html)</sup> |
| Software warning | SciPy and NumPy count trials; MATLAB and TensorFlow Probability count failures; Boost.Math uses failures as a continuous parameter<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup><sup> • </sup><sup>[7](https://uk.mathworks.com/help/stats/geometric-distribution.html)</sup><sup> • </sup><sup>[8](https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/Geometric)</sup><sup> • </sup><sup>[9](https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html)</sup> |

## Definition and parameterizations

Let N = min{n ∈ ℕ₊ : Xₙ = 1}, the trial number of the first success in a Bernoulli sequence, and let M = N − 1, the number of failures before the first success. The distribution of N is the geometric distribution on the positive integers and the distribution of M is the geometric distribution on the nonnegative integers; the term "geometric distribution" is used for either<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. Authors differ on which one they mean; MathWorld cites Beyer (1987) and Zwillinger (2003) as examples of differing parameterizations<sup>[2](https://mathworld.wolfram.com/GeometricDistribution.html)</sup>.

The distribution applies when three conditions hold: the trials have two possible outcomes, the trials are independent, and the success probability p remains the same from trial to trial<sup>[3](https://online.stat.psu.edu/stat414/book/export/html/679)</sup>. Under the trials convention, the pmf is

\[ P(N = k) = (1-p)^{k-1} p, \quad k = 1, 2, 3, \ldots \]

with 0 < p ≤ 1<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup>. The tail probability follows directly from independence: the first n trials all fail, so P(N > n) = (1−p)^n, and the CDF is F(n) = 1 − (1−p)^n<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. The two conventions differ by a shift of one: M = N − 1, so a software location parameter converts between them (SciPy's geom.pmf(k, p, loc) equals geom.pmf(k − loc, p))<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup>.

The name comes from the probabilities themselves: the values (1−p)^(k−1) p form a geometric series that sums to 1<sup>[10](https://scisim.org/sims/statistics/23_geometric)</sup>.

## Properties

For the trials-until-success variable N, the mean is E(N) = 1/p and the variance is var(N) = (1−p)/p²; for the failures variable M, E(M) = (1−p)/p with the same variance<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. SciPy's documentation gives the skewness as γ₁ = (2−p)/√(1−p) and the kurtosis as γ₂ = (p² − 6p + 6)/(1−p) for its trials convention<sup>[11](https://docs.scipy.org/doc/scipy/tutorial/stats/discrete_geom.html)</sup>.

The probability generating function of N is

\[ P(t) = pt / (1 − (1−p)t), \quad |t| < 1/(1−p) \]

<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. The inverse CDF under SciPy's convention is G(q; p) = ceil(log(1−q)/log(1−p))<sup>[11](https://docs.scipy.org/doc/scipy/tutorial/stats/discrete_geom.html)</sup>.

## Memoryless property

The defining property is that the wait so far tells you nothing about the wait to come:

\[ P(N > n + m \mid N > m) = P(N > n) \]

In words, the conditional distribution of N − m given N > m is the same as the distribution of N<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. If the first success has not occurred by trial m, the remaining number of trials needed has the same distribution as a fresh sequence<sup>[12](https://www.randomservices.org/random/bernoulli/Geometric.html)</sup>. The property follows from the modeling assumptions: each trial is independent with fixed success probability, so a failure does not improve or reduce the chance that the next trial succeeds<sup>[1](https://www.britannica.com/topic/geometric-distribution)</sup>.

The geometric distribution is the only discrete memoryless distribution<sup>[2](https://mathworld.wolfram.com/GeometricDistribution.html)</sup>. A characterization result in the Journal of Applied Probability shows the property can even be replaced by constancy of the conditional variance: a distribution on the nonnegative integers with constant conditional variance is geometric<sup>[13](https://www.cambridge.org/core/journals/journal-of-applied-probability/article/abs/characterization-of-the-geometric-distribution/CD4376651482B3A85C99E043AA8B039B)</sup>.

**Gambler's fallacy versus genuine memorylessness.** Because Bernoulli trials have no memory, no betting strategy based on observations of past outcomes, such as in roulette or craps, can possibly help the gambler<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>. The same logic cuts the other way in applications: the model assumes constant p, so it cannot represent learning effects. OpenStax's illustration is a baseball hitter whose ten previous failures are irrelevant to the probability of success in the next at-bat under a geometric model; if past at-bats do change the probability, the model does not apply<sup>[14](https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Introductory_Statistics_2e_(OpenStax)/04%3A_Discrete_Random_Variables/4.05%3A_Geometric_Distribution)</sup>.

## By the numbers

The mean 1/p sets the practical scale. With p = 0.8 the expected wait is 1/0.8 = 1.25 trials; with p = 0.1 it is 1/0.1 = 10 trials<sup>[15](https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Introduction_to_Statistics_4e_(Diez_et_al.)/04%3A_Distributions_of_Random_Variables/4.02%3A_Geometric_Distribution)</sup>. As p shrinks, the mean grows and the right tail stretches: at p = 0.05 the mean climbs toward 20 with a visibly long tail<sup>[10](https://scisim.org/sims/statistics/23_geometric)</sup>.

Tail probabilities decay geometrically at rate (1−p) per trial. A worked quality-control calculation with p = 0.02, estimating how many customers must be contacted to find one with a fault, gives a 99% quantile of about 228<sup>[9](https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html)</sup>.

## Relation to other distributions

**Negative binomial.** The geometric distribution is the special case of the negative binomial distribution counting trials until the first success<sup>[3](https://online.stat.psu.edu/stat414/book/export/html/679)</sup>. Boost.Math states the identity directly: geometric(p) equals negative_binomial(1, p)<sup>[6](https://live.boost.org/doc/libs/1_85_0/libs/math/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html)</sup>. The Stanford Probability Coders notes likewise state that when r = 1, the negative binomial counting flips until r heads is identical to the geometric<sup>[16](https://probabilitycoders.stanford.edu/win26/more_discrete)</sup>.

**Exponential.** The geometric distribution is the discrete analog of the exponential distribution: the exponential models elapsed time before an event in continuous time, while the geometric models waiting in discrete time<sup>[17](https://www.statlect.com/probability-distributions/geometric-distribution)</sup>. The connection is quantitative. If n → ∞ with n·pₙ → r > 0, the scaled variable Uₙ/n converges to the exponential distribution with rate r; that exponential has mean 1/r and variance 1/r², mirroring the geometric mean 1/p and variance (1−p)/p²<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)</sup>.

## Estimation and inference

Fitting geometric-based models to count data is an active area. A study of the zero-and-one-inflated geometric distribution employed maximum likelihood, the EM algorithm, and Bayesian estimation, validated by simulation; applied to the 1994 Detroit traffic accident deaths dataset, the inflated model fit the data better than the alternatives<sup>[18](https://xuebao.sues.edu.cn/en/article/doi/10.12299/jsues.23-0213)</sup>.

Recent extensions add structure for data with excess zeros. In 2025 researchers introduced the zero-inflated transmuted geometric (ZITG) distribution, deriving its moment generating function and studying reliability and actuarial properties, with several estimation strategies assessed by simulation on three empirical datasets<sup>[19](https://link.springer.com/article/10.1007/s10985-025-09683-w)</sup>. Also in 2025, the Zero-Inflated Right-Censored Geometric Regression (ZIRCGeR) model was proposed for count data with many zeros, including a novel test for structural versus stochastic zeros that showed better Type I error control than Wald, likelihood ratio, and Score tests in most simulated scenarios<sup>[20](https://ideas.repec.org/a/spr/stpapr/v66y2025i7d10.1007_s00362-025-01771-1.html)</sup>.

## Applications

Classic textbook examples ask how many runs before a system fails, how many shots before one is on target, how many poll samples before finding a voter of a given party, and how many retransmissions of a packet before it successfully reaches its destination<sup>[21](https://courses.cs.washington.edu/courses/cse312/24wi/files/Berkeley-notes/Berkeley6-n19.pdf)</sup>.

The Boost worked example shows the pattern in quality inspection and customer-contact planning: with a 2% fault rate, a geometric distribution with p = 0.02 gives quantiles at 80%, 95%, and 99% confidence for the number of customers to contact before finding one with the fault<sup>[9](https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html)</sup>. Other cited application areas include reliability (the number of tests until failure), queuing theory, and cryptography (the number of hash attempts)<sup>[10](https://scisim.org/sims/statistics/23_geometric)</sup>.

The distribution also serves as a building block for count models. Recent work builds integer-valued autoregressive models on the zero-inflated geometric distribution ZiGeom(φ, λ₁+λ), whose mixing parameter φ in (0,1) controls zero inflation or deflation; for this innovation E(ε) = (1−φ)λ and Var(ε) = (1−φ)λ((1+φ)λ+1)<sup>[22](https://pmc.ncbi.nlm.nih.gov/articles/PMC12035957/)</sup>.

## Software implementations

Libraries disagree on the support convention<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup><sup> • </sup><sup>[7](https://uk.mathworks.com/help/stats/geometric-distribution.html)</sup>.

- **SciPy** (Python) uses the trials-until-first-success convention, with pmf f(k) = (1−p)^(k−1) p for k ≥ 1, and provides a loc shift so geom.pmf(k, loc) equals geom.pmf(k − loc, p)<sup>[5](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)</sup>.
- **NumPy**'s Generator.geometric likewise samples the number of trials needed to achieve success, supported on the positive integers<sup>[23](https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.geometric.html)</sup>.
- **MATLAB** uses the opposite convention: the number of failures before one success, with pmf f(x|p) = p(1−p)^x for x = 0, 1, 2, …, CDF F(x|p) = 1 − (1−p)^(x+1), mean (1−p)/p, and variance (1−p)/p². It provides geocdf, geopdf, geoinv, geostat, and geornd, plus generic functions including mle with the name 'Geometric'<sup>[7](https://uk.mathworks.com/help/stats/geometric-distribution.html)</sup>.
- **TensorFlow Probability** parameterizes Geometric by p with pmf(k; p) = (1−p)^k · p, counting the number k of failed trials before the first success<sup>[8](https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/Geometric)</sup>.
- **Boost.Math** (C++) implements the geometric distribution as a continuous function using the number of failures as a real parameter, unlike R's integer convention, so users may need to round down for integer behavior<sup>[9](https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html)</sup>.

## References

1. [Geometric distribution, Britannica](https://www.britannica.com/topic/geometric-distribution)
2. [Geometric Distribution, Wolfram MathWorld](https://mathworld.wolfram.com/GeometricDistribution.html)
3. [Lesson 11: Geometric and Negative Binomial Distributions, Penn State STAT 414](https://online.stat.psu.edu/stat414/book/export/html/679)
4. [11.3: The Geometric Distribution, Siegrist, LibreTexts](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/11%3A_Bernoulli_Trials/11.03%3A_The_Geometric_Distribution)
5. [scipy.stats.geom, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.geom.html)
6. [geometric_distribution, Boost C++ Libraries 1.85.0](https://live.boost.org/doc/libs/1_85_0/libs/math/doc/html/math_toolkit/dist_ref/dists/geometric_dist.html)
7. [Geometric Distribution, MATLAB & Simulink, MathWorks](https://uk.mathworks.com/help/stats/geometric-distribution.html)
8. [tfp.distributions.Geometric, TensorFlow Probability](https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/Geometric)
9. [Geometric Distribution Examples, Boost.Math documentation](https://www.boost.org/doc/libs/latest/libs/math/doc/html/math_toolkit/stat_tut/weg/geometric_eg.html)
10. [Geometric Distribution, SciSim interactive simulation](https://scisim.org/sims/statistics/23_geometric)
11. [Geometric Distribution tutorial, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/tutorial/stats/discrete_geom.html)
12. [The Geometric Distribution, Random Services (Siegrist)](https://www.randomservices.org/random/bernoulli/Geometric.html)
13. [A characterization of the geometric distribution, Journal of Applied Probability](https://www.cambridge.org/core/journals/journal-of-applied-probability/article/abs/characterization-of-the-geometric-distribution/CD4376651482B3A85C99E043AA8B039B)
14. [4.5: Geometric Distribution, OpenStax Introductory Statistics 2e](https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Introductory_Statistics_2e_(OpenStax)/04%3A_Discrete_Random_Variables/4.05%3A_Geometric_Distribution)
15. [4.2: Geometric Distribution, Diez et al., Introduction to Statistics 4e](https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Introduction_to_Statistics_4e_(Diez_et_al.)/04%3A_Distributions_of_Random_Variables/4.02%3A_Geometric_Distribution)
16. [More discrete distributions, Stanford Probability Coders](https://probabilitycoders.stanford.edu/win26/more_discrete)
17. [Geometric distribution, StatLect](https://www.statlect.com/probability-distributions/geometric-distribution)
18. [Statistical analysis and application of zero-and-one-inflated geometric distribution, Journal of Shanghai University of Engineering Science](https://xuebao.sues.edu.cn/en/article/doi/10.12299/jsues.23-0213)
19. [Reliability and estimation of the zero-inflated transmuted geometric distribution, Lifetime Data Analysis (2025)](https://link.springer.com/article/10.1007/s10985-025-09683-w)
20. [Testing inflated zeros and applications in right-censored geometric regression models, Statistical Papers (2025)](https://ideas.repec.org/a/spr/stpapr/v66y2025i7d10.1007_s00362-025-01771-1.html)
21. [CS 70 Note 19: Geometric Distribution, UC Berkeley course notes](https://courses.cs.washington.edu/courses/cse312/24wi/files/Berkeley-notes/Berkeley6-n19.pdf)
22. [A non-linear integer-valued autoregressive model with zero-inflated data series, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC12035957/)
23. [numpy.random.Generator.geometric, NumPy v2.5 Manual](https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.geometric.html)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Statistics and probability › Probability theory › Probability distributions › Distribution families and classification › Discrete distribution families*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
