For this second project you will use a random simulation to

For this second project, you will use a random simulation to approximate the average maximum wait time for customers standing in line. Imagine you are standing in line at the DMV, or waiting to get checked at the doctor\'s office, or you want to use the depart ment\'s sole printer-copier only to find five other people who also want to use it and who got there before you. You have to wait for everyone in line in front of you to finish before its your turn. Sometimes a single person (or customer\") takes a long time before they\'re done, adding to the wait time for everyone behind them. QUESTION: what is the maximum wait time that can be \"expected\" (statistically speaking) in such a situation? The \"true\" answer involves advanced statistics, and it may be way too complex to write down due to the convoluted dependencies on each customer wait time with all preceding customers\' wait times, the assumptions made about the random time each person takes when its their \"turn\", and the more general fact that very nice to compute the expected maximum of multiple (possibly different and dependent random variables However, i we use Python to get a brute force answer, its not nearly as hard! You should use the random module for this project. Allow the user to input the number of business hours H per day, as well as the number of customers C per day, and the number of days D to simulate. Fo assume the customers come at a uniform random time during the business hours (you each simulated day can use random. uniform Ca,b) to get a uniform random number from a to b). Note that the random time should be a decimal (not an integer), allowing for precise calculations. Next, we need to know how long each customer is \"served\" when it is their turn. For this project, let\'s assu he each customer is served a number of minutes equal to a uniform random number from 5 to 15 (so, use random.uniform(5,15) for this part). Finally, you need to somehow simulate the wait times. Remember: the idea is that the first customer to arrive is served immediately, and takes 5-15 minutes to finish. If the second customer arrives before the first customer finishes, the second customer has to wait. Then the second customer is served and takes 5-15 minutes to finish. Again, any subsequent customer to arrive before a previous customer finished has to wait. Continue this until the last customer to arrive is served, calculating the wait times m wait time for that day. Repeat the for each customer. Find the maxim rocess to get a max lum wait time for all the days you were asked to simulate, and find the average of the maximum wait times Welcome to my average maximum customer wait time calculator Please give the number of business hours in a day: 6 Please give the number of customers in a da 30 Please give the number of days to simulate 100 e average maximum customer wait time s 41.0748685583049 minutes

Solution

The Basic Code for random() function In python :

>>> random() # Random float: 0.0 <= x < 1.0

Simulation Example:

above two are the basic examples in the python language u are studay and understand the code..

 For this second project, you will use a random simulation to approximate the average maximum wait time for customers standing in line. Imagine you are standing

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site