Geometric Distribution Calculator
The geometric distribution answers a simple question: if each independent trial succeeds with probability p, how many trials until the first success? This calculator takes your success probability p and a trial number k and returns the probability the first success lands exactly on trial k, the probability it happens by trial k, the probability it takes more than k trials, and the distribution's mean and variance. It uses the trials-until-first-success convention defined on the positive integers, with results following directly from the standard formulas.
Geometric distribution formula
P(X = k) = (1 - p)^(k - 1) * p
P(X <= k) = 1 - (1 - p)^k
P(X > k) = (1 - p)^k
mean = 1 / p
variance = (1 - p) / p^2; standard deviation = sqrt(variance)
This is the trials-until-first-success form, defined for k = 1, 2, 3, and so on. The probabilities decline geometrically with k, and the mean is the reciprocal of the success probability.
Geometric distribution facts
- It models the number of trials up to and including the first success.
- It is memoryless: past failures do not change the probability of future success.
- The mean number of trials is 1 divided by the success probability.
- It is the discrete analogue of the continuous exponential distribution.
- An alternative convention counts failures before the first success, shifting k by one.
Geometric distribution: frequently asked questions
What is the geometric distribution?
The geometric distribution models the number of independent Bernoulli trials needed to get the first success, where each trial succeeds with probability p. For example, it describes how many coin flips until the first heads. It is discrete, defined on the positive integers 1, 2, 3, and so on (the trials-until-first-success convention).
What is the probability mass function?
The probability that the first success occurs on trial k is P(X = k) = (1 - p)^(k-1) * p. This means k minus 1 failures, each with probability 1 minus p, followed by one success with probability p. The probabilities decline geometrically as k grows, which is where the distribution gets its name.
How do I find the cumulative probability?
The probability that the first success happens on or before trial k is P(X <= k) = 1 - (1 - p)^k. It is the complement of having k straight failures. This calculator reports both this cumulative probability and the probability of needing more than k trials, which is (1 - p)^k.
What are the mean and variance?
For the trials-until-first-success geometric distribution, the mean (expected number of trials) is 1 / p, and the variance is (1 - p) / p^2. So if each trial succeeds with probability 0.2, you expect 5 trials on average. This calculator reports both the mean and the variance from your p.
What value can p take?
The success probability p must be greater than 0 and at most 1. A p of 1 means every trial succeeds, so the first success is always on trial 1. As p approaches 0, successes become rare and the expected number of trials grows without bound. Enter p as a probability between 0 and 1.
Official sources
- NIST/SEMATECH e-Handbook of Statistical Methods: Geometric distribution.
- National Institute of Standards and Technology (NIST): Engineering Statistics Handbook.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.