Audited 31 Jul 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

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

P(X = k)
0.1055
The probability, from 0 to 1, that the first success occurs on exactly trial k.
P(X ≤ k)
0.6836
Model scope
First-success convention with k starting at 1; trials must be independent with constant p, and the page does not estimate p or diagnose dependence, stopping bias, or changing conditions.

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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; P(X≤k)=1-(1-p)^k

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.

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.

success Probability0.25
trial Number4

Frequently asked questions.

If I've failed ten times in a row, am I due a success?
No. The distribution is memoryless: past failures do not change the next attempt, which still succeeds with probability p, and the expected number of further attempts is still 1 ÷ p. Believing otherwise is the gambler's fallacy. If you genuinely are more likely to succeed after failing, the attempts are not independent and this model does not apply.
What are the odds of rolling the first six on the third throw?
With p = 1/6, the first two throws must miss and the third must hit: (5/6)² × 1/6 = 25/216, about 0.116. The chance of having rolled at least one six within six throws is 1 − (5/6)⁶, about 0.665 — noticeably short of the certainty many people expect.
Why is the first trial always the most likely?
Because each later trial needs an extra failure in front of it. P(X = 1) is simply p, P(X = 2) is p times (1 − p), and each step multiplies by another 1 − p, which is less than 1. The most likely single outcome is therefore k = 1, even when the average wait is much longer.
My textbook's formula is (1 − p)^k × p. Which is right?
Both, for different definitions. That version counts failures before the first success, so k starts at 0. This page counts the trial on which success happens, starting at 1. To translate, add one to the number of failures: three failures before success is k = 4 here.
How many attempts do I need to be 95% sure of at least one success?
Find the smallest k with 1 − (1 − p)^k of at least 0.95, which works out as k ≥ ln(0.05) ÷ ln(1 − p). For p = 0.25 that is 10.41, so eleven attempts. You can also step k upward here until the cumulative probability crosses 0.95.

How this page was produced

Published by
Quanta Calculator
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
Coming soon