This question already has an answer here:

I know this question has been posted many times, but I don't understand it. Two trains travel on the same track towards each other, each going at a speed of 40 kph. They start out 180km apart. A fly starts at the front of one train and flies at 100 kph to the front of the other; when it gets there, it turns around and flies back towards the first. It continues flying back and forth till the two trains meet and it gets squashed.

How far did the fly travel before it got squashed? I must do it John von Neumann's way but I don't get it.. Help maybe ?


marked as duplicate by Ilmari Karonen, Lee David Chung Lin, zz20s, Leucippus, Lord Shark the Unknown Mar 26 at 5:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ For how long is the fly busy with flying? What distance will it make in this time? $\endgroup$ – drhab Nov 1 '14 at 11:14
  • $\begingroup$ The joke is that von Neumann answered this question quickly, and the asker commented something like "well done, most people try to use an infinite series" and von Neumann responded "but that's what I did". So "von Neumann's way" probably refers to using an infinite series. $\endgroup$ – DanielV Nov 1 '14 at 11:37
  • $\begingroup$ The key point is that the fly is flying at a constant speed the whole time. If a fly flies 100 kph for 1 hour, it must travel 100 km in total. $\endgroup$ – MJD Nov 6 '14 at 0:01

The gap between the trains narrows by 80 km each hour, so it'll take 2 hours and 15 minutes before they collide. During that time the fly will travel a distance of $$ 2.25\ hrs \times 100\ km/hr= 225\ km. $$

  • $\begingroup$ The "von Neumann way" is the mutually dependent infinite serieses approach, probably. $\endgroup$ – DanielV Nov 1 '14 at 11:42
  • $\begingroup$ Sorry, I'm not as smart as von Neumann :) $\endgroup$ – Andrea Mori Nov 1 '14 at 11:43
  • $\begingroup$ Not yet anyway. Keep studying! $\endgroup$ – DanielV Nov 1 '14 at 11:44
  • $\begingroup$ On the contrary! When it comes to this problem you are even smarter than von Neumann. Apparantly that is possible. Let it give you some self-confidence. $\endgroup$ – drhab Nov 1 '14 at 12:50

Here's my explanation:

  1. The Two trains are traveling at the same speed of 40 Kilometers/hour
  2. Which means they traveled the same distance 180/2 = 90 Kilometers when they met
  3. The time to travel 90 Kilometers should also be the same for both the trains:

    40 Km in 1 Hour implies

    90 Km will take (90/40) = 2.25 Hours

  4. As the fly was traveling only till the train met, its travel time is 2.25 Hours

  5. The flying speed of the fly:

    in 1 Hour it traveled 100 Kms that implies

    in 2.25 Hours it would have traveled 100 * 2.25 = 225 Km

Therefore, the answer to your question is 225 Km


To solve this the Neumann's way, we calculate the time the fly takes in each of its Trips between $A$ and $B$.

Trip $1$ From $A$ to $B$:The fly travels at $100$ kph from $A$ towards the train coming from $B$ at $40$ kph. That means, it is traveling at a relative speed of $140$ kph and it has to cover a distance of $180$ km to meet the train coming from $B$. Time it takes for this Trip $1$ is $(9/7)$ hr. Let us call this $T_1$.

Trip $2$ From $B$ to $A$: In this Trip, the fly does not cover the complete distance of $180$ km, since each train would have covered $(40)*(9/7)$ km by the time the fly completes its Trip $1$. So, the distance the fly has to cover in Trip $2$ is $(180) -(40)*(9/7) -(40)*(9/7)$, which is equal to $(180)*(3/7)$ km. In this Trip, the fly is again traveling at a relative speed of $140$ kph towards the train coming from $A$. Time it takes for this Trip $2$ is $(180)*(3/7)*(1/140)$, that is, $(9/7)*(3/7)$ hr. Let us call this $T_2$.

Continuing the same way, we get

$T_3$ for Trip $3$ From $A$ to $B$ = $(9/7)(3/7)^2$

$T_4$ for Trip $4$ From $B$ to $A$ = $(9/7)(3/7)^3$

And so on. (Remember, the distance the fly covers keeps decreasing from Trip to Trip.)

The total time the fly takes between the trains is:


The sum to infinity of this Geometric Series is equal to $9/4$ or $2.25$ hrs.

At $100$ kph, the fly therefore travels a total distance of $225$ km.


Not the answer you're looking for? Browse other questions tagged or ask your own question.