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.
Use simulation to generate 10000 service times and estimate the
mean service time for you.
Using R code
Let the service time for first mechanic be and the service time for first mechanic be .
Then
The resulting service time is with probability 0.8 and with probability 0.2.
The R code for simulating 10,000 resultant service times and finding the mean is given below.
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)
}
}
mean(X)
The mean service time is
Get Answers For Free
Most questions answered within 1 hours.