Minimum time required to Cross the Bridge
Four people are on one side of the bridge. Everyone must get across.Problem is that it’s dark and so you can’t cross the bridge without a flashlight and they only have one flashlight. Plus, at one time only 2 people can cross the bridge. the bridge is only big enough for two people to cross at once.
The Speed of four people is different as below:
one person is so fast it only takes 1 minute to cross the bridge,
another 2 minutes,
third 5 minutes,
the last it takes 10 minutes to cross the bridge.
When two people cross the bridge together by sharing the flashlight, they both walk at the slower person’s speed. What is the minimum time required for all 4 to cross the bridge?
Solution -
Person A: 1 minutePerson B: 2 minutes
Person C: 5 minutes
Person D: 10 minutes
Let F represents Flashlight.
Person C and D are the slowest guys, if they don’t walk together that itself will make it 15 minutes, in this case (the best way to save time is):
A, D, F —-Bridge—-> = 10 min
<—-Bridge—-A, F = 1 min (returning with flash light) A, C, F —-Bridge—-> = 5 min
<—-Bridge—-A, F = 1 min A, B, F —-Bridge—-> = 2 min
That makes a total of 19 minutes, but that’s not what we want.
It means they both should walk together, in this case if they both are walking together, then there should be another person (because if one of them will bring it will take 5 minutes) to bring the flashlight back. So here is the solution…A, B, F —-Bridge—-> = 2 min
<—-Bridge—-A, F = 1 min C, D, F —-Bridge—-> = 10 min
<—-Bridge—-B, F = 2 min A, B, F —-Bridge—-> = 2 min
Total time = 17 minutes.