Geometric Distribution Calculator
Enter the probability of success on each trial and the number of trials (or failures) you want to evaluate. The calculator returns the exact probability at k, all four cumulative tail probabilities, the mean, variance and standard deviation of the distribution. Switch between the two standard conventions (trials to first success vs failures before first success) and watch the PMF chart update in real time.
Formula
Worked example
Suppose a basketball player makes free throws with probability p = 0.7. What is the probability the first miss occurs on the 4th attempt (failures convention, k = 3)? PMF: (1 - 0.7)^3 * 0.7 = 0.3^3 * 0.7 = 0.027 * 0.7 = 0.0189, about 1.89%. The expected number of successes before the first failure is q/p = 0.3/0.7 ≈ 0.43.
What is the geometric distribution?
The geometric distribution is a discrete probability distribution that models the number of independent Bernoulli trials needed to get the first success. A Bernoulli trial is any experiment with exactly two outcomes: success (probability p) and failure (probability 1 - p). Because each trial is independent and the success probability stays constant, the distribution is memoryless: past failures carry no information about future attempts. This property makes the geometric distribution the discrete-time analogue of the exponential distribution.
Two conventions: trials vs failures
There are two common ways to define the geometric random variable. In the "trials" convention, X is the total number of trials up to and including the first success, so X can be 1, 2, 3, .... Its PMF is P(X = k) = (1 - p)^(k-1) * p, its mean is 1/p, and the minimum value is 1. In the "failures" convention, X is the number of failures before the first success, so X can be 0, 1, 2, .... Its PMF is P(X = k) = (1 - p)^k * p, and its mean is (1 - p)/p. Both conventions share the same variance (1 - p)/p^2 and standard deviation. This calculator supports both; choose the one that matches your textbook or problem statement.
How to use this calculator
Select the convention that matches your problem, enter the probability of success p (a number between 0 and 1), and enter the number of trials or failures k you want to evaluate. The calculator returns P(X = k), all four tail probabilities, and the mean, variance and standard deviation of the distribution. The chart below the results plots the full PMF and CDF so you can see how the distribution is shaped across the whole range of k. All results update instantly as you type.
Memoryless property and real-world applications
The geometric distribution is the only discrete distribution with the memoryless property: P(X > m + n | X > m) = P(X > n). In plain terms, if you have already failed m times, the conditional probability of needing n more trials is the same as if you were starting from scratch. Real-world applications include quality control (how many items until the first defective one), reliability engineering (how many cycles before the first failure), clinical trials (how many patients to recruit before the first adverse event), and telecommunications (how many transmission attempts before the first successful packet delivery).
PMF and CDF for p = 0.3 (trials convention)
| k (trials) | P(X = k) | P(X ≤ k) | P(X > k) |
|---|---|---|---|
| 1 | 0.300000 | 0.300000 | 0.700000 |
| 2 | 0.210000 | 0.510000 | 0.490000 |
| 3 | 0.147000 | 0.657000 | 0.343000 |
| 4 | 0.102900 | 0.759900 | 0.240100 |
| 5 | 0.072030 | 0.831930 | 0.168070 |
| 6 | 0.050421 | 0.882351 | 0.117649 |
| 7 | 0.035295 | 0.917646 | 0.082354 |
| 8 | 0.024706 | 0.942352 | 0.057648 |
| 9 | 0.017294 | 0.959646 | 0.040354 |
| 10 | 0.012106 | 0.971752 | 0.028248 |
Exact probabilities for the number of trials to first success when p = 0.3. The CDF column shows the probability of success by that trial or earlier.
Frequently asked questions
What is the difference between the trials and failures convention?
In the trials convention X counts every attempt including the successful one, so the minimum value is 1 and the mean is 1/p. In the failures convention X counts only the failed attempts before the success, so the minimum value is 0 and the mean is (1 - p)/p. The two are related by X_failures = X_trials - 1. Both share the same variance. Choose whichever your textbook or problem statement uses.
What does the memoryless property mean in practice?
It means that past failures give you no new information about how many more trials you need. If you flip a biased coin looking for heads and you have already seen 10 tails, the expected number of additional flips to get the first head is exactly the same as it was on the very first flip. This is unique to the geometric distribution among all discrete distributions.
How do I find the probability of at least one success in n trials?
Using the trials convention, P(X <= n) = 1 - (1 - p)^n. For example, with p = 0.3 and n = 5, P(X <= 5) = 1 - 0.7^5 = 1 - 0.16807 = 0.83193, so there is about an 83.2% chance of at least one success in the first five trials.
What is the median of the geometric distribution?
The median is the smallest integer k such that P(X <= k) >= 0.5. For the trials convention this works out to the ceiling of -1 / log2(1 - p). For example with p = 0.3 the median is ceil(log(0.5) / log(0.7)) = ceil(1.94) = 2 trials. Because the distribution is right-skewed, the median is always less than or equal to the mean.
How does the geometric distribution relate to the negative binomial?
The negative binomial distribution generalises the geometric distribution to model the number of trials (or failures) needed to achieve r successes rather than just one. When r = 1, the negative binomial reduces exactly to the geometric distribution. The Poisson distribution arises as a limiting case of the binomial (and indirectly of the geometric) when n is large and p is small.