Geometric distribution calculator

How many tries until the first success? Enter the probability of success on each independent trial and k to get the exact probability that the first success comes on trial k, the chance it comes by then or later, and the expected number of trials.

On each trial, greater than 0 and at most 1, for example 0.2.
The trial number of the first success (from 1), or the number of failures before it (from 0).
P(X = k)0.128
P(X ≤ k)
0.488
P(X < k)
0.36
P(X ≥ k)
0.64
P(X > k)
0.512
Mean
5
Variance (1 − p)/p²
20
Standard deviation
4.47214

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the probability of success p on each trial.
  2. Enter k and choose whether X counts trials (first success on trial k) or failures before the first success.
  3. Read P(X = k) and the cumulative probabilities. The chart shows the distribution with k highlighted.

Formulas

With q = 1 − p and j = the number of failures before the success (j = k − 1 counting trials, j = k counting failures):

  • P(X = k) = qʲ · p
  • P(X > k) = q^(j + 1), P(X ≥ k) = qʲ, P(X ≤ k) = 1 − q^(j + 1)
  • Mean 1/p (trials) or q/p (failures); variance q/p²

Worked example

A salesperson closes 20 % of calls (p = 0.2). The chance that the first sale is on call 3 is 0.8² · 0.2 = 0.128. The chance of a sale within the first 3 calls is 1 − 0.8³ = 0.488, and the chance of three calls without a sale is 0.512. On average the first sale takes 5 calls, with variance 0.8/0.04 = 20 and standard deviation 4.47214.

Counting failures instead, P(X = 3) is the chance of exactly 3 failed calls before the first sale: 0.8³ · 0.2 = 0.1024.

Tips and common mistakes

  • The trials must be independent with the same p; drawing cards without replacement is not geometric.
  • “At least one success in n trials” is 1 − (1 − p)ⁿ, the same as P(X ≤ n) when counting trials.
  • Check which version your textbook uses before comparing answers; they differ by one in k and in the mean.

Frequently asked questions

What is the geometric distribution formula?

Counting trials, P(X = k) = (1 − p)^(k − 1) · p: k − 1 failures and then a success. The cumulative probability is P(X ≤ k) = 1 − (1 − p)^k and the tail P(X > k) = (1 − p)^k.

What is the expected number of trials?

1/p trials, or (1 − p)/p failures before the first success. With a 1-in-6 chance, such as rolling a six, you need 6 rolls on average. The variance is (1 − p)/p² in both versions.

Trials or failures: which version is right?

Both are used. Textbooks in probability often count trials (support 1, 2, …); software such as R's dgeom counts failures (support 0, 1, …). The shapes are the same, shifted by one.

Is it memoryless?

Yes. After any number of failures, the chance of needing k more trials is the same as at the start. It is the discrete counterpart of the exponential distribution.

More in Math

All tools in this category: Math ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.