A man was walking through a tunnel. He is 1/4 of the way through when he hears a train approaching the tunnel from behind him.

If he turns and runs back, he will make it out of the tunnel just as the train is entering it (and will save himself by a hair). If he goes forward to the far end of the tunnel, he will also just barely make it, emerging from the tunnel just as the train is about to catch up to him.

If the man's running speed is 7 miles per hour, how fast is the train moving?

(*from techInterview.org*)

(In reply to

Answer by K Sengupta)

Let the respective speeds of the train and the man (in miles per hour) be t and s.

Let the length of the tunnel be n miles.

Then, the distance traversed by the man towards the train at a speed of s mph is n/4 miles.

Also, the distance traversed by the man away the train at a speed of s mph is 3n/4 miles.

However, we note that the respective relative speed of the man w.r.t. the train, towards it and away from it are (t+s) mph and (t-s) mph.

Accordingly, we must have:

n/(4s) * (t+s) = (3n)/(4s) * (t-s)

or, 3(t-s) = t+s

or, t = 2s

Therefore, the speed of the train is precisely twice that of the man.

Now, we note that the man's runni8ng speed is 7 miles per hour. Consequently, it follows that the train is moving at a speed of 7*2 = 14 miles per hour.

*Edited on ***November 19, 2008, 12:00 am**