Question
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
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 timeStep 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