Fog Creek Software
Discussion Board

Answer to "rail road bridge"

This is the answer i thought of to this puzzle.

suppose 'x' is the distance the train has to travel before reaching the start of the tunnel.
And 'd' be the tunnel length.


* : train
# : man
(): start and end of the tunnel

from the problem we can infer that

1.when the man travels back i.e. d/4 distance.
  the train covers a distance of 'x' while the man
  covers 'd/4' distance.
2.when the man moves froward i.e. 3d/4 distance.
  the train covers a distance of 'x+d' while the man
  covers '3d/4'diatance.

d/4 ---> x    and    3d/4 -----> x+d

from the above 2 equations,
we can derive that d = 2x.

i.e. the tunnel is double the length train has to cover before reaching the start point of the tunnel.


so again there are 2 inferences.

1. when the man moves backward.
    man covers a distance of 2x/4 = x/2 as the train
    covers a distance of x.
    man speed : train speed = 1:2

2. when the man moves forward.
    man covers a distance of  3 *(2x/4) = 3x/2 as the
    train covers a distance of x+2x = 3x.
    man speed : train speed = 1:2

in both the cases the ratio is 1:2.

so, the man speed should be exactly half of the train speed


train speed should be double the man's speed.

NOTE: please do send the replies if there are any mistakes
        in the above discussion.

H.T.Srinivas Kumar
Monday, March 31, 2003

The man is traveling twice as fast as the train - do some substitution back into your equations to verify.

Monday, March 31, 2003

we know the formula speed = distance/time.

in this case , time is same for both the train and the man.

speed_man = distance_man/time_man.
speed_train = distance_train/time_train.

since time_man = time_train

distance_man/speed_man = distance_train/speed_train
substituing values for the 1st case where he moves back.

(x/2)/speed_man = x/speed_train

=>  x/(2*speed_man) = x/speed_train

=> 2*speed_man = speed_train

so the speed_man should be half that of the train.


H.T.Srinivas Kumar
Tuesday, April 1, 2003

The man is not travelling twice as fast as the train.  He's travelling HALF as fast.  If he were going twice as fast and he ran away from the train, the train would never catch up to him.

Wednesday, April 2, 2003

I'm impressed with all the math, but think I can explain it in english.  (I've got little kids, so I've been practicing this type of skill.)

The man starts one quarter of the way in the tunnel.  He can turn around and get back out before the train reaches the entrance.  This means he can also get another quarter of the way into the tunnel before the train reaches the entrance.

So the man is half way through the tunnel when the train reaches the entrance; and then they both reach the far end at practically the same time (since the man survives the ordeal, we'll let him get there just slightly faster).

So the train goes the full length of the tunnel, and the man goes half way.  The train is going twice as fast.

This reminds me of an old problem in ray-tracing of determining the point on a sphere that a ray would hit (used in the old days to make those cool reflective sphere pictures).  There were two ways to solve that problem:  one using algebra, and another using geometry.  Both ways worked, but the algebraic solution was much more complex than the geometric.

Always look for the simplest answer, you'll often learn more than just the solution in doing so.

Derek Woolverton
Saturday, April 5, 2003

if he runs towards the train, the man would have to travel 1/4 the length of the tunnel to avoid the oncoming train. if instead he runs away from the train then he'd be halfway down the tunnel when the train enters. he's got half a tunnel's head-start on the train, but they reach the far end at the same time, therefore the train's going twice as fast.

piers haken
Thursday, April 17, 2003

*  Recent Topics

*  Fog Creek Home