Crossing the bridge at night is difficult!

Logic Level 3

Five people come to a river in the night. There is a narrow bridge, it can only hold two people at a time. They have one torch and, because it's night, the torch has to be used when crossing the bridge. Person A can cross the bridge in one minute, B in two minutes, C in four minutes, D in seven minutes, and E in eleven minutes. When two people cross the bridge together, they must move at the slower person's pace. What is the minimum time for them to cross the bridge (in minutes)?


The answer is 23.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

The best strategy to effective the time :

  1. A and B cross forward, taking 2 minutes.

  2. A returns, taking 1 minute.

  3. D and E cross forward, taking 11 minutes.

  4. B returns, taking 2 minutes.

  5. A and C cross forward, taking 4 minutes.

  6. A returns, taking 1 minute.

  7. A and B cross forward, taking 2 minutes.

So, the minimum time for them to cross the bridge is 2 + 1 + 11 + 2 + 4 + 1 + 2 = 23 2 + 1 + 11 + 2 + 4 +1 + 2 = \boxed {23} minutes.

I got ans as 17mins please help me if i am wrong D+E cross together take 11 mins Then C+D cross together will take 4 mins Then A+B cross toghter wll take 2 mins Therefore minimum total time will 11+4+2=17 mins I didnt understand why A B came back since it is not the type of a rive crossng prblm were two peoples are must in the boat to cross the river The question says that the bridge can hold a maximum of 2 persons its not 2 persons are required to cross the bridge Please help m if i am wrong

Aanchal Shahi - 5 years, 5 months ago

Log in to reply

To cross the river they require the torch, so when 1 pair cross over, 1 person must return to pass back the torch.

Tan Valentine - 5 years, 5 months ago

Wow i done exactly what u did.There was also a flash game of cross bridges in minimum time

genis dude - 4 years, 7 months ago
Ossama Ismail
Apr 11, 2020

Here is a Python code for this problem

def min time(Cross time):

Cross_time.sort()   

if len(Cross_time) > 3: 

    time_sofar = Cross_time[0] + Cross_time[-1] + min(2 * Cross_time[1], Cross_time[0] + Cross_time[-2])  

    return time_sofar + min_time(Cross_time[:-2])    

else:
    return sum(Cross_time[len(Cross_time) == 2:])

Cross_time = [ 7,11,1,2,4]

print( "Minimum time =", min time(Cross time))

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...