Math Core

Lesson 4.9 · Probability, Random Variables and Distributions

The geometric distribution

The binomial distribution counts successes in a fixed number of trials. A different question is just as natural: how many trials will it take to get the first success? How many boxes of cereal until you find the prize, how many calls until someone answers, how many rolls until a six? That waiting time has a geometric distribution.

The geometric setting

Definition

Geometric setting

A geometric setting arises when you perform independent trials, each with two outcomes (success or failure) and the same probability of success pp, and you keep going until the first success.

The number of trials XX needed to get the first success is a geometric random variable with parameter pp. Its possible values are 1,2,3,…1, 2, 3, \dots with no upper limit.

Compare it with the binomial setting. The conditions are the same except one: a binomial setting has a fixed number of trials, while a geometric setting has a fixed number of successes (one) and a random number of trials.

Geometric probabilities

For the first success to happen on trial kk, the first k−1k - 1 trials must all be failures and trial kk must be a success. Because trials are independent, multiply:

Geometric probability

If XX is geometric with success probability pp, then for k=1,2,3,…k = 1, 2, 3, \dots

P(X=k)=(1−p)k−1p.P(X = k) = (1 - p)^{k-1} p.

Also, the first success takes more than kk trials exactly when the first kk trials are all failures:

P(X>k)=(1−p)k,P(X≤k)=1−(1−p)k.P(X > k) = (1 - p)^k, \qquad P(X \le k) = 1 - (1 - p)^k.

On a TI-84, P(X=k)P(X = k) is geometpdf(p, k) and P(X≤k)P(X \le k) is geometcdf(p, k).

Worked example: Finding the prize

One in four boxes of a cereal contains a toy, independently from box to box. Let XX = the number of boxes you open to find the first toy. Find P(X=3)P(X = 3).

Solution. XX is geometric with p=0.25p = 0.25. You need two boxes without a toy, then a box with one:

P(X=3)=(0.75)2(0.25)=0.140625≈0.1406.P(X = 3) = (0.75)^2(0.25) = 0.140625 \approx 0.1406.

Worked example: More than four boxes

For the same cereal, find the probability that it takes more than 4 boxes to find the first toy, and the probability that it takes at most 4.

Solution. It takes more than 4 boxes exactly when the first 4 boxes have no toy:

P(X>4)=(0.75)4≈0.3164,P(X≤4)=1−0.3164=0.6836.P(X > 4) = (0.75)^4 \approx 0.3164, \qquad P(X \le 4) = 1 - 0.3164 = 0.6836.

Shape, mean and standard deviation

The largest probability is always at X=1X = 1, and each probability after that is (1−p)(1 - p) times the one before, so the distribution is strongly skewed right. Here is the distribution for p=0.25p = 0.25 out to X=7X = 7 (the probabilities continue forever, getting smaller).

Geometric distribution with p = 0.25. Each bar is 0.75 times the bar before it.

Mean and standard deviation of a geometric random variable

μX=1p,σX=1−pp.\mu_X = \dfrac{1}{p}, \qquad \sigma_X = \dfrac{\sqrt{1 - p}}{p}.

The mean makes intuitive sense: if a toy is in 1 of every 4 boxes, you'd expect to open about 4 boxes on average to find one.

Worked example: Mean and standard deviation for the cereal

Find and interpret the mean of XX for the cereal with p=0.25p = 0.25, and find the standard deviation.

Solution.

μX=10.25=4,σX=0.750.25≈3.46.\mu_X = \dfrac{1}{0.25} = 4, \qquad \sigma_X = \dfrac{\sqrt{0.75}}{0.25} \approx 3.46.

If many people each opened boxes until finding a toy, they would need 4 boxes on average. The number of boxes needed typically varies from 4 by about 3.46 boxes, a large spread due to the long right tail.

Common mistake

Don't mix up P(X>k)P(X > k) and P(X≥k)P(X \ge k). "The first success takes at least 5 trials" means the first 4 trials fail, so P(X≥5)=(1−p)4P(X \ge 5) = (1 - p)^4. Also make sure the question counts trials, not failures before the first success; on the AP exam, XX counts trials, starting at 1.

Tip

Deciding between binomial and geometric? Ask: "Is the number of trials fixed?" If yes, binomial. If you keep going until a success, geometric.

Practice

Practice 1

A basketball player makes 20%20\% of her half-court shots, independently. Let XX = the number of shots she takes until she makes her first one. Find P(X=4)P(X = 4). Round to 4 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

For the player in the previous problem, find the probability that she makes her first half-court shot within her first 3 attempts.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

For the same player, what is the expected number of attempts needed to make her first half-court shot?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

For the same player, find the standard deviation of the number of attempts needed. Round to 2 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Which situation is best modeled by a geometric distribution?

Practice 6

About 15%15\% of people who enter a store make a purchase, independently of one another. Let XX = the number of people who enter, up to and including the first person who buys something. Find P(X>5)P(X > 5), the probability that none of the first 5 people makes a purchase. Round to 4 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

A game is won with probability 0.30.3 each time it's played, independently. Let XX = the number of plays needed to get the first win. Find P(3≤X≤5)P(3 \le X \le 5). Round to 4 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.