Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python program When should John leave for airport?John has a flight to catch at 9 am. He wants to minimize the waiting time at the

image text in transcribed

python program

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 =25,=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 timex.

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. 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

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

=+ Explain support groups and other resources for training.

Answered: 1 week ago