Answered step by step
Verified Expert Solution
Link Copied!

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 runif(n) 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(1).
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, mechanic1 for checkups and 2 forrepairs. Scooters that need a checkup go to mechanic 1 and queue waiting for a checkup. Scooters that break down go to mechanic 2 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 1 for a checkup, mechanic 2 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.
1 The first time Foodys is under-resourced:
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 1 takes to do a checkup follows an exponential distribution with rate 1 per day, and mechanic 2 repair times also follow an exponential distribution with rate 2 per day. Let T be the first time that Foodys works with less than n scooters.We want to estimate E[T].
(i)Using N=20, n=10, c=2,=0.25,1=1.5, and 2=2, build a simulation model to estimate E[T]. 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 E[T] using K=500 iterations.
(ii)Find an estimate of E[T] where we are 95% confident that it is within 0.3 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?
(iii)Give an interval centered around the estimate given in (ii) above where we are 90% confident that the true value of E[T] is within this interval. Show analytically that indeed this is a 90% interval.
(iv)Foodys wants to increase T by making the checkup/repair 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.
2 Reduce the variance of the estimator:
Foodys was happy with the estimator that you gave in part 1(i)-(ii) for E[T] 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).
3 Correct the distribution of the mechanics:
Foodys informs you that the distributions for the mechanics are not as given in part 1. For mechanic 1, the density function is f(x)=1/2(1+x)e^x ,0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2021 Workshops Biokdd Iwcfs Mlkgraphs Al Cares Protime Alsys 2021 Virtual Event September 27 30 2021 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Anna Fensel ,Jorge Martinez-Gil ,Lukas Fischer

1st Edition

3030871002, 978-3030871000

More Books

Students also viewed these Databases questions

Question

1-4 How will MIS help my career?

Answered: 1 week ago