Mathematics calculator

Geometric Distribution Calculator

Calculate the probability of a specified number of failures before the first success in independent Bernoulli trials.

Calculator inputs

Enter your values

Failures before success
%
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

What Is a Geometric Distribution?

A geometric distribution models waiting for the first success in independent trials with a constant success chance. This calculator defines X as the number of failures before that success, so X can be 0, 1, 2 and so on. Zero failures means success on the first trial.

Enter a failure count and a success percentage to calculate the chance of that exact outcome. The geometric distribution calculator also reports expected failures, variance and standard deviation. It does not return a cumulative chance or the probability of a success within a chosen deadline.

How to Calculate Failures Before the First Success

  1. Define success for one trial and check that trials are independent with the same success chance each time.
  2. Enter a whole-number Failures before first success from 0 through 1000000. If success occurs on trial four, enter 3.
  3. Enter Success probability per trial as a percentage. Use 40 for 40%, not 0.4. The form supports 0.000000001% through 100%.
  4. Select Calculate. Read the exact-outcome probability and the three distribution summary values.

The probability result, mean, variance and standard deviation round to four decimal places, with unnecessary trailing zeros removed. A tiny positive probability can display as 0 because of rounding or numerical underflow.

When success probability is 100%, zero failures has probability 100% and every positive failure count has probability 0. A 0% success chance is rejected because the usual finite-wait model and its summary formulas would not apply.

Geometric Probability, Mean and Variance Formulas

Convert the entered percentage a to p = a/100; let q = 1 − p

Exact outcome: P(X = x) = qˣp, for x = 0, 1, 2, …

Expected failures E[X] = q/p

Variance Var(X) = q/p²

Standard deviation SD(X) = √q/p

The x failures must occur first, followed by a success. Under independence their probabilities multiply: x factors of q and one factor of p. This is one specific waiting-time outcome, not a sum over several possible waiting times.

Some references count total trials through success instead. If T = X + 1, then E[T] = 1/p while E[X] = (1−p)/p. Adding one shifts the mean but leaves the variance and standard deviation unchanged. Check that convention before comparing answers.

Reference: OpenStax: Geometric Distribution. Independent constant-probability trials and the explicit failure-count convention with mean (1−p)/p. Form limits, rounding and reporting conventions follow this calculator’s implementation.

Failure Count, Success Chance and Results

Failure count x
Number of failed trials before the first success, not the total number of trials.
Success probability per trial
Positive percentage chance, constant across independent trials.
Outcome probability
Featured percent probability of exactly x failures followed by success.
Expected failures
Long-run average failure count; it may be fractional even though each observed count is an integer.
Variance
Spread of the failure count in squared-count units.
Standard deviation
Square root of variance, in failure-count units.
Display precision
Four-decimal formatting can obscure very small positive outcomes; mean and spread depend on p, not on the entered x.

Geometric Distribution Worked Example

Illustrative example. Each independent trial succeeds with probability 40%. Find the chance of exactly 3 failures before the first success, meaning success on trial four.

Use p = 0.4 and q = 0.6. The sequence probability is 0.6 × 0.6 × 0.6 × 0.4 = 0.0864 = 8.64%. Expected failures = 0.6/0.4 = 1.5.

Variance = 0.6/0.4² = 3.75 and standard deviation ≈ 1.9365. Independently, the probabilities for 0, 1, 2 and 3 failures sum to 0.8704; adding the tail q⁴ = 0.1296 gives 1. This hand check is not a cumulative-output feature.

Calculation check. These illustrative values were checked independently against the formula and calculator response. Retain unrounded intermediate values when checking approximations.

Geometric Distribution Worked Example
QuantityValue
Failures before success3
Success probability40%
Exact outcome probability8.64%
Expected failures1.5
Variance3.75
Standard deviation1.9365

Failures Before Success Versus Total Trials

Two geometric conventions differ by one. This page asks for failures X, while a trial-count convention includes the final successful trial T = X + 1.

For p = 0.4, the expected failure count is 1.5 and expected total trials is 2.5. Both describe the same process using different starting points.

Failures Before Success Versus Total Trials
DescriptionFailures XTotal trials T
Success immediately01
Success on trial four34
Expected value at p = 0.41.52.5
Variance at p = 0.43.753.75

How to Interpret Waiting-Time Results

An expected failure count of 1.5 does not predict one and a half failures in an individual run. It is an average over many model repetitions. The observed count remains a nonnegative integer.

At a fixed p, increasing x multiplies the exact-outcome probability by q. The model also has memorylessness: after any number of failures, the next trial’s success chance is still p under its assumptions. Past failures do not make success “due.”

Sampling without replacement, learning effects or changing conditions can break independence or constant p. A geometric calculation then describes a different model from the real situation. Extremely small probabilities and very large waiting counts also require attention to numerical range and output rounding.

Common Geometric Distribution Mistakes

  • Entering the success trial number instead of the preceding failure count.
  • Entering 0.4 when the intended success probability is 40%.
  • Confusing an exact-outcome probability with a cumulative probability.
  • Assuming past failures increase the next independent success chance.
  • Using the model when success chance changes between trials.
  • Calling a rounded 0% an impossible outcome without checking the original model.

Frequently Asked Questions

Does this geometric calculator count failures or trials?

It counts failures before the first success, starting at zero. Success on trial four means three failures, so enter 3.

What is the probability formula?

For x failures before success, P(X=x) = (1−p)^x p, with independent trials and constant success probability p on the 0–1 scale.

Should I enter 40 or 0.4 for a 40% success chance?

Enter 40. The field uses percentage numbers; 0.4 means 0.4% in this form.

Why is the expected number of failures (1−p)/p rather than 1/p?

The mean 1/p counts all trials through success. Subtract the successful trial to obtain the expected failure count, (1−p)/p.

Does the result give the chance of success within a deadline?

No. It gives exactly x failures followed by the first success. A cumulative or deadline probability requires summing outcomes or using a complement formula separately.

Can the expected failure count be fractional?

Yes. It is a long-run average across many runs, not the count in one run. Each observed failure count is still an integer.

What happens when the success probability is 100%?

Success occurs immediately: zero failures has probability 100%, positive failure counts have probability 0%, and the mean and spread of failures are zero.

Do repeated failures make success more likely next time?

Not in this model. Independence and constant p mean that the next trial’s success chance remains p, regardless of previous failures.

Sources and References