Question

In: Statistics and Probability

Two mechanics are changing oil filters for the arriving customers. The service time has an Exponential...

Two mechanics are changing oil filters for the arriving customers. The service time has an Exponential distribution with mean 12 minutes for the first mechanic, and mean 3 minutes for the second mechanic. When you arrive to have your oil filter changed, your probability of being served by the faster mechanic is 0.8.

(a) Use simulation to generate 10000 service times and estimate the mean service time for you.

(b) Summarize your data with hist(x, probability = TRUE) and mean(x), where x is your simulated data. Add two vertical lines indicating the simulated mean and the theoretical mean.

(c) Comment on your findings.

Hint: You should generate say 10000 values some from the quicker one and some from the slower one depending on the chance. The histogram should look like the theoretical distribution of the service time random variable. A discussion can be made about the comparison between the simulated and the theoretical results. The theoretical mean can be calculated by weighting the two mean times with weights being the probabilities. If you want, ask me about a derivation of the theoretical mean.

Solutions

Expert Solution

set.seed(7657)
N <- 10000
X <- array(dim=N)
for(i in 1:N)
{
  u <- runif(1)
  if(u<0.8)
  {
    X[i] <- rexp(1,rate=1/3)
  }
  else
  {
    X[i] <- rexp(1,rate=1/12)
  }
}
M <- mean(X)


TH_mean <-((3*0.8)+(0.2*12))   

hist (X,probability=TRUE, col= "orange")
abline(v=TH_mean,col = 'blue',lwd =4)   
abline (v=M, col = 'red', lwd =2) 

HISTOGRAM OF X

The theoritical mean is 4.8 minutes whereas the simulated mean is found to be 4.816.

The theoritical mean is shown by blue colour vertical line and simulated mean is shown by a red colour line in the Histogram.

N = 10000
x = NULL
for (i in 1:N)
{
  u = runif(1)
  if(u<0.8)
  {
    x[i] = rexp(1,rate = 1/3)
  }
  else
  {
    x[i] = rexp(1,rate = 1/12)
  }
}
SM<-mean(x)


TH_mean <-((3*0.8)+(0.2*12))   

hist(x, probability = TRUE, ylim = c(0,0.3), breaks = 25)
abline(v=TH_mean,col = 'blue',lwd =4)   
abline (v=SM, col = 'black', lwd =2) 

Both theoritical and simulated mean are very close as evident from the Histogram.

Hence both mean were successfully estimated.


Related Solutions

The number of customers arriving per hour at a certain automobile service facility is assumed to...
The number of customers arriving per hour at a certain automobile service facility is assumed to follow a Poisson distribution with mean λ=5. a) Compute the probability that more than 11 customers will arrive in a 2​-hour period. b) What is the mean number of arrivals during a 2​-hour ​period?
The number of customers arriving per hour at a certain automobile service facility is assumed to...
The number of customers arriving per hour at a certain automobile service facility is assumed to follow a Poisson distribution with mean λ=9. ​(a) Compute the probability that more than 16 customers will arrive in a 2-hour period.​ (b) What is the mean number of arrivals during a 2-hour period? ​(a) The probability that more than 16 customers will arrive is ​(Round to four decimal places as​ needed.) ​(b) The mean number of arrivals is ​(Type an integer or a...
A queuing system with a Poisson arrival rate and exponential service time has a single queue,...
A queuing system with a Poisson arrival rate and exponential service time has a single queue, two servers, an average arrival rate of 60 customers per hour, and an average service time of 1.5 minutes per customer. Answer the following questions. Show ALL formulas and calculations used in your response. The manager is thinking of implementing additional queues to avoid an overloaded system. What is the minimum number of additional queues required? Explain. How many additional servers are required to...
A queuing system with a Poisson arrival rate and exponential service time has a single queue,...
A queuing system with a Poisson arrival rate and exponential service time has a single queue, two servers, an average arrival rate of 60 customers per hour, and an average service time of 1.5 minutes per customer. The manager is thinking of implementing additional queues to avoid an overloaded system. What is the minimum number of additional queues required? Explain. How many additional servers are required to ensure the utilization is less than or equal to 50%? Explain. If the...
Major airlines compete for customers by advertising on-time arrival. A random sample of flights arriving at...
Major airlines compete for customers by advertising on-time arrival. A random sample of flights arriving at Toronto Pearson International Airport was obtained and the actual arrival time was compared to the scheduled arrival time. The difference (in minutes) is given in the table (a negative number indicates that the flight arrived before the scheduled arrival time). 3 -16 -1 -24 -30 23 -15 1 -2 -41 53 -26 -26 24 53 49 -13 -18 -14 17 1 8 52 -8...
Fast Auto Service provides oil and lube service to cars. The time required to service a...
Fast Auto Service provides oil and lube service to cars. The time required to service a car is normally distributed. The mean amount of time to service a car is 30.0 minutes and a The standard deviation in the amount of time to service a car is 5.5 minutes. a. Determine the probability that a random car can be serviced in less than 20 minutes. b. If it takes longer than 45 minutes to service a car, the driver receives...
The time required to service a particular machine is an exponential random variable with mean 10...
The time required to service a particular machine is an exponential random variable with mean 10 minutes. If a repair person has 35 machines to service, compute the approximate probability that all the work can be completed in under 5 hours.
The time required for an automotive center to complete an oil change service on an automobile...
The time required for an automotive center to complete an oil change service on an automobile approximately follows a normal? distribution, with a mean of 15 minutes and a standard deviation of 4 minutes. ?(a) The automotive center guarantees customers that the service will take no longer than 20 minutes. If it does take? longer, the customer will receive the service for? half-price. What percent of customers receive the service for? half-price? ?(b) If the automotive center does not want...
The time required for an automotive center to complete an oil change service on an automobile...
The time required for an automotive center to complete an oil change service on an automobile approximately follows a normal​ distribution, with a mean of 19 minutes and a standard deviation of 3 minutes. ​(a) The automotive center guarantees customers that the service will take no longer than 20 minutes. If it does take​ longer, the customer will receive the service for​ half-price. What percent of customers receive the service for​ half-price? ​(b) If the automotive center does not want...
The time required for an automotive center to complete an oil change service on an automobile...
The time required for an automotive center to complete an oil change service on an automobile approximately follows a normal​ distribution, with a mean of 17 minutes and a standard deviation of 2.5 minutes. ​(a) The automotive center guarantees customers that the service will take no longer than 20 minutes. If it does take​ longer, the customer will receive the service for​ half-price. What percent of customers receive the service for​ half-price? ​(b) If the automotive center does not want...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT