Probability & Statistics Ch.2 Section 3 Question 20
Solutions for “Probability and Statistics: The Science of Uncertainty” (Second Edition). These are solutions I have come up with; I offer no guarantee of accuracy.
Question
Suppose that there is a loop in a computer program and that the test to exit the loop depends on the value of a random variable X. The program exits the loop whenever , and this occurs with probability 1/3. If the loop is executed at least once, what is the probability that the loop is executed five times before exiting?
Solution
Since we are calculating the number of failures before the first success and all trials are independent, we use the Geometric distribution.
From Example 2.3.4 in the textbook:
Where:
- θ = probability of success (exiting) = 1/3
- x = number of failed events (loop iterations) before success
We want 4 failures before a success (5 total executions, with the 5th causing the exit):