Fog Creek Software
Discussion Board

railroad bridge: solution

Assume that the length of the tunnel is x.

Thus the man has traveled a distance of x/4 before he hears the train. It is obvious that the train is some distance from the start of the tunnel now (say distance y), since otherwise the man would not make it to the start. The situation is as shown below:

        y                        x/4                      3x/4
Train                  Start      Man                                        End
                          of tunn                                              of tunn

From the first case, In time t (say), the man runs a distance of x/4 and the train a distance of y.

From the second case, in time 3t (since the man runs the rest of the tunnel now (3x/4 length), with the same speed, so he should take 3 times as long as the reverse run of x/4), the man travels 3x/4 and the train travels (y + x).

Since the speed of the train has remained the same too, but the time that it traveled is thrice the first time t, it follows that the distance it traveled is thrice the distance (y) in the first case. In an eqn form:

x + y = 3y

hence, x = 2y.

Or, the train was initially at a distance of x/2 from the start of the tunnel.

Going back to case 1, since in the same time t, the train runs x/2 and the man runs x/4 (half this distance), the train is traveling twice as fast as the man.

Sourabh Joshi
Thursday, January 23, 2003

*  Recent Topics

*  Fog Creek Home