Geometric Distribution Calculator
Find the chance that the first success lands exactly on trial k, and by trial k, when every independent attempt succeeds with the same probability p.
Geometric Distribution Calculator
Background.
Roll a die until a six comes up. Call strangers until one agrees to a survey. Take free throws until one goes in. Each is a run of identical, independent attempts that stops at the first success, and the geometric distribution describes how long such a run lasts.
The reasoning is short. For the first success to arrive on attempt k, the k − 1 attempts before it must all fail, each with probability 1 − p, and then attempt k must succeed, with probability p. Multiply those together and you have the chance of that exact outcome. The chance that success has arrived by attempt k is easier still to see from the other side: it is one minus the chance that all k attempts failed.
The shape that results surprises people. The single most likely trial for the first success is always the very first one, however small p is, and the probabilities then shrink by the same factor 1 − p with every further trial. Yet the average wait is 1 ÷ p trials, and the tail is long: with a one-in-four chance per attempt, about 4% of runs still have no success after eleven tries.
The distribution is also memoryless. A run of bad luck changes nothing about the next attempt: after ten failures the chance of succeeding on the eleventh is still p, and the expected number of further attempts is still 1 ÷ p. That is exactly what the gambler's fallacy denies, and why the model only fits when the attempts are genuinely independent and p does not drift — a salesperson who improves with practice, or a machine wearing out, breaks it.
What is geometric distribution calculator?
The geometric distribution gives the probability that the first success in a sequence of independent trials, each with the same success probability p, occurs on trial k. This page uses the first-success convention, where k counts the successful trial itself and starts at 1. Some textbooks instead count only the failures before the first success, starting at 0; that version shifts every k down by one.
How to use this calculator.
- Enter the success probability p for a single attempt as a decimal greater than 0 and at most 1 — 0.25 for one chance in four, about 0.1667 for rolling a six.
- Enter the trial number k as a whole number from 1 upward, counting the successful attempt itself: k = 3 means two failures followed by a success.
- Read P(X = k) for the chance that the first success falls on exactly that trial, and P(X ≤ k) for the chance it has happened by then.
- To find how many attempts give you a target level of confidence, raise k until P(X ≤ k) passes the level you need.
The formula.
P(X = k) = (1 − p)^(k − 1) × p and P(X ≤ k) = 1 − (1 − p)^k. In the first, (1 − p)^(k − 1) is the probability that the first k − 1 independent trials all fail, and the final p is the success on trial k. In the second, (1 − p)^k is the probability that all of the first k trials fail, so subtracting it from 1 leaves the probability that at least one succeeded. Each extra trial multiplies the exact probability by 1 − p, so the values fall geometrically — hence the name. The mean number of trials is 1 ÷ p and the variance (1 − p) ÷ p², neither of which is shown here. The page refuses p of 0 or above 1, and any k that is not a positive whole number.
A worked example.
Suppose each attempt succeeds with probability p = 0.25 and you want the chance that the first success comes on trial k = 4. The first three trials must fail: 0.75 × 0.75 × 0.75 = 0.421875. Then the fourth must succeed: 0.421875 × 0.25 = 0.1055, so P(X = 4) is about 10.5%. The cumulative chance comes from the complement. All four trials fail with probability 0.75⁴ = 0.31640625, so P(X ≤ 4) = 1 − 0.31640625 = 0.6836, roughly 68%. Notice that four is also the average wait, since 1 ÷ 0.25 = 4, yet nearly a third of runs need more than four attempts. Reaching 95% confidence takes eleven, where P(X ≤ 11) ≈ 0.958.
Frequently asked questions.
If I've failed ten times in a row, am I due a success?
What are the odds of rolling the first six on the third throw?
Why is the first trial always the most likely?
My textbook's formula is (1 − p)^k × p. Which is right?
How many attempts do I need to be 95% sure of at least one success?
References& sources.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- P(X=k) = (1-p)^(k-1)p; P(X≤k)=1-(1-p)^k
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled