Question: Python program Show code Task 3 When should John leave for airport? John has a flight to catch at 9 am. He wants to minimize

 Python program Show code Task 3 When should John leave for

Python program

Show code

Task 3 When should John leave for airport? John has a flight to catch at 9 am. He wants to minimize the waiting time at the airport. The travel time between his home and the airport follows a normal distribution with u=25, o=5. If he is late for the flight, i.e., his arrival time at the airport is after 9 am, he will be rebooked to the next available flight at 11 am. In this case, he has to wait until 11 am. So please write Python codes to help him determine the optimal departure time x. Hint: To solve this problem, you can first create a function that returns the expected waiting time. Note that there are two possibilities: missing the flight or catching the flight. Then, you can evaluate each possible departure time between 8 am and 9 am by calling the above function. You can then get the relation between the expected waiting time and department time, based on which you can find the best departure time. Task 3 When should John leave for airport? John has a flight to catch at 9 am. He wants to minimize the waiting time at the airport. The travel time between his home and the airport follows a normal distribution with u=25, o=5. If he is late for the flight, i.e., his arrival time at the airport is after 9 am, he will be rebooked to the next available flight at 11 am. In this case, he has to wait until 11 am. So please write Python codes to help him determine the optimal departure time x. Hint: To solve this problem, you can first create a function that returns the expected waiting time. Note that there are two possibilities: missing the flight or catching the flight. Then, you can evaluate each possible departure time between 8 am and 9 am by calling the above function. You can then get the relation between the expected waiting time and department time, based on which you can find the best departure time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!