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.
Memoryless demo
P(X > 7 | X > 4) = 0.4219 — the same as P(X > 3) = 0.4219. The past does not matter.
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.
Calculation
- PMF: P(X = 3) = (1 − p)^2 · p = 0.75^2 · 0.25 = 0.1406.
- CDF: P(X ≤ 3) = 1 − (1 − p)^3 = 1 − 0.4219 = 0.5781.
- Survival: P(X > 3) = (1 − p)^3 = 0.75^3 = 0.4219.
- Mean: 1 / p = 1 / 0.25 = 4.0000. Variance: (1 − p) / p² = 0.75 / 0.0625 = 12.0000; SD = 3.4641.
- Median: the smallest x with P(X ≤ x) ≥ 0.5 is 3.
- 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.
PMF table — first 10 values
| k | P(X = k) | P(X ≤ k) |
|---|---|---|
| 1 | 0.2500 | 0.2500 |
| 2 | 0.1875 | 0.4375 |
| 3 | 0.1406 | 0.5781 |
| 4 | 0.1055 | 0.6836 |
| 5 | 0.0791 | 0.7627 |
| 6 | 0.0593 | 0.8220 |
| 7 | 0.0445 | 0.8665 |
| 8 | 0.0334 | 0.8999 |
| 9 | 0.0250 | 0.9249 |
| 10 | 0.0188 | 0.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
- 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.
- Enter p, the probability of success on each trial — for example 0.25 for a one-in-four chance.
- 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.
- 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.
| Trials until success (X) | Failures before success (Y) | |
|---|---|---|
| Values | 1, 2, 3, … | 0, 1, 2, … |
| PMF | P(X = k) = (1 − p)^(k−1) · p | P(Y = k) = (1 − p)^k · p |
| CDF | P(X ≤ k) = 1 − (1 − p)^k | P(Y ≤ k) = 1 − (1 − p)^(k+1) |
| Mean | 1/p | (1 − p)/p |
| Variance | (1 − p)/p² | (1 − p)/p² |
| Mean when p = 0.25 | 4 | 3 |
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:
| Quantity | Trials (X) | Failures (Y) |
|---|---|---|
| PMF | P(X = k) = (1 − p)^(k−1) · p | P(Y = k) = (1 − p)^k · p |
| CDF | P(X ≤ k) = 1 − (1 − p)^k | P(Y ≤ k) = 1 − (1 − p)^(k+1) |
| Mean | 1/p = 4 | (1 − p)/p = 3 |
| Variance | (1 − p)/p² = 12 | (1 − p)/p² = 12 |
| Standard deviation | 3.4641 | 3.4641 |
| Median | 3 | 2 |
| 90th percentile | 9 | 8 |
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.
Next steps
📘
● Live
Types of Probability Distributions
Meet the whole family — binomial, Poisson, normal, exponential and more.
Guide
Read the Guide →
🧮
● Live
Binomial Probability Calculator
Count successes in a fixed number of trials — the binomial side of the coin.
Calculator
Try Calculator →
🧮
● Live
Expected Value Calculator
Work out E(X), variance and fair prices for discrete random variables.
Calculator
Try Calculator →
More Tools to Explore
Keep going with the calculators that pair with the geometric distribution — the binomial and Poisson distributions, the exponential and uniform distributions, expected value and z-scores.
Binomial Probability Calculator
Count successes in a fixed number of trials — the binomial side of the same coin flips.
Poisson Distribution Calculator
Work out probabilities for counts of rare events in a fixed interval.
Exponential Distribution Calculator
The continuous, memoryless waiting-time distribution — the geometric distribution's twin.
Uniform Distribution Calculator
Probabilities, quantiles, mean and variance for flat continuous and discrete distributions.
Expected Value Calculator
Work out E(X), variance and fair prices for discrete random variables.
Normal Distribution Calculator
CDF, inverse and graph for the bell curve that underpins so much of statistics.
Explore All Tools →
Browse all 91 free statistics tools — every calculator on this site in one place.