Geometric Distribution Calculator

Geometric Distribution Calculator

How long until the first success? Enter the success probability p, pick a question, and read off the probability — with the mean, variance, median, a PMF chart and a memoryless demo.

Between 0 and 1 — for example 0.25 means one success in four trials, on average.
A whole number, 1 or more.

Memoryless demo

P(X > 7 | X > 4) = 0.4219 — the same as P(X > 3) = 0.4219. The past does not matter.

P(X = 3) · GEOMETRIC(p = 0.25) · TRIALS
0.1406

With p = 0.25, the first success comes on trial 4 on average. P(X = 3) = 0.1406 — the third trial is the first success about 14 times in 100.

Mean
4.0000
Variance
12.0000
Standard deviation
3.4641
Median
3
P(X ≤ 3)
0.5781
P(X > 3)
0.4219

Calculation

  1. PMF: P(X = 3) = (1 − p)^2 · p = 0.75^2 · 0.25 = 0.1406.
  2. CDF: P(X ≤ 3) = 1 − (1 − p)^3 = 1 − 0.4219 = 0.5781.
  3. Survival: P(X > 3) = (1 − p)^3 = 0.75^3 = 0.4219.
  4. Mean: 1 / p = 1 / 0.25 = 4.0000. Variance: (1 − p) / p² = 0.75 / 0.0625 = 12.0000; SD = 3.4641.
  5. Median: the smallest x with P(X ≤ x) ≥ 0.5 is 3.
  6. Memoryless: P(X > 7 | X > 4) = P(X > 3) = 0.4219.

PMF chart — probability of each trial

Each bar is P(X = k). The bar for k = 3 is highlighted: the first success lands on trial 3 with probability 0.1406.

Trials convention: X counts the trial of the first success, so X = 1, 2, 3, … Switch to “Failures before success” to count Y = 0, 1, 2, … instead — the same p, the same variance, a mean one less.

PMF table — first 10 values

kP(X = k)P(X ≤ k)
10.25000.2500
20.18750.4375
30.14060.5781
40.10550.6836
50.07910.7627
60.05930.8220
70.04450.8665
80.03340.8999
90.02500.9249
100.01880.9437

A geometric distribution calculator answers one question: how long until the first success? Give it the probability p of success on a single trial, and it works out the probability that the first success lands on a particular trial, the chance it comes by a certain trial, and the average wait — for both conventions, trials until success and failures before success.

How to use the geometric distribution calculator

  1. Choose a convention: Trials until success (X = 1, 2, …) or Failures before success (Y = 0, 1, …). The two count the same wait in different ways — see the table below.
  2. Enter p, the probability of success on each trial — for example 0.25 for a one-in-four chance.
  3. Pick a question: P(X = k) for one exact trial, P(X ≤ k) for “by trial k”, P(X > k) for “still waiting after k trials”, a range, or a quantile.
  4. Read the headline probability, then check the results grid for the mean, variance, median, the PMF chart and the memoryless demo.

Try it now: with p = 0.25, the calculator gives P(X = 3) = 0.1406, P(X ≤ 2) = 0.4375, P(X > 5) = 0.2373, mean 4, variance 12 and median 3. Switch to failures and the same p gives P(Y = 2) = 0.1406 and mean 3. With p = 0.5, P(X = 1) = 0.5 and P(X ≤ 3) = 0.875.

What is a geometric distribution?

A geometric distribution describes the number of independent trials until the first success, where each trial has the same probability p of success. It is the discrete analogue of the exponential distribution, and the waiting-time distribution for a sequence of coin flips, dice rolls or any repeated attempt with a fixed chance of success. The probability that the first success lands on trial k is P(X = k) = (1 − p)^(k−1) · p — k − 1 failures, then a success. The chance the first success comes by trial k is P(X ≤ k) = 1 − (1 − p)^k, and the chance you are still waiting after k trials is P(X > k) = (1 − p)^k. For the family of distributions this belongs to, see the guide to probability distributions; the binomial distribution counts successes in a fixed number of trials, while the geometric counts trials until a fixed number of successes.

The two-conventions trap: two textbooks, two geometric distributions. The trials convention counts X = 1, 2, 3, … — the trial of the first success. The failures convention counts Y = 0, 1, 2, … — the failures before the first success. They describe the same wait: X = Y + 1. Their means differ by 1 (1/p against (1 − p)/p), but their variances are identical ((1 − p)/p²). Always check which one your question uses — this calculator has both, side by side.
Trials until success (X)Failures before success (Y)
Values1, 2, 3, …0, 1, 2, …
PMFP(X = k) = (1 − p)^(k−1) · pP(Y = k) = (1 − p)^k · p
CDFP(X ≤ k) = 1 − (1 − p)^kP(Y ≤ k) = 1 − (1 − p)^(k+1)
Mean1/p(1 − p)/p
Variance(1 − p)/p²(1 − p)/p²
Mean when p = 0.2543

Geometric vs binomial

The binomial and geometric distributions are two sides of the same coin-flipping experiment. The binomial fixes the number of trials n and counts the successes; the geometric fixes the number of successes (one) and counts the trials. Flip a fair coin 10 times and count the heads — binomial. Flip it until the first head appears — geometric. The negative binomial distribution generalises the geometric to r successes: the geometric is the negative binomial with r = 1. See the guide to probability distributions for the full family.

The memoryless property

The geometric distribution is memoryless: the past does not change the odds. If you have already waited 4 trials without a success, the chance of waiting 3 more is exactly the chance of waiting 3 from the start: P(X > 7 | X > 4) = P(X > 3) = 0.4219 when p = 0.25. A used light bulb is the classic example — a bulb that has already burned for 100 hours is no more likely to fail in the next hour than a brand-new one, if its lifetime is geometric (in the continuous case, exponential). The demo box on the calculator lets you test this with your own numbers.

Formulas at a glance

With p = 0.25:

QuantityTrials (X)Failures (Y)
PMFP(X = k) = (1 − p)^(k−1) · pP(Y = k) = (1 − p)^k · p
CDFP(X ≤ k) = 1 − (1 − p)^kP(Y ≤ k) = 1 − (1 − p)^(k+1)
Mean1/p = 4(1 − p)/p = 3
Variance(1 − p)/p² = 12(1 − p)/p² = 12
Standard deviation3.46413.4641
Median32
90th percentile98

Worked examples

Example 1 — how long until the first success? (p = 0.25)

A free-throw shooter makes 25% of her shots. What is the chance her first make comes on the third shot? P(X = 3) = (1 − 0.25)² · 0.25 = 0.75² · 0.25 = 0.1406. The chance it comes within the first two shots is P(X ≤ 2) = 1 − 0.75² = 0.4375, and the chance she is still waiting after five shots is P(X > 5) = 0.75^5 = 0.2373. On average the first make comes on trial 1/0.25 = 4, the variance is (1 − 0.25)/0.25² = 12 (SD 3.4641) and the median is 3 — half the time the first make comes by the third shot. In the failures convention the same story is P(Y = 2) = 0.1406 with mean 3 and the same variance 12. And the memoryless check: P(X > 7 | X > 4) = P(X > 3) = 0.4219.

Example 2 — a fair coin (p = 0.5)

Flip a fair coin until the first head. The chance the first head is on the very first flip is P(X = 1) = 0.5, and the chance it comes within three flips is P(X ≤ 3) = 1 − 0.5³ = 0.875. The mean wait is 1/0.5 = 2 flips, the variance is (1 − 0.5)/0.5² = 2 and the median is 1 — half of all sequences start with a head.

Edge cases

  • p = 1: the first trial always succeeds, so P(X = 1) = 1, the mean is 1 and the variance is 0. The calculator shows this without an error — it is a genuine degenerate case, not a mistake.
  • p = 0.1: the first success is rare — P(X = 1) = 0.1 and the mean wait is 1/0.1 = 10 trials.
  • p close to 0: the mean 1/p grows fast and the distribution spreads out — with p = 0.01 the mean wait is 100 trials and the SD is about 99.5.
  • k must be a whole number: the geometric distribution only lives on whole trials. A fractional k is an error, not a probability.
  • Right-skewed: the most likely single value is always the first one (P(X = 1) = p), but the long tail pulls the mean above the median — with p = 0.25 the mean is 4 and the median is 3.

Frequently asked questions

Trials or failures — which convention should I use?

Use the one your textbook or question uses. The trials convention counts X = 1, 2, 3, … (the trial of the first success); the failures convention counts Y = 0, 1, 2, … (the failures before it). They describe the same wait — X = Y + 1 — so the variances are the same and the means differ by 1. This calculator has both, so you can check your answer in either form.

Why is the geometric distribution memoryless?

Because each trial is independent with the same success probability p, the past cannot change the odds. Having waited s trials without a success, the chance of waiting r more is exactly the chance of waiting r from the start: P(X > s + r | X > s) = P(X > r). Only the geometric (discrete) and exponential (continuous) distributions have this property.

Source: the geometric distribution on this page is the standard geometric distribution. All worked examples on this page were recomputed with Python (scipy.stats). Last updated 19 November 2026.

See all 91 free statistics tools on Empirical Rule Calculators.