Geometric Distribution Calculator
Find the chance that the first success happens on a given trial, plus mean and spread.
What it does
You keep trying until something works. A machine keeps starting until it runs, a job seeker keeps applying until an offer arrives, or a tester keeps sampling until a defect shows up. The geometric distribution describes the number of trials needed for that first success when each try is independent and has the same chance.
This page counts the successful trial itself. If the chance of success on one try is 25%, the chance that the first success happens on trial four means three failures in a row followed by a success. That is 0.75 cubed times 0.25.
Two related conventions appear in textbooks. Some count failures before the first success instead of trials, which starts at zero and shifts every answer down by one. The probabilities map cleanly between them, but the means differ, so always check which one a source uses.
The model is only as good as the independence assumption. If earlier attempts change later chances, for example because a learner improves or a machine wears, the fixed probability no longer holds and the results here become a rough guide.
How to use
- Choose whether you want an exact trial, a cumulative chance or an interval.
- Enter the trial number k, which must be a whole number of 1 or more.
- For an interval, add a second trial number at or above k.
- Enter the success chance for one trial as a percent.
- Read the probability as a decimal and a percent.
- Use the mean to check whether your expected trial number looks reasonable.
Formula
- p
- Success chance on one trial, entered as a percent and divided by 100.
- k
- The trial number on which the first success appears.
- 1 - p
- Failure chance on any single trial.
- X
- Random count of trials through the first success.
The cumulative form is P(X <= k) = 1 - (1 - p)^k, and the survival form is P(X >= k) = (1 - p)^(k-1). At p = 100% the first trial always succeeds, so the mean is 1 and the spread is zero. At a success chance of zero the first success may never arrive, which is why the tool rejects that input.
Worked example
Example: 25% chance, first success on trial 4
Success chance 25% per trial, asking for the probability that the first success occurs on trial 4.
- Convert the chance: p = 0.25, so the failure chance is 0.75.
- There must be 3 failures before the success: 0.75 cubed = 0.421875.
- Multiply by the success chance: 0.421875 x 0.25 = 0.10546875.
- Cumulative chance by trial 4: 1 - 0.75 to the fourth = 0.683594.
- Mean trials: 1 / 0.25 = 4.
- Spread: sqrt(0.75 / 0.0625) = sqrt(12) = 3.4641.
- Tool shows probability 0.1055 (10.55 %), mean 4 and sd 3.4641.
Reference table
| Trial k | P(X = k) | P(X <= k) |
|---|---|---|
| 1 | 0.2500 (25.00 %) | 0.2500 (25.00 %) |
| 2 | 0.1875 (18.75 %) | 0.4375 (43.75 %) |
| 4 | 0.1055 (10.55 %) | 0.6836 (68.36 %) |
| 6 | 0.0593 (5.93 %) | 0.8220 (82.20 %) |
Limits
- Needs independent trials with one unchanging success chance.
- Does not cover a finite number of attempts with no success allowed.
- Cannot model learning, fatigue or changing conditions.
- The failures-only convention gives a different mean, so compare conventions carefully.
Common mistakes
- Using (1 - p)^k instead of (1 - p)^(k-1) for an exact trial.
- Starting the trial count at zero on a page that counts trials.
- Mixing the failure-count mean with the trial-count probabilities.
- Entering 25 instead of 0.25 after using a percent field.
- Assuming dependencies between attempts and still using a fixed chance.
Try it yourself
Quick checks. Answers sit tucked under each question.
At a 25% chance, what is the probability of success by trial 4?
0.6836 (68.36 %), from 1 minus 0.75 to the fourth.
At a 25% chance, what is the probability the first success is on trial 3 or later?
0.5625 (56.25 %), which is 0.75 squared.
What are the mean and standard deviation at 25%?
Mean 4 trials and standard deviation 3.4641.
Questions
Does this page count failures or trials?
It counts trials including the successful one, starting at 1. The failures-only version starts at 0.
Why is the mean 1 divided by p?
A smaller success chance means more attempts on average. At 25% you expect four tries for the first hit.
What assumption matters most?
Independence with a constant chance. If a failed try changes the odds of the next one, this model no longer applies.
How is this related to the negative binomial?
The geometric distribution is the negative binomial with one required success.
Can I enter a success chance of 100%?
Yes. The first trial then succeeds for sure, the mean is 1 and the standard deviation is zero.
What if I only have a fixed number of tries?
Use a binomial style question instead, because the process stops after that fixed count whether or not success arrives.
Sources
- Penn State STAT 414, Lesson 11: Geometric and Negative Binomial Distributions
- NIST Dataplot Reference Manual, GEOPDF