Skip to content

Geometric Distribution Calculator

Find the probability of the first success on or before a trial, using a fixed success probability and a matching bar chart.

Inputs

Processed in your browser.

0.000000001 ≤ p ≤ 1; 0.25 means 25%.

1–1,000,000,000; includes the successful trial.

Result

Enter values and calculate to show results and the distribution.

Enter values and calculate to show results and the distribution.

How to use

Use this calculator for repeated, independent trials with the same success probability p. It answers when the first success occurs. Enter p as a number from zero to one, such as 0.25 for 25%, and enter the trial number k. This calculator counts the successful trial: the first possible value is k=1. Select exactly k, at most k or more than k, then press Calculate to show the probabilities and matching highlighted bars.

Understand the probabilities

The probability of first success on trial k is P(X=k)=(1−p)ᵏ⁻¹p: the first k−1 trials fail and the next succeeds. P(X≤k)=1−(1−p)ᵏ is the probability of at least one success within k trials. P(X>k)=(1−p)ᵏ is the probability that all first k trials fail. The mean number of trials is 1/p, and the variance is (1−p)/p².

Worked examples

For p=0.25 and k=3, first success on the third trial has probability 14.06%. Success within three trials has probability 57.81%, while needing more than three trials has probability 42.19%. The expected number of trials is four. An expectation of four does not mean that the fourth trial is the most likely first success.

For p=0.5 and k=1, exactly one trial has probability 50%, and needing more than one also has probability 50%. The mean is two trials and the variance is two. If p=1, first success occurs on trial one with certainty; any later exact trial has probability zero.

Uses and limits

The supported success probability is 0.000000001≤p≤1, and k must be an integer from 1 through 1,000,000,000. p=0 is excluded because a first success never occurs and its mean is not finite. Use decimal point or comma without thousands separators. Negative, blank and non-integer trial counts produce an error. Changing success probabilities, dependent trials and sampling without replacement require a different model.

Frequently asked questions

Is k the number of failures?

No. Some books define a geometric variable as failures before success, starting at zero. Here X counts all trials through the first success, starting at one. To ask about three failures followed by success, enter k=4; do not enter three.

Why do the bars stop at trial 31?

The picture shows the first 31 individual trial values so that bars remain distinct. The remaining tail probability is reported separately. For small p, most probability can lie beyond the picture. A missing bar is never evidence that its probability is zero.

Why is the mean not a whole number?

The mean is a long-run average across many repeated experiments and need not be an integer. Individual trial counts are integers. The most likely first success is at trial one, even when the expected wait is much longer.

How do precision, Copy and Clear work?

Calculations retain internal precision. Ordinary displayed values use at most two decimals, small positive probabilities use scientific notation, and positive values below numerical resolution use < 1E−300. Copy result includes the confirmed p, k and results. Editing inputs or the selected event clears results and the chart until recalculation; Clear empties numeric fields.