Geometric Distribution

A geometric distribution gives the probability that the first success happens on trial k, when independent trials each have the same probability of success p. The formula is P(X = k) = (1 - p)^{k - 1} p: k − 1 failures, then a success. The mean number of trials until the first success is 1/p.

Before this lesson: Binomial Distribution, Independent Events and Expected Value

What is a geometric random variable?

Roll a die until you get a 6, and count the rolls. That count is a geometric random variable. It could be 1, 2, 3 or any larger whole number, because there is no fixed number of trials.

A geometric setting has the same conditions as a binomial setting, except one. The trials have two outcomes, they are independent, and p stays the same. But instead of a fixed number of trials, you keep going until the first success.

BinomialGeometric
X countssuccesses in n trialstrials until the first success
Possible values0, 1, 2, …, n1, 2, 3, … (no upper limit)
Number of trialsfixednot fixed

Geometric distribution formula

To have the first success on trial k, the first k − 1 trials must all fail, and trial k must succeed. The trials are independent, so multiply:

P(X = k) = (1 - p)^{k - 1}\, p

For “within k trials” and “more than k trials,” use these shortcuts. More than k trials means the first k trials all fail:

P(X \gt k) = (1 - p)^k \qquad P(X \le k) = 1 - (1 - p)^k

The mean and standard deviation are:

\mu_X = \dfrac{1}{p} \qquad \sigma_X = \dfrac{\sqrt{1 - p}}{p}

Calculator check: on a TI-84, use geometpdf(p, k) for P(X = k) and geometcdf(p, k) for P(X \le k), both under 2nd, VARS (DISTR). In Desmos, enter the formula directly. Work it by hand first, then check.

Geometric distribution examples

Example 1: First 6 on the 4th roll

A fair die is rolled until a 6 appears. Find the probability that the first 6 comes on the 4th roll.

p = \dfrac{1}{6}, \ 1 - p = \dfrac{5}{6}

A success is rolling a 6.

P(X = 4) = \left(\dfrac{5}{6}\right)^3 \cdot \dfrac{1}{6}

Three non-6 rolls, then a 6.

= \dfrac{125}{216} \cdot \dfrac{1}{6}

Cube 5/6 (see exponents).

= \dfrac{125}{1296}

Multiply (see multiplying fractions).

\approx 0.0965

Divide.

Answer: about 0.0965. Check: geometpdf(1/6, 4) gives 0.0965.

Example 2: First miss on the 3rd shot

A basketball player makes 70% of her foul shots, and the shots are independent. Find the probability that her first miss comes on her 3rd shot.

p = 0.3

Here a “success” is a miss, so p = 1 − 0.7.

P(X = 3) = 0.7^2 \cdot 0.3

Two makes, then a miss.

= 0.49 \cdot 0.3

Square.

= 0.147

Multiply.

Answer: 0.147. Define success as the event you are waiting for, even when it is a miss.

Example 3: Within 3 rolls, and more than 5 rolls

For the die in Example 1, find the probability that the first 6 comes within the first 3 rolls, and the probability that it takes more than 5 rolls.

P(X \gt 3) = \left(\dfrac{5}{6}\right)^3 = \dfrac{125}{216}

No 6 in the first 3 rolls.

P(X \le 3) = 1 - \dfrac{125}{216}

Use the complement (see complement rule).

= \dfrac{91}{216} \approx 0.4213

Subtract and divide.

P(X \gt 5) = \left(\dfrac{5}{6}\right)^5

No 6 in the first 5 rolls.

= \dfrac{3125}{7776} \approx 0.4019

Evaluate.

Answer: P(X \le 3) \approx 0.4213 and P(X \gt 5) \approx 0.4019. Even with a 1 in 6 chance each roll, it takes more than 5 rolls about 40% of the time.

Example 4: Mean and standard deviation

Find the mean and standard deviation of the number of rolls needed to get the first 6.

\mu_X = \dfrac{1}{1/6} = 6

Mean = 1/p.

\sigma_X = \dfrac{\sqrt{5/6}}{1/6}

Use the standard deviation formula.

= 6\sqrt{5/6}

Dividing by 1/6 is the same as multiplying by 6.

\approx 5.48

Evaluate (see square roots).

Answer: on average it takes 6 rolls, with a standard deviation of about 5.48 rolls. The histogram shows how spread out the waits are.

Probability histogram of the number of rolls until the first 6, for k = 1 to 12. Bar heights fall steadily: 1, 0.167; 2, 0.139; 3, 0.116; 4, 0.096; 5, 0.080; 6, 0.067; 7, 0.056; 8, 0.047; 9, 0.039; 10, 0.032; 11, 0.027; 12, 0.022. A marker shows the mean at 6 rolls.
Each bar is 5/6 of the one before it, so the tallest bar is always at 1 and the distribution is skewed right.

Example 5: Calls until the first sale (word problem)

On a sales line, 20% of calls end in a sale, and calls are independent (example data). A new rep calls until she makes her first sale. Find the mean number of calls, the probability that she makes a sale within 5 calls, and the probability that she needs more than 10 calls.

\mu_X = \dfrac{1}{0.2} = 5

Mean = 1/p.

\sigma_X = \dfrac{\sqrt{0.8}}{0.2} \approx 4.47

Standard deviation.

P(X \le 5) = 1 - 0.8^5

A sale within 5 calls is the complement of 5 failures.

= 1 - 0.32768

Evaluate the power.

= 0.67232

Subtract.

P(X \gt 10) = 0.8^{10}

The first 10 calls all fail.

\approx 0.1074

Evaluate.

Answer: she needs 5 calls on average (standard deviation about 4.47). She has about a 67% chance of a sale within 5 calls, and about an 11% chance of needing more than 10.

Common mistakes

MistakeExample of the errorFix
Using k failures instead of k − 1P(X = 4) = (5/6)⁴(1/6)Only 3 failures come before the success on roll 4: (5/6)³(1/6).
Using the binomial formulaMultiplying by 4 choose 1 for the first 6 on roll 4The order is fixed (all failures first), so there is no n choose k.
Mixing up “more than” and “at least”P(X ≥ 5) = (5/6)⁵At least 5 means the first 4 fail: (5/6)⁴.
Using the wrong pUsing p = 0.7 for the first missp is the chance of the event you are waiting for: 0.3.
Thinking the mean is the most likely value“The first 6 will most likely come on roll 6.”The most likely value is always 1; the mean is 6.
Calling a fixed-n count geometricNumber of 6s in 10 rollsA fixed number of trials makes it binomial.

Related methods

Geometric sequences and series

The probabilities p, p(1 - p), p(1 - p)^2, \dots form a geometric sequence with common ratio 1 - p. Their sum is an infinite geometric series: \dfrac{p}{1 - (1 - p)} = 1, so the distribution is valid.

Binomial or geometric?

Ask whether the number of trials is fixed. If it is, use the binomial distribution. If you keep going until the first success, use the geometric distribution. The next unit starts with Density Curves, which describe continuous random variables.

Practice problems

  1. X is geometric with p = 0.4. Find P(X = 3).
  2. X is geometric with p = 0.4. Find P(X ≤ 3).
  3. X is geometric with p = 0.4. Find the mean and standard deviation.
  4. A coin is flipped until it lands heads, and X is the number of flips. Is X geometric? If so, give p.
  5. A coin is flipped 10 times, and X is the number of heads. Is X geometric?
  6. Find the probability that the first head comes on the 4th flip of a fair coin.
  7. 10% of cereal boxes contain a prize (example data). Find the mean number of boxes you must open to get a prize, and the probability that it takes more than 10 boxes.
  8. Use Problem 7. Find the probability that you get a prize within the first 3 boxes.
  9. A player makes 70% of her shots. Find the probability that her first make comes on her 2nd shot.
  10. A scratch-off game wins 5% of the time (example data). Find the mean and standard deviation of the number of tickets until the first win.
Show answers

1.

0.6^2 \cdot 0.4

Two failures, then a success.

= 0.36 \cdot 0.4

Square.

= 0.144

Multiply.

Answer: 0.144

2.

1 - 0.6^3

Complement of 3 failures.

= 1 - 0.216

Cube.

= 0.784

Subtract.

Answer: 0.784

3.

\mu = \dfrac{1}{0.4} = 2.5

Mean = 1/p.

\sigma = \dfrac{\sqrt{0.6}}{0.4} \approx 1.94

Standard deviation.

Answer: mean 2.5, standard deviation about 1.94

4.

\text{two outcomes, independent, same } p, \text{ until the first success}

All the geometric conditions hold.

Answer: yes, geometric with p = 0.5

5.

n = 10 \text{ is fixed}

X counts successes in a fixed number of trials.

Answer: no; it is binomial

6.

0.5^3 \cdot 0.5

Three tails, then a head.

= 0.0625

Multiply.

Answer: 0.0625, or 1/16

7.

\mu = \dfrac{1}{0.1} = 10

Mean = 1/p.

P(X \gt 10) = 0.9^{10} \approx 0.3487

The first 10 boxes have no prize.

Answer: 10 boxes on average; about 0.3487

8.

1 - 0.9^3

Complement of 3 boxes with no prize.

= 1 - 0.729

Cube.

= 0.271

Subtract.

Answer: 0.271

9.

0.3 \cdot 0.7

One miss, then a make.

= 0.21

Multiply.

Answer: 0.21

10.

\mu = \dfrac{1}{0.05} = 20

Mean = 1/p.

\sigma = \dfrac{\sqrt{0.95}}{0.05} \approx 19.49

Standard deviation.

Answer: mean 20 tickets, standard deviation about 19.49

Geometric distribution FAQ

What is the difference between geometric and binomial distributions?

A binomial variable counts successes in a fixed number of trials. A geometric variable counts the trials until the first success, so it has no fixed number of trials.

What is the mean of a geometric distribution?

The mean is 1/p. If the chance of success is 1/6 on each trial, you need 6 trials on average.

What is the difference between geometpdf and geometcdf?

geometpdf(p, k) gives the probability that the first success is on trial k. geometcdf(p, k) gives the probability that it happens on trial k or sooner.

What is the most likely value of a geometric random variable?

It is always 1. Each later value is less likely than the one before, because one more failure has to happen first.

Summary

  • A geometric random variable counts the trials until the first success, with independent trials and the same p.
  • P(X = k) = (1 - p)^{k - 1} p.
  • P(X \gt k) = (1 - p)^k and P(X \le k) = 1 - (1 - p)^k.
  • Mean 1/p; standard deviation \sqrt{1 - p}/p.
  • The distribution is always skewed right, with its tallest bar at 1.

Previous lesson: Binomial Distribution

Next lesson: Density Curves

Back to the Statistics Index