Suppose a certain program runs successfully with probability 0.80 when executed. Let $X$ be the number of executions required for a successful run.

a. Identify distribution to model $X$.
b. What is the probability that at least two attempts are required?
c. What is the probability that at most two attempts are required?

Solution

Let $X$ denote the number of executions required for a successful run. The random variable take the values $X=1,2,3,\cdots$.

The probability of successful run of a program when executed is $p=0.80$.

(a) The probability distribution of the random variable $X$ is a geometric distribution.

The probability mass function of random variable $X$ is
$$ \begin{aligned} P(X=x) =\left\{ \begin{array}{ll} (0.8)*(1-0.8)^{x-1}, & \hbox{$x=1,2,\ldots$} \\ 0, & \hbox{Otherwise.} \end{array} \right. \end{aligned} $$

(b) The probability that at least two attempts are required is

$$ \begin{aligned} P(X\geq 2) &= 1- P(X<2)\\ &= P(X=1)\\ &=(0.8)*(1-0.8)^{1-1}\\ &= 0.8 \end{aligned} $$

(c) The probability that at most two attempts are required is

$$ \begin{aligned} P(X\leq 2) &= P(X=1) + P(X=2)\\ &=0.8*(1-0.8)^{1-1}+0.8*(1-0.8)^{2-1}\\ &= 0.8 + 0.16\\ &= 0.96 \end{aligned} $$

Further Reading