Problem:

Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person: 1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?

Solution:

You may think that the best solution would if we usher the fastest person (needing least time) to help the rest cross the bridge.

However this solution needs (10+1+7+1+2=21mins).Lets find a better way to solve this problem.

To reduce the amount of time, we should find a way for 10 and 7 to go together. But, if they cross together, then we need one of them to come back to get the others, but that would increase the time. A workaround would be if we can have 1 waiting on the other side to bring the torch back. The fastest way to get 1 across and be back is to use 2 to usher 1 across.

The steps involved are as follows:

-1 and 2 go (time=2)

-2 comes back (time=2)

-7 and 10 go across (time=10)

-1 comes back (time=1)

-1 and 2 go (time=2)

Total time = 2 + 2 + 10 + 1 + 2 = 17 mins