Geometric distribution#
1. Theory#
The geometric distribution is a discrete probability distribution where the random variable ( x ) indicates the number of Bernoulli trials required to get the first success (or failure). It is based on the following three assumptions:
The trials being conducted are independent.
There can only be two outcomes of each trial - success or failure.
The success probability, denoted by p, is the same for each trial.
The probability mass function of the geometric distribution is given by
\(p_{X}(x)=P(X=x)= p(1-p)^{x-1} \quad x=1,2,...\)
2. Water treatment plant failure assessment#
Suppose that it is known that the probability that the flocculator of a water treatment plant experiences a power failure in a given week is 15%. The manager of the water treatment plant would like to know:
The probability that the flocculator will experience the first failure in exactly 4 weeks
The probability that the flocculator will experience the first failure in 4 weeks or less
The probability that the flocculator will experience the first failure in 4 weeks or more
1. What is the probability that the flocculator will experience the first failure in exactly 4 weeks?
The probability of the flocculator experiencing a power failure in a given week is 15%, which means that \(p = 0.15\).
We’re asked to solve the first failure in exactly 4 weeks. Therefore, \(x = 4\)
\( P(X=4) = 0.15(1-0.15)^{4-1}=0.092\)
Hence, the probability that the flocculator will experience the first failure in exactly 4 weeks is 9.2%
To answer this question we can use the following Python script:
p = 0.15
x = 4
probability = p*(1-p)**(x-1)
#display the result rounded to three decimal places
print(f'The probability is {probability:.3f}')
The probability is 0.092
2. What is the probability that the flocculator will experience the first failure will occur in 4 weeks or sooner?
We already know that \(p = 0.15\).
The probability that the first failure will occur in week 4 or sooner means that we need to solve \( P(X \leq 4) \). Therefore:
\(P(X \leq 4) =\sum_{x=1}^{4}P(X=x)\)
\(\begin{aligned} P(X \leq 4) & = P(X=1)+P(X=2)+P(X=3)+P(X=4) \\& = 0.15(1-0.15)^{1-1} + 0.15(1-0.15)^{2-1} \\ & \quad+ 0.15(1-0.15)^{3-1} + 0.15(1-0.15)^{4-1} \\ &= 0.478 \end{aligned}\)
Hence, the probability that the flocculator will experience the first failure will occur in 4 weeks or sooner is 47.8%
To answer this question we can use the following Python script:
p = 0.15
x = [1,2,3,4]
probability = sum([p*(1-p)**(week-1) for week in x])
#display the result rounded to three decimal places
print(f'The probability is {probability:.3f}')
The probability is 0.478
3. What is the probability that the flocculator will experience the first failure in 4 weeks or more?
We already know that \(p = 0.15\).
Now we need to solve \(P(X \geq 4)\). Therefore, \( P(X \geq 4) = 1 - P(X \leq 3) = 1- \sum_{x=1}^{3}P(X=x)\)
\(\begin{aligned} P(X \geq 4) & = 1- \left [ P(X=1)+P(X=2)+P(X=3) \right ] \\& = 1- \left [ 0.15(1-0.15)^{1-1} + 0.15(1-0.15)^{2-1} 0.15(1-0.15)^{3-1} \right ] \\ &= 0.614 \end{aligned}\)
Hence, the probability that the flocculator will experience the first failure in 4 weeks or more is 61.4%
To answer this question we can use the following Python script:
p = 0.15
x = [1,2,3]
probability = 1-sum([p*(1-p)**(week-1) for week in x])
#display the result rounded to three decimal places
print(f'The probability is {probability:.3f}')
The probability is 0.614
3. Heavy vehicles#
The Weigh-in-motion (WIM) system is a technology designed to measure vehicle attributes such as gross vehicle weight (GVW) and vehicle length as vehicles drive over a measurement site. Suppose that the probability of measuring a heavy vehicle with a gross vehicle weight over 50 tonnes per month is 12%.
Please answer the following:
The following plots show three probability mass functions, from left to right plot a, plot b and plot c:
Important!
Provide all answers in three decimals places.