Q: If two trains move towards each other at certain velocities, and a fly flies between them at a certain constant speed, how much distance will the fly cover before they crash?

The brain teaser comes in a many variations. For example:

Trains A and B, 700 miles apart, are heading toward each other on a straight piece of track. Train A is going 85 mph while train B is going 55 mph. At the same moment, a bee that flies 110 mph is sitting on the nose of train A and begins flying toward train B. When it reaches train B it makes an instantaneous reversal of direction and flies back toward train A. It continues to change direction every time it runs into a train until both trains and the bee meet in a spectacular crash. What total distance did the bee fly before the big collision?


Mathematician: The difficult way to solve this problem is to figure out how much distance the bee (or fly) traveled before turning around each time it approached a train, and then sum these distances together. The easy way to solve it is simply to figure out how long it took the trains to crash, and then calculate how far the bee, which travels at a constant speed, must have gone during this amount of time.

More specifically: The bee always travels at the same speed V. If we can figure out how much time, T, the bee flew before the trains collided with each other, then the total distance D it flew will just be V T, the product of the velocity and time. We know V, so all that remains is to figure out T. To do this, we just need to calculate how long it takes for the trains to crash. If the first train has velocity v1 and the second v2, and the distance between them initially is d, then the time T before the crash will just be d/(v1+v2), which is equivalent to the amount of time that it takes a train going velocity v1+v2 to travel the distance d. The total distance traveled by the bee is given by:

D = V d / (v1+v2)

= (700 miles)  * (110 mph)/((55 mph)+(85 mph))

= 550 miles

This entry was posted in -- By the Mathematician, Brain Teaser, Math. Bookmark the permalink.

6 Responses to Q: If two trains move towards each other at certain velocities, and a fly flies between them at a certain constant speed, how much distance will the fly cover before they crash?

  1. toby says:

    There’s a great story that someone posed this problem to John von Neumann, who popped the answer out in seconds. Neumann had an amazing ability to do complicated calculations in his head.

    The questioner laughed and said “Ah, you spotted the short way to do it!”

    Neumann just looked surprised “There’s a short way?”

  2. Tim Anderson says:

    How hard does it get if we give the fly a certain (nonzero) length and only allow it to subject itself to a maximum acceleration?

  3. The Mathematician Mathematician says:

    In that case, things would get quite a bit harder because we would have to keep track of all of the occasions that the fly approaches the train. We couldn’t just calculate the total time in order to do the calculation as we do in the constant velocity case.

  4. matt says:

    THANK YOU. this was the exact problem i was doing(different numbers) and having trouble on. you explained it perfectly. you are the reason why the internet is great.

  5. Hi, I’ve been having trouble with word problems like this for a very long time, never really learned what I was supposed to in school I guess. Thank you for your explanation. :) But, I’m confused, because at the bottom there is something wrong with how this is arranged, at least in my head.

    D = V d / (v1+v2)

    = (700 miles) * (110 mph)/((55 mph)+(85 mph))

    = 550 miles

    Shouldn’t this be = (110 mph) * (700 miles)/((85 mph)+(55 mph)) ? I mean, that’s the equation above written out with the available data, yes? Oh, and the Bee’s Velocity should have been labeled V3, IMHO, as the other velocities had numbers next to them too. V1 is train one, V2 is train two, V3 is the bee between them, yes? Ok, so, when I did it I used the following:

    V1 = 85 mph
    V2 = 55 mph
    V3 = 110 mph
    D1 = 700 miles **the original distance between the two starting points**
    T = D1 / (V1+V2) = (700 miles) / ((85 mph) + (55 mph)) = 5 hours
    D2 = V3 T = (110 mph) * (5 hours) = 550 miles

    Does this not make sense to anyone but me? Am I just being stupid? Well, anyway, thank you very much for the math lesson, it’s been very helpful for me. :)

  6. now if question asks about number of trips (forward and backward both) made by fly/bee, then suggest the solution !!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>