This is a real-life puzzle encountered by one of my friends.
I want to arrive early to my class today. Exactly every $7$ minutes, there is a bus that arrives at the station near my dorm and will bring me to my school. In addition, I also want to fully refill my bottle with a dispenser's mineral water. There are two dispensers: one in my dorm and another one at the bus station near my school. It takes $3$ minutes to fully refill my bottle from either dispenser.
Assuming I can't tell when the bus arrives unless I'm already at the station and seeing it arrives (a.k.a. not by some kind of schedule/timetable), what is the best strategy for me to arrive early to my class?
- Refill my bottle first, then try to take the bus;
- Try to take the bus, then refill my bottle later; or
- Refill some first, try to take the bus, then refill again later?
The best strategy means the earliest expected time to be in the class.
Note: You may assume the time taken for walking from dorm to dorm's dispenser, dorm's dispenser to the bus station, the bus trip, walking from bus to school's dispenser, and school's dispenser to class are all constants for every strategy. They are all also assumed to be in one line.
Bonus: What if the time taken to refill for both dispensers are different? What if the bus arrives every $2$, $3$, $120$, or $N$ minutes?