Suppose a bus is running on a loop route. It takes 10 mins for the bus to finish the route. If a guy arrives at a bus stop at uniformly random time. What is the expected bus waiting time?
Sol: image uniformly put a point at a line with length 10, so the expected waiting time is 5.
Now suppose there is a ice cream shop at the bus loop. Whenever the bus is close to the ice cream shop, the driver will flip a coin and decide whether to go eating an ice cream or not. It takes 10 mins for the driver to eat the ice cream. What is the expected bus waiting time if a guy arrives at a bus stop uniformly.
Sol: the key is to consider what uniform arriving time means. The bus is running either on a 10minloop or a 20minloop, each with probability 1/2. The bus keeps running, and the guy can arrive at any time between 0am  24pm, uniformly. The time for the bus to be in a 20minloop is two times larger than the time for a 10minloop. So each day 2/3 of the time the bus is in a 20minloop, and 1/3 of the time the bus is in a 10minloop.
Thus, the probability for the guy to arrive when the bus is in a 20minloop is 2/3. Expected waiting time is 10 for the 20minloop and 5 for the 10minloop. So the combined expected waiting time is
2/3 * 10 + 1/3 * 5
Subscribe to:
Post Comments (Atom)
Manacher's Longest Palindromic Substring Algorithm
http://manacherviz.s3websiteuseast1.amazonaws.com/#/

Given n nonnegative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap aft...

If I decided to invest in energy and natural resources, I will prefer Russian ETFs. Once oil prices go up, Russian stocks will go up as we...

http://manacherviz.s3websiteuseast1.amazonaws.com/#/
No comments:
Post a Comment