Geo

Geometric Distribution Calculator

The chance that the first success comes on trial k, within k trials or after more than k, with the mean and variance, counting either trials or failures before the first success.

Statistics & ProbabilityRuns in your browser

Result…

Count

Textbooks use both. Counting trials, X = 1 means success on the first try; counting failures, Y = 0 means the same thing.

As a decimal: 0.2 for a 20% chance. Each trial must be independent with the same p.

The trial number (counting trials) or the number of failures (counting failures).

Probability of

 

…

How it's calculated

Trials X (k = 1, 2, …): P(X = k) = (1 − p)^(k − 1) p, P(X ≤ k) = 1 − (1 − p)^k, P(X > k) = (1 − p)^k, mean 1 ÷ p
Failures Y (k = 0, 1, …): P(Y = k) = (1 − p)^k p, P(Y ≤ k) = 1 − (1 − p)^(k + 1), mean (1 − p) ÷ p
Variance (both) = (1 − p) ÷ p²

The geometric distribution answers "how long until the first success?" when each try succeeds independently with the same probability p: rolling until a six, calling until someone answers, inspecting items until the first defect. The first success on trial k needs k − 1 failures in a row and then a success, so its chance is (1 − p)^(k − 1) × p. Waiting more than k trials means k failures in a row, (1 − p)^k, and its complement is the chance of a success within k trials. Some books count the failures before the first success instead of the trials; the switch shows both, since the mean changes from 1 ÷ p to (1 − p) ÷ p while the variance stays (1 − p) ÷ p².

Your numbers, step by step

    About the Geometric Distribution calculator

    This geometric distribution calculator answers questions about waiting for a first success: what is the chance the first six comes on the fourth roll, that a sale happens within ten calls, or that a part survives more than twenty tests before failing? Enter the probability of success on each trial and a number k, and it gives the chance of exactly k, at most k, at least k and more than k, with the mean, variance and standard deviation. Textbooks and software count in two ways, either the trials up to and including the first success or the failures before it, so a switch lets you choose and every label says which one you are using. Students checking homework and analysts modelling retries both use it. The working shows each power of (1 − p) with your numbers, and it also gives how many trials a 95% chance of at least one success needs.

    How to use it

    1. Choose what to “Count”: “Trials until the first success” (1, 2, 3…) or “Failures before the first success” (0, 1, 2…).
    2. Enter the “Probability of success on each trial (p)” as a decimal, such as 0.25 for 25%.
    3. Enter the “Number (k)”: a trial number, or a number of failures.
    4. Pick the “Probability of” you want: “Exactly k”, “At most k (within k)”, “At least k” or “More than k”.
    5. Read the probability and compare it with the mean and standard deviation.

    Worked example

    With p = 0.25, the chance that the first success comes on trial 4 is 0.75³ × 0.25 = 0.10546875. The chance of a success within 4 trials is 1 − 0.75⁴ = 0.68359375, and of needing more than 4 trials is 0.75⁴ = 0.31640625. Counting trials, the mean is 1 ÷ 0.25 = 4 and the variance (1 − 0.25) ÷ 0.25² = 12. Switched to failures, Y = 3 describes the same event and gives the same 0.10546875, but the mean becomes 3. A 95% chance of at least one success takes 11 trials.

    Updated

    Questions people ask

    How do I calculate the probability of the first success on trial k?

    Multiply the chance of k − 1 failures in a row by the chance of a success: (1 − p)^(k − 1) × p. For p = 0.2 and k = 3 that is 0.8² × 0.2 = 0.128.

    What is the difference between the two geometric distribution conventions?

    One counts trials, so X = 1, 2, 3… and the mean is 1 ÷ p. The other counts failures before the first success, so Y = 0, 1, 2… and the mean is (1 − p) ÷ p. The variance, (1 − p) ÷ p², is the same for both, and the probabilities are the same once you shift k by one.

    What is the chance of at least one success in n tries?

    It is 1 − (1 − p)^n, which is the calculator's “At most k (within k)” result when counting trials with k = n. With a 1 in 6 chance each time, 10 tries give 1 − (5/6)^10 ≈ 0.838.

    Does the geometric distribution mean I am due a success after many failures?

    No. Each trial is independent, so after any run of failures the chance of waiting k more trials is the same as it was at the start. This memoryless property is shared with its continuous cousin, the exponential distribution.

    When does the geometric distribution not apply?

    When p changes from trial to trial, when trials affect each other (drawing cards without putting them back), or when you count successes in a fixed number of trials, which is the binomial distribution. Check that each trial really has the same, independent chance.

    More in Statistics & Probability