Skip to content

Geometric Distribution Calculator

Find the probability that the first success comes on a given trial, by a given trial, or after one — counting either trials up to the first success or failures before it, as your textbook or R does. The calculator shows the formula, the mean and variance, the matching R call, a probability table and a bar chart. Free, no sign-up.

What are you counting?

Adds the probability of a value from k up to this number.

Results

ProbabilityMeaningValue
P(X = 5)first success on trial 50.0819
P(X ≤ 5)first success on trial 5 or earlier0.6723
P(X < 5)first success before trial 50.5904
P(X ≥ 5)first success on trial 5 or later0.4096
P(X > 5)first success after trial 50.3277

5

Mean (1/p)

20

Variance ((1 − p)/p²)

4.4721

Standard deviation

4

Median

How this was calculated

P(X = k) = (1 − p)^(k − 1) × p = (1 − 0.2)^(5 − 1) × 0.2 = 0.0819

P(X ≤ k) = 1 − (1 − p)^k = 1 − (1 − 0.2)^5 = 0.6723

In R: dgeom(4, 0.2) = 0.0819 and pgeom(4, 0.2) = 0.6723. R counts failures before the first success, so a first success on trial 5 is 4 failures.

Counting failures instead (Y = X − 1), the mean is 4 and the variance is the same, 20. P(X = 5) equals P(Y = 4).

Probability distribution

Geometric probabilities for p = 0.2, values 1 to 34
kP(X = k)P(X ≤ k)P(X ≥ k)
10.20000.20001.0000
20.16000.36000.8000
30.12800.48800.6400
40.10240.59040.5120
50.08190.67230.4096
60.06550.73790.3277
70.05240.79030.2621
80.04190.83220.2097
90.03360.86580.1678
100.02680.89260.1342
110.02150.91410.1074
120.01720.93130.0859
130.01370.94500.0687
140.01100.95600.0550
150.00880.96480.0440
160.00700.97190.0352
170.00560.97750.0281
180.00450.98200.0225
190.00360.98560.0180
200.00290.98850.0144
210.00230.99080.0115
220.00180.99260.0092
230.00150.99410.0074
240.00120.99530.0059
250.00090.99620.0047
260.00080.99700.0038
270.00060.99760.0030
280.00050.99810.0024
290.00040.99850.0019
300.00030.99880.0015
310.00020.99900.0012
320.00020.99920.0010
330.00020.99940.0008
340.00010.99950.0006

How to Use the Geometric Distribution Calculator

  1. 1. Choose what you count. Trials up to and including the first success (X = 1, 2, 3, …) or failures before the first success (Y = 0, 1, 2, …). Introductory courses most often use the first; R, and some statistics books, use the second.
  2. 2. Enter p. The probability of success on each independent trial, such as 0.2 for a one-in-five chance.
  3. 3. Enter k. The trial on which you want the first success (or the number of failures), and optionally an upper end for a range.
  4. 4. Read the results. Equal, at most, fewer than, at least and more than, with the formula filled in, the mean, variance and median, the equivalent R call, and a table and bar chart.

Two Definitions of the Geometric Distribution

The geometric distribution describes repeating independent trials, each with the same success probability p, until the first success. Textbooks count the outcome in two different ways, and the two give different formulas, different means and different software calls for the very same experiment.

The two conventions (X = Y + 1)
PropertyTrials: XFailures: Y
What it countsTrials up to and including the first successFailures before the first success
Possible values1, 2, 3, …0, 1, 2, …
Probability of a value k(1 − p)k−1 p(1 − p)k p
P(≤ k)1 − (1 − p)k1 − (1 − p)k+1
P(≥ k)(1 − p)k−1(1 − p)k
Mean1/p(1 − p)/p
Variance(1 − p)/p²(1 − p)/p²
SoftwareSciPy's geomR's dgeom, pgeom, qgeom

To move between them, remember X = Y + 1. A first success on trial 5 is 4 failures, so P(X = 5) = P(Y = 4) and the mean differs by exactly 1; the variance is identical. The calculator prints this conversion with your numbers, including the R function call that gives the same probability: R's dgeom(4, 0.2) answers "first success on trial 5".

Worked Example: Sales Calls

A caller closes a sale on 20% of calls, independently, so p = 0.2. Counting trials, the chance that the first sale comes on the fifth call is 0.8⁴ × 0.2 = 0.0819. The chance it comes by the fifth call is 1 − 0.8⁵ = 0.6723, on the fifth or later 0.8⁴ = 0.4096, and after the fifth 0.8⁵ = 0.3277.

The mean is 1/p = 5 calls and the variance is 0.8 / 0.2² = 20, so the standard deviation is 4.4721 — large relative to the mean, which is typical: waiting times for rare successes vary a lot. The median is 4: half of all callers close their first sale within four calls. Counting failures instead, the mean is 4, and R's dgeom(4, 0.2) returns the same 0.0819.

A memoryless distribution

After five failures in a row, the chance of success on the next trial is still p. The geometric is the discrete memoryless distribution, the counterpart of the continuous exponential distribution: past failures do not make success "due", which is the point the gambler's fallacy misses.

Frequently Asked Questions

Which definition of the geometric distribution should I use?
Use the one your textbook, instructor or software uses. If trials are counted, X starts at 1 and the mean is 1/p; if failures are counted, Y starts at 0 and the mean is (1 − p)/p. An exam answer in the wrong convention is wrong by one, so check which one the question defines.
How do I find the probability that the first success is on trial k?
Multiply k − 1 failures and one success: (1 − p)k−1 × p. With p = 0.2 and k = 5 that is 0.8⁴ × 0.2 = 0.0819. The probability of a success by trial k is the complement of k straight failures, 1 − (1 − p)k.
How do I use R's dgeom for the number of trials?
R's dgeom(x, prob) counts failures before the first success, so subtract 1 from the trial number: the probability that the first success is on trial 5 is dgeom(4, 0.2) = 0.0819, and pgeom(4, 0.2) = 0.6723 is the probability it comes by trial 5. The calculator shows these calls for your inputs.
What is the expected number of trials until the first success?
1/p when counting trials. If each attempt succeeds with probability 0.2, you expect 5 attempts on average. Counting failures the mean is (1 − p)/p = 4, one fewer, because the successful trial itself is not counted.
How is the geometric distribution related to the binomial and negative binomial?
The binomial fixes the number of trials and counts successes. The geometric fixes the number of successes at one and counts trials. The negative binomial generalises it to the r-th success, and the geometric is its special case r = 1.
Does the geometric distribution assume independent trials?
Yes, and a constant p. Drawing cards without replacement, or a player who improves with practice, breaks the assumptions. Sampling without replacement from a small population calls for the hypergeometric distribution instead.

Related Tools

More in Statistics Calculators

See all Statistics Calculators