We now give a couple of examples involving geometric random variables.

Example

If a fair six-sided die is rolled repeatedly, what is the probability that it will take between 6 and 8 rolls (inclusive) to get the first "six"?

The number of rolls to get the first six has a geometric distribution with probability of "success" being \(\frac 1 6\).

\[ X \;\; \sim \; \; \GeomDistn\left(\pi = \frac 1 6\right) \]

Since its probability function is

\[ p(x) = \frac 1 6 \left(\frac 5 6\right)^{x-1} \qquad \text{for } x = 1, 2, \dots \]

Therefore

\[ P(6 \le X \le 8) = p(6) + p(7) + p(8) = \frac 1 6 \left(\frac 5 6\right)^5 + \frac 1 6 \left(\frac 5 6\right)^6 + \frac 1 6 \left(\frac 5 6\right)^7 = 0.1693 \]

Adding probabilities like this works provided there are not too many of them. However an alternative way to find probabilities is to use the cumulative distribution function.

Example

If a fair six-sided die is rolled repeatedly, what is the probability that it will take between 10 and 20 rolls (inclusive) to get the first "six"?

\[ P(10 \le X \le 20) = p(10) + p(11) + p(12) + \dots + p(18) + p(19) + p(20) \]

but this requires adding 11 probabilities. Instead, we can note that the event involves all values of \(X\) that are less than or equal to 20, but not less than or equal to 9, so

\[ \begin{align} P(10 \le X \le 20) & = P(X \le 20) - P(X \le 9) \\ & = \left( 1 - \left(\frac 5 6 \right)^{20} \right) - \left( 1 - \left(\frac 5 6 \right)^9 \right) \\ & = \left(\frac 5 6 \right)^9 - \left(\frac 5 6 \right)^{20} \\[0.5em] & = 0.1677 \end{align} \]