The Geometric Random Variable

GEOMET.83p
GEOMET.86p
geomet.89p

Suppose you have probability p of succeeding on any one try. If you make independent attempts over and over, then the geometric random variable, denoted by X ~ geo(p), counts the number of attempts needed to obtain the first success.

We often let q = 1 - p be the probability of failure on any one attempt. Then the probability of having the first success on the kth attempt, for k >= 1, is given by

P(X = k) = q^(k - 1) * p

(from k-1 failures followed by a success).

The average (or mean) number of attempts needed to succeed is given by E[X] = 1 / p.

The variance of the number of attempts needed is given by Var(X) = (1 - p) / p^2.

The most likely number of attempts needed, or mode, is given by the integer k such that P(X = k) is maximized. In this case, it will always be k = 1. Thus, if you are going to succeed, then you are most likely to succeed on the first try.


The cumulative distribution function (or cdf) is given by P(X <= k) = 1 - q^k. This function can be interpreted as the probability of succeeding within k attempts.

We can use the cdf for computing probabilities such as P(j <= X <= k), which is the probability that it will take from j attempts to k attempts to succeed. This value is given by

P(j <= X <= k)

= P(X <= k) - P(X <= j-1)

= (1 - q^k) - (1 - q^(j-1))

= q^(j-1) - q^k .


Lastly, by solving the equation P(X <= k) >= r, (and rounding up to the nearest integer) we can find the number of attempts needed to have at least probability r of success within this number of attempts. Solving 1 - q^k >= r, we obtain k >= ln(r) / ln(q).



Using the GEOMET Program

The GEOMET program can be used to compute probabilites such as P(j <= X <= k), P(X = k), and P(X <= k). To execute the program, we enter the value of p and the lower and upper bounds of j and k, for 1 <= j <= k. (Enter the same value k for both the lower and upper bound to compute a pdf value P(X = k).) The program also asks if you want a complete distribution to be entered into the STAT Edit screen. If so, then enter 1. If not, then enter 0. The program then displays P(j <= X <= k) along with the average number of attempts needed to succeed and the standard deviation.

If you enter 1, then most of the distribution will be entered into the STAT Edit screen. Under L1, the possible number of attempts 1, . . . , n are listed. Under L2, the pdf values of P(X = k), for 1 <= k <= n, are listed. Under L3, the cdf values P(X <= k), for 1 <= k <= n, are listed. The upper bound n is chosen so that P(X <= n) exceeds 0.975.

Click here for info on the TI-86 and TI-89 Stat Edit displays.



Example. Suppose one die is rolled over and over until a Two is rolled. What is the probability that it takes

(a) from 3 to 6 rolls?
(b) exactly 4 rolls?
(c) at most 5 rolls?
(d) How many rolls are needed so that there is at least 0.95 probability of rolling a Two within this number of rolls?


Solution.After calling up the GEOMET program, enter 1 / 6 for PROBABILITY, enter 3 for LOWER BOUND, and enter 6 for UPPER BOUND. Also enter 1 for a complete distribution.

(a) We find that P(3 <= X <= 6) = 0.359546, and that the average number of rolls needed is 6 with a standard deviation of 5.47723.

(b) and (c) From looking at the complete distribution in the list editor, we see that P(X = 4) = 0.09645 and P(X <= 5) = 0.59812.

(If you did not enter 1 for a complete distibution, then you can execute the program again with 4 for both LOWER BOUND and UPPER BOUND to find P(X = 4), and you can reexecute the program with bounds of 1 and 5 to find P(X <= 5).

(d) The number of rolls needed must satisfy k >= ln(.05) / ln(5/6) = 16.431; thus 17 rolls are needed to have a 95% chance of rolling a Two.



Exercises

1. If two dice are rolled until a Double Six is rolled, what is the probability that it will take (a) at most 24 rolls (b) at least 10 rolls?

2. When dealing 5 cards from a shuffled deck, the probability of dealing a hand with exactly one pair is about 0.42257. If you want the probability of dealing a pair within n independent tries to be at least 0.99, then how many deals n should be made?



Solutions

1. Here, X ~ geo(1 / 36). Since there must always be at least one attempt, we first wish to find P(1 <= X <= 24). (a) In the GEOMET program, enter 1 / 36 for PROBABILITY, enter 1 for LOWER BOUND, and enter 24 for UPPER BOUND. We see that P(1 <= X <= 24) = 0.4914. Alternately, P(X <= 24) = 1 - (35/36)^24.

(b) P(X >= 10) = 1 - P(1<= X <= 9) = 1 - (1 - (35/36)^9) = (35/36)^9 = 0.77605 .


2. Here X ~ geo(0.42257), and we wish to find k so that P(X <= k) >= 0.99. Thus, we must solve for k in the inequality 1 - q^k >= 0.99. We obtain, k >= ln(0.01) / ln(q) = ln(.01) / ln(.57743) = 8.3857. Thus, k = 9 deals are needed.



Return to Table of Contents.