The Geometric Distribution, Explained
After reading this you will know how to compute the probability that the first success lands on trial k, how the geometric distribution is shaped by the success probability p, and how to avoid the two conventions that trip people up.
What the geometric distribution describes
You repeat the same trial over and over. Each trial succeeds with probability p and fails with probability 1-p, and the trials are independent. The geometric distribution answers one question: on which trial does the first success occur?
Think of rolling a die until you get a six. Here p = 1/6 \approx 0.1667. The chance the first six shows up on the very first roll is 0.1667. The chance you have to wait until the third roll is (5/6)^2 \times (1/6) \approx 0.1157. That declining pattern is the whole story: later first successes are always less likely than earlier ones, because you had to fail every time before.
The random variable X counts trials, so it takes values 1, 2, 3, ... with no upper bound. There is always some tiny probability that you wait a very long time.
When to use it, and when not
Use the geometric distribution when three things hold: the trials are independent, each has the same success probability, and you care about the count of trials up to and including the first success.
Reach for a different tool in these cases:
- You want the number of successes in a fixed number of trials. That is the Binomial calculator.
- You want the wait until the
r-th success, not just the first. That is the Negative binomial calculator, of which the geometric is the special case r = 1. - You are counting events in continuous time or space at a fixed rate. That is the Poisson calculator, and its continuous waiting-time partner is the Exponential calculator.
- You draw without replacement, so the success probability changes each draw. Use the Hypergeometric calculator.
The geometric distribution is the discrete cousin of the exponential distribution. Both are memoryless: given that you have already failed 5 times, the probability of needing 3 more trials is exactly the same as it was at the start.
The formula and the intuition
The probability mass function for the "trial of first success" version is
Here p is the success probability on each trial, and k is the trial number of the first success, an integer from 1 upward. The logic reads left to right: fail k-1 times in a row, each with probability 1-p, then succeed once with probability p.
Two summary numbers matter. The mean number of trials is
so with p = 0.5 you expect the first success on trial 2 on average, and with p = 0.1 you expect trial 10. The variance is
which for p = 0.5 gives 2, and for p = 0.1 gives 90. Small p means both a long expected wait and a very spread-out one.
The cumulative probability that the first success happens on or before trial k has a clean closed form:
This is just the complement of failing all k trials.
A worked example with the demo data
First success on trial 3 with p = 0.5
The demo uses p = 0.5 and k = 3. Press Calculate to reproduce these numbers.
- Count the failures needed: k - 1 = 2 failures before the success.
- Probability of those failures: (1-p)^{2} = 0.5^{2} = 0.25.
- Multiply by the success on trial 3: 0.25 \times 0.5 = 0.125.
So P(X = 3) = 0.125. One in eight sequences of fair coin flips has its first head on the third flip: the pattern must be tails, tails, heads, and each of those three outcomes has probability 0.5.
Check it against the cumulative form. The chance the first success comes by trial 3 is 1 - 0.5^{3} = 0.875. The chance it comes by trial 2 is 1 - 0.5^{2} = 0.75. Their difference, 0.875 - 0.75 = 0.125, matches the mass function exactly.
1-p = 0.5.How the shape depends on p
The distribution always decays, but the speed of that decay is set entirely by p. When p is large, almost all the probability sits on the first few trials. When p is small, the probability spreads out into a long right tail.
| Trial k | p = 0.2 | p = 0.5 | p = 0.8 |
|---|---|---|---|
| 1 | 0.2 | 0.5 | 0.8 |
| 2 | 0.16 | 0.25 | 0.16 |
| 3 | 0.128 | 0.125 | 0.032 |
| 4 | 0.1024 | 0.0625 | 0.0064 |
| 5 | 0.08192 | 0.03125 | 0.00128 |
With p = 0.8, over 96% of the probability is used up by trial 2. With p = 0.2, trial 5 still carries about 8% and the tail keeps going.
Reading and interpreting the result
The calculator returns P(X = k), the probability that the first success lands on exactly trial k. A few practical readings:
- Point probability
- For p = 0.5, k = 3, the value
0.125means 12.5% of runs have their first success on trial 3, no earlier and no later. - Cumulative reading
- Add the point probabilities from 1 to
k, or use 1 - (1-p)^{k}, to get the chance the first success has happened by trialk. - Tail reading
- The chance you are still waiting after trial
kis (1-p)^{k}. For p = 0.5, k = 3 that is0.125, the same probability that no head appeared in three flips.
A single value is rarely the whole picture. Because the mean is 1/p and the standard deviation is \sqrt{1-p}\,/\,p, for p = 0.1 you expect trial 10 but with a standard deviation near 9.49. Do not treat the mean as a typical value; the distribution is heavily skewed right.
Common mistakes
There are two geometric conventions. This calculator counts trials until the first success, so X \in \{1, 2, 3, ...\} and P(X=k) = (1-p)^{k-1}p. The other convention counts failures before the first success, so Y \in \{0, 1, 2, ...\} and P(Y=k) = (1-p)^{k}p. They differ by exactly one: X = Y + 1. Check which one a formula, table or software function uses before you compare numbers.
Other frequent slips:
- Using
k = 0. In the trials convention, the first success cannot occur on trial 0. The smallest validkis 1. - Assuming independence that is not there. If earlier failures make later success more likely, for example drawing cards without replacement, the geometric model does not apply. Use the hypergeometric setup instead.
- Confusing the mean with the median. With p = 0.1 the mean is 10 but the median is 7, because the tail pulls the mean up.
- Forgetting the mass shrinks, not the count. There is no largest possible
k. The probabilities get tiny but never reach exactly zero.
Related calculators
If your setting is close but not quite geometric, these tools cover the neighbors. The Negative binomial calculator generalizes to the wait for the r-th success. The Binomial calculator fixes the number of trials and counts successes. For continuous waiting times see the Exponential calculator, and for event counts at a fixed rate the Poisson calculator. When success probability changes with each draw, use the Hypergeometric calculator. For large-sample approximations you may also want the Normal calculator.
Frequently asked questions
What is the difference between the geometric and binomial distributions?
The binomial fixes the number of trials and counts how many succeed. The geometric fixes the target (the first success) and counts how many trials that takes. With p = 0.5, a binomial with 3 trials asks "how many heads in 3 flips?", while the geometric asks "on which flip does the first head appear?".
Why does the calculator start at k = 1 and not k = 0?
This page uses the trials convention, where the first success occurs on trial 1, 2, 3, and so on. There is no trial 0. If you need the failures-before-success form that starts at 0, subtract 1 from your k or use the negative binomial calculator with r = 1.
What does memoryless mean here?
If you have already failed 4 times, the probability you need 3 more trials equals the probability a fresh start needs 3 trials. Past failures do not change the future. For p = 0.5, both equal 0.5^{2} \times 0.5 = 0.125.
How many trials should I expect before the first success?
On average, 1/p trials. For p = 0.25 that is 4 trials, for p = 0.02 it is 50. Because the distribution is right-skewed, individual waits vary a lot around that mean.
Can p be exactly 0 or 1?
No useful answer comes from p = 0: a success never happens, so the wait is infinite. At p = 1 every trial succeeds, so P(X = 1) = 1 and all other probabilities are 0. Keep p strictly between 0 and 1 for a meaningful distribution.