In: Statistics and Probability
A gas station has a 7% chance of running out of gas. What is the probability the gas station will run out of gas one day in the next week? What is the probability the gas station will run out of gas at least two days in the next week? What is the expected number of times the gas station will run out of gas?
answer)
We can solve this by the formula of binomial distribution
P(r) = ncr*(p^r)*(1-p)^n-r
Given p = 0.07 (7%)
Ncr = n!/(r!*(n-r)!)
Where n!= n*n-1*n-2.....till 1
Special case : 0! = 1
in this case,
n = 7 (as there are 7 days in a week)
the probability the gas station will run out of gas one day in the next week
p(1) = 7c1*(0.07^1)*(1-0.07)^7-1 = 0.31702518989
probability the gas station will run out of gas at least two days in the next week
we know that sum of all the probabilities is equal to 1
therefore p(0) + p(1) + p(2) + ...... + p(7) = 1
now we need to find p of atleast 2 that is p(2) + p(3) + .....
p(2) + p(3) + .... + p(7) = 1 - (p(0)+p(1))
p(1) = 0.31702518989
p(0) = 7c0*(0.07^0)*(1-0.07)^7-0 = 0.60170087061
p(atleast 2) = 1 - (0.60170087061 + 0.31702518989)
P(atleast 2) = 0.0812739395
expected number of times the gas station will run out of gas
expected number = number of trials * probability of single trial = 7*0.07 = 0.49