## Jun 26 The Two Trains

Writing last week’s ferry crossing problem I was reminded of another classic which has an easy way in if you are clever about it. Two trains are heading towards each other at a constant speed of 50 MPH each and they start with 100 miles between them. A fly is initially on the front of one of the trains and is flying at 75 MPH towards the other train. When it reaches the other train, the fly turns around and heads back to first train. The fly will continue this behaviour until the trains crash into one another.

How many times will the fly make the journey and how far will the fly have travelled by the end? Answer below.

In answer to the first part, the fly will make the journey an infinite number of times.

Once again there are two ways in for the second part. Firstly you can work out the distance that the fly travels in each iteration and sum them all together. For instance the fly’s displacement when the train and it first meet is 75t, while the train’s is 50t. These must sum to 100 miles, so 125t=100, so t=4/5 hours. The fly will then take a smaller amount of time to get back to the first train which takes 4/25 hours (the method is similar). In that time it will have travelled (4/5+4/25)*75=72 miles.

You can set the above working out more generally and get a function for how far the fly travels in each iteration. It ends up being a geometric series with first term 60 and common ratio 1/5, which has a sum to infinity of 75 miles.

But that is the brute force method. Instead let's try a more subtle way in. If a train travels at 100 MPH relative to one another and have 100 miles to cover then they will take 1 hour to crash. The fly is travelling at a constant speed of 75 MPH during that time, so it will cover 75 miles in the same time. The individual distances covered in each section are irrelevant.

There is an apocryphal story of John von Neumann being asked this question by at a conference. After about 10 seconds of mulling it over in his head he replied with the correct answer. The questioner congratulated him saying that most people miss the simple way and try to resolve the infinite series in their head, to which replied, “what simple way?”