Fog Creek Software
Discussion Board




Railroad bridge solution

This solution might be slightly overkill, but I want it to be perfectly understandable.

Given:

    velocity*time=distance (vt=d, d/v=t, d/t=v)

Let:

v1 = speed of the train
v2 = speed of the man
d = the distance of the train from the tunnel
x = the length of the tunnel
t1 = the time it takes the man to run back 1/4 the tunnel
t2 = the time it takes the man to run ahead 3/4 of the tunnel

So:

The time it takes the train to reach the tunnel, and likewise the man to run back 1/4 length is t1:
t1 = d/v1

The time it takes the train to reach the tunnel, then travel through the tunnel, and likewise for the man to run the remaining 3/4 of the tunnel is t2:
t2 = (d+x)/v1

The man covers x*1/4 in t1:
t1 = x/4v2

The man covers x*3/4 in t2:
t2 = 3x/4v2

Now we just combine equations and do some algebra:

t1 = x/4v2 = d/v1

t2 = 3x/4v2 = (d+x)/v1

->  x*v1 = 4d*v2
-> 3x*v1 = 4d*v2+4x*v2

-> 2x*v1 = 4x*v2
-> v1 = 2*v2

The speed of the train is twice the speed of the man.

Just another kid
Sunday, September 15, 2002

Here's a MUCH simpler and more intuitive solution:

If the man ran back 1/4 just in time to miss the train, then if he ran ahead 1/4, he would be at the halfway point just as the train entered the tunnel. From there he covers the remaining half in the time it takes the train to travel the whole tunnel, and thereby just escapes on the other side.
If the train travels the the whole tunnel in the time it takes the man to run half the tunnel, the train must be going twice as fast as the man.

Just another kid
Sunday, September 15, 2002

yes.  No need to do all that math.  Next question.  How far away was the train from the tunnel when the man just noticed it, before he started to run? 

Tim
Tuesday, September 24, 2002

How far away was the train when the man noticed it?
Half a tunnel length.

For each quarter tunnel length the man runs, the
train travels one half tunnel length.  If he runs
towards the train, he exits the tunnel just as the
train enters it.  If he runs away from the train, then
he reaches halfway into the tunnel in his first quarter-
tunnel-run just as the train enters the tunnel;
he reaches 3/4ths the way through the tunnel as
the train reaches half way, and he exits the
tunnel in his third and last quarter-tunnel-run just as
the train does as well.

Lou Ceci
Sunday, October 13, 2002

*  Recent Topics

*  Fog Creek Home