Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WRTIE R CODES AND ANSWER THE QUESTIONS Generate random variables only use the function runif ( n ) for n a positive integer. If you
WRTIE R CODES AND ANSWER THE QUESTIONS
Generate random variables only use the function runifn for n a positive integer. If you use any other function to generate random variables you will be penalised. Start every R script with the command set.seed
Description:
Foodys is a food delivery company that uses a fleet of scooters for delivery take away. For safety, each scooter has to go through a checkup after it has worked for c consecutive days. Further, scooters are subject to breakdowns: the time a scooter is in service before breaking down follows an exponential distribution with rate per day. The company hires two mechanics, mechanic for checkups and forrepairs. Scooters that need a checkup go to mechanic and queue waiting for a checkup. Scooters that break down go to mechanic and queue Waiting for repair.
Suppose Foodys owns N scooters out of which n are working during Foodys working hours and the rest N n are either at mechanic for a checkup, mechanic for repair, or in Foodys parking lot waiting to be used. When a scooter goes for a checkup or breaks down, it is replaced with one of the scooters in the parking lot. The first n working scooters are not subject to a checkup until they have had their first breakdown, but scooters in the parking lot are assigned a checkup time the minute they start working.
The first time Foodys is underresourced:
Foodys is concerned about having more than Nn scooters at the mechanics and thus having to work with less than n scooters. Suppose they start with n scooters working and Nn at the parking lot ready to be used when needed. Assume that the time mechanic takes to do a checkup follows an exponential distribution with rate per day, and mechanic repair times also follow an exponential distribution with rate per day. Let T be the first time that Foodys works with less than n scooters.We want to estimate ET
iUsing N n c and build a simulation model to estimate ET When you build your simulation model define your variables, events, event lists, output variables. Write down the pseudocode of each event case as we did in lecture. Implement your model by writing an R script to estimate ET using K iterations.
iiFind an estimate of ET where we are confident that it is within days of its true value. Give the sample standard deviation of your estimator. How many iterations did you have to run to get this value?
iiiGive an interval centered around the estimate given in ii above where we are confident that the true value of ET is within this interval. Show analytically that indeed this is a interval.
ivFoodys wants to increase T by making the checkuprepair process more efficient. Without hiring extra mechanics, what advice can you give them? Explain why your advice would work better without performing any simulations to verify this.
Reduce the variance of the estimator:
Foodys was happy with the estimator that you gave in part iii for ET but they would like to improve its variance. Write a paragraph proposing a variance reduction estimator based on control variates no more than one and explain why it would reduce the variance. Justify your choice of control variate. NO simulations
Correct the distribution of the mechanics:
Foodys informs you that the distributions for the mechanics are not as given in part For mechanic the density function is fxxex
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started