In: Statistics and Probability
A one-pump gas station is always open and has two types of customers. A police car arrives every 30 minutes (exactly), with the first police car arriving at time 15 minutes. Regular (nonpolice) cars have exponential interarrival times with mean 5.6 minutes, with the first regular car arriving at time 0. Service times at the pump for all cars are exponential with mean 4.8 minutes. A car arriving to find the pump idle goes right into service, and regular cars arriving to find the pump busy join the end of a single queue. A police car arriving to find the pump busy, however, goes to the front of the line, ahead of any regular cars in line. [If there are already other police cars at the front of the line, assume that an arriving police car gets in line ahead of them as well.] Simulate this system to calculate the expected average number of cars (of either type) in queue, and the expected utilization of the pump.
Here it is mentioned that service times at the pump for all cars are exponential with mean 4.8 minutes. From here, it is clear that on an average the pump takes 4.8 minutes to serve a car. In that case, the average utilization of the pump in a minute is (1/4.8) = 0.20833
Here the mean inter-arrival time for a regular car is 5.6 minutes and it follows an exponential distribution.
So the arrival rate of a regular car will follow a Poisson distribution with mean (1/5.6) = 0.17857
Now to check if the arrival rate will follow Poison distribution or not, we can test it by simulation. we need to generate a sample from Poisson(mean=0.17856) distribution and calculate the difference of each value from its previous value. Then we need to plot the differences with a histogram and check that the density curve is exponential or not. we can calculate the mean of the differences and check that it is near to 5.6 or not.
Now the expected arrival rate for a regular car is 0.17857 per minute ie, in a minute the expected number of the regular car arriving in the pump station is 0.17857.
A police car comes every 30 minutes. So, (1/30=0.03333) police cars come per minute.
In one minute the pump can serve 0.20833 cars on an average.
So the expected number of cars in queue per minute is (0.17857+0.03333-0.20833) = 0.00357.