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.   (1) Use simulation to generate 10000 service times and estimate the mean service time for yourself. (2) Summarize your data with R code hist(x, probability = TRUE) and mean(x), where x is an array representing your simulated data. Add to the histogram two vertical lines indicating the simulated mean and the theoretical mean. A histogram can be made based on frequencies. A density histogram can also be made. To get a density histogram, the height of each bar is divided by the total number of values, and then by the length of the bar. Such a histogram has a vertical scale comparable with the probability density function of the distribution from which data are randomly drawn. (3) Add the curve of the probability density function (which is a mixture of two exponential pdfs) of the service time to the density histogram you got in question (2). For a mixture of two exponential distributions

A First Course in Probability (10th Edition)
10th Edition
ISBN:9780134753119
Author:Sheldon Ross
Publisher:Sheldon Ross
Chapter1: Combinatorial Analysis
Section: Chapter Questions
Problem 1.1P: a. How many different 7-place license plates are possible if the first 2 places are for letters and...
icon
Related questions
Question

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.

 

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

(2) Summarize your data with R code hist(x, probability = TRUE) and mean(x), where x is an array representing your simulated data. Add to the histogram two vertical lines indicating the simulated mean and the theoretical mean. A histogram can be made based on frequencies. A density histogram can also be made. To get a density histogram, the height of each bar is divided by the total number of values, and then by the length of the bar. Such a histogram has a vertical scale comparable with the probability density function of the distribution from which data are randomly drawn.

(3) Add the curve of the probability density function (which is a mixture of two exponential pdfs) of the service time to the density histogram you got in question (2). For a mixture of two exponential distributions

Hints:

  1. You should generate say 10000 values, some from the quicker one and some from the slower one depending on the chance.
  2. The density histogram should look like the theoretical distribution of the service time random variable.
  3. 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.
  4. To add lines and a legend to an existing graph, do something like

x <- rexp(100, rate = .5)

hist(x, main = "Mean and Median of a Skewed Distribution")

abline(v = mean(x), col = 2, lty = 2, lwd = 2) # Add a vertical line at the simulated mean

abline(v = median(x), col = 3, lty = 3, lwd = 2) # Add a vertical line at the simulated median

legend(4.1, 30, c("Simulated Mean", "Simulated Median"), col = 2:3, text.col = 2:3, lty = 2:3, lwd = 2, bty = "n") # Add a legend at location (4.1, 30)

Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A First Course in Probability (10th Edition)
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON
A First Course in Probability
A First Course in Probability
Probability
ISBN:
9780321794772
Author:
Sheldon Ross
Publisher:
PEARSON