Math paradoxes

The fly between two trains Two trains, one fly, a hundred kilometres. How far does the fly fly?75 km, worked out in one line.

Two trains stand 100 km apart on parallel tracks and set off toward each other at the same moment, each at 50 km/h. At that instant a fly takes off from the nose of the first train and flies to the second at 75 km/h. On reaching it, the fly turns around instantly and flies back to the first, then to the second again, back and forth until the trains meet. How many kilometres does it fly in total?

It looks as if you have to add up infinitely many legs: 60 km, then 12, then 2.4… But you do not have to follow the fly. The trains close in at 100 km/h and meet exactly one hour later. All that time the fly flies non-stop at 75 km/h, so it covers 75 km. The infinite series gives the same number: 60 + 12 + 2.4 + … = 75.

Make a guess
75 kmflown by the fly
1 huntil the trains meet
∞legs back and forth
The puzzle

Two trains head to head and a fly between them

An old puzzle that interviewers like to ask. It tests not your arithmetic but whether you can look at the problem from another side. Behind it is the geometric series, one of the most useful sums in mathematics.

  1. 1

    The trains

    The trains are 100 km apart. They stand on parallel tracks, facing each other, and set off at the same moment, each at a steady 50 km/h. No speeding up or braking: the speed is the same from the first second to the last.

  2. 2

    The fly

    It sits on the nose of the first train and takes off at the start. It flies to the second train at a steady 75 km/h, touches its nose and turns back instantly. And so on, back and forth, always between the noses of the two trains.

  3. 3

    The end

    The flight ends when the trains' noses draw level: there is nowhere left for the fly to go. The trains are on parallel tracks, so nobody gets hurt.

  4. 4

    The question

    How many kilometres does the fly cover in total, from the start until the trains meet?

Intuition says

"There are infinitely many legs, so you need to sum an infinite series, and maybe the path is infinite"

There really are infinitely many legs, but each is five times shorter than the one before, and the sum is finite. And you do not need the series at all: the trains meet in an hour, and for that whole hour the fly flies at 75 km/h. 75 km.

Assumptions

  • The fly is a point, turns instantly and never gets tired.
  • All speeds are steady: 50 km/h for each train, 75 km/h for the fly relative to the ground.
  • There is no wind, and the train never gives the fly a ride: it flies on its own all the time.
  • We count the fly's path, the sum of all legs there and back, not its distance from the start.
Round 1 · Guess

How many kilometres does the fly cover?

100 km between the trains, 50 km/h each, the fly at 75 km/h. Pick a number, or say the path is infinite.

150
075150225300

A breakdown of your answer will appear here.

Hints

Hard to decide? Open the hints one at a time: the easy one first, then stronger ones.

Round 2 · Against the clock

The interview: five flies, 45 seconds each

Each round brings new trains and a new fly, and the trains' speeds may differ. Type the fly's path before time runs out. You can ask for "one more leg": the page works out the next leg of the flight but takes 3 seconds. Your score is the seconds left if the answer is exact (within 0.5 km).

The game opens after your answer in round 1

It gives the solution away, so make your own guess first.

Round –Score 0
45,0seconds left

Your rounds

Round 3 · Exact and simulated

Three ways to count, one number

The first way is the clock: path = the fly's speed × the time until the trains meet. The second is the exact sum of the legs, one by one, until less than a millimetre is left between the trains. The third is a simulation: the trains and the fly move in small steps of 0.1 seconds, and when the fly reaches a train it bounces back off it. On the chart the bars are the legs, the line is the running sum of the legs and the dots are the fly's path in the simulation at each turn. The simulation sees only finitely many turns: once a leg is shorter than one step it can no longer tell the turns apart, but the fly's path does not change.

Setup

a leg sum of the legs simulation, 0.1 s steps fly speed × time
Fly speed × time until the meeting
–
Sum of the legs while the gap ≥ 1 mm
–
Simulation in 0.1 s steps
–
1,000 random setups: the largest gap between simulation and formula
–
Round 4 · Why

Infinitely many legs, and the path is 75 km

There are two roads to the answer: watch the fly or watch the clock. Both are honest, and both give 75.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

Watch the clock

Where the fly goes does not matter: it flies for an hour

The trains close in at50 + 50= 100 km/h, 100 km in 1 hour
The fly in that hour75 × 1= 75 km

The fly never stops for a moment and flies at the same speed whichever way it faces. So its path is just speed times flight time. And the flight time is the time it takes the trains to meet. This card does not explain how infinitely many legs can add up to a finite number. The next one does.

Watch the fly

Each leg is five times shorter

The first leg: the fly and the second train move toward each other at 75 + 50 = 125 km/h, so they cover 100 km in 0.8 hours, and the fly flies 60 km. In that time the trains have closed 80 km, leaving 20 km between them, five times less than before. Then everything repeats at a scale of 1 : 5: 12 km, 2.4 km, 0.48 km… The strip above is the 75 km cut into legs. After each leg, what is left to 75 km shrinks fivefold: 15, 3, 0.6… So the sum creeps up to 75 and never jumps over it.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Leg by leg

The exact numbers of the first eight legs

All numbers are exact: each one is a fifth of the one before. After the seventh leg the fly has less than a metre left to fly, and the trains meet in less than 0.05 seconds. There are infinitely many legs, but they add up to 75 km and take exactly one hour.

Any fly

Change the fly's speed

First leg and ratio–
Sum of all legs–

Why the two ways agree

A series of legs is a series of time slices

60 + 12 + 2,4 + … = 75 · (0,8 + 0,16 + 0,032 + …)

Each leg is 75 km/h times its duration: 0.8 h, 0.16 h, 0.032 h… These slices of time fill the hour before the meeting without gaps. So the sum of the legs is 75 × (the sum of the times) = 75 × 1. The series and the clock count the same thing; the series just cuts the hour into infinitely many slices.

For formula lovers

The general answer and the series for unequal speeds

Distance D, trains at speeds u and v, a fly at speed f, where f is greater than u and v. The clock gives the answer at once.

T=Du+v,S=fT=fDu+v

The series: after a leg toward the second train the gap is multiplied by r₁, after a leg toward the first by r₂. The legs alternate, and each pair multiplies the gap by q = r₁r₂.

r1=f−uf+v,r2=f−vf+u,S=fDf+v·1+r1f+vf+u1−r1r2

For identical trains (u = v) there is one ratio and the series is simple. In our puzzle D = 100, v = 50, f = 75.

r=f−vf+v=25125=15,S=601−15=75

Substitute r₁ and r₂ and simplify, and the series turns into exactly fD/(u + v). The page checked both formulas on a thousand random setups in round 3. The series is right, just longer.

Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Sub-theory · the geometric series

How to add up infinitely many terms

Sn = a + ar + … + arn−1 = a · (1 − rn) / (1 − r)

Multiply the sum by r: you get the same sum shifted by one term. Subtract one from the other and almost everything cancels: S − rS = a − arⁿ. If |r| < 1, rⁿ gets smaller with every step and tends to zero, and the sum of all terms is a / (1 − r). For the fly a = 60, r = 1/5, and 60 / (4/5) = 75. If |r| ≥ 1, the terms do not shrink and the sum is infinite. So what matters is not how many terms there are but how fast they shrink.

History · an anecdote

"What trick? I just summed the series"

This puzzle is most often told together with John von Neumann. Paul Halmos retold the story in 1973 in "The Legend of John von Neumann" (American Mathematical Monthly), among other legends about him. In his version there are two bicycles 20 miles apart instead of trains, each riding at 10 miles per hour, and the fly flies at 15. Von Neumann answered "15 miles" at once. The disappointed questioner said he must have known the trick. Von Neumann was puzzled: what trick? He had simply summed the infinite series.

This is an anecdote, not a documented event: Halmos presents it as one of the stories that went around about von Neumann, and in other retellings the numbers and even the questioners change. But the point stays: the series gives the right answer, it just takes more work. Our puzzle is Halmos's version with the numbers multiplied by 5: the ratio is the same, 1/5.

Round 5 · Scaling up

When the series wins, where to look for an invariant, and the price of "forever"

The fly teaches two lessons. A mathematical one: an infinite sum can be finite, and a geometric series takes one line. A logical one: sometimes it is better not to follow the process but to find what does not change in it. And a practical one: the same series sets the price of a perpetuity.

Mathematics

A bouncing ball

Path over all bounces–
Time until it stops–

When the series beats the trick

Here the clock will not help

A ball falls from height h and each time bounces back to a fraction r of the previous height. Its speed keeps changing, so "speed × time" does not work: the bounces have to be added up. The path: h + 2hr + 2hr² + … = h + 2hr / (1 − r). For 10 m and 60% that is 10 + 30 = 40 m. The time is a series too, with ratio √r, because a fall takes time proportional to the square root of the height: for 10 m and 60% about 11.2 s (g = 9.81 m/s²).

So the series is not "the long road for those who miss the trick". When there is no invariant and every step shrinks by the same factor, the geometric series is the shortest road. The model is ideal: a real ball stops bouncing not because the series runs out but because of friction and deformation.

Logic

A spoonful of wine in a glass of water

Two glasses: 100 ml of wine and 100 ml of water. A spoonful of wine goes into the water, it is stirred, and a spoonful of the mix goes back. Which is more: wine in the water or water in the wine?

Stirring

Look for what stays the same

An invariant instead of watching

You can track the shares after each pour, or you can notice one thing: at the end each glass again holds 100 ml. However much wine left the wine glass, exactly that much water came in to replace it. So there is exactly as much wine in the water as water in the wine, whatever the spoon and however badly it was stirred.

The fly is the same: its path is tangled, but one thing does not change — it flies the whole time until the trains meet. When a process looks endless, look for a quantity it does not affect: time, volume, parity, a sum. The same trick drives the 100 prisoners and hats puzzle, where the invariant is parity.

Practice

What payments forever are worth

Price of N years of payments–
Price of payments forever–

Annuities and perpetuities

Infinitely many payments, a finite price

A bond pays 1,000 a year. What is it worth today if money can earn 5% a year? A payment in one year is worth 1,000 / 1.05 today, in two years 1,000 / 1.05², and so on: a geometric series with ratio 1/1.05. The sum over N years: 1,000 · (1 − 1.05⁻ᴺ) / 0.05. If the payments go on forever, the sum is 1,000 / 0.05 = 20,000. Fifty years of payments are worth 18,256, that is 91% of "forever": the distant years add almost nothing.

Careful: an infinite sum is finite only when the terms shrink fast enough. At a zero rate every payment is worth 1,000 and "forever" is worth infinitely much. And the sum 1 + 1/2 + 1/3 + 1/4 + … has shrinking terms too, yet it grows without bound: shrinking is not enough, they must shrink geometrically or at least fast enough.

Bonus · Fun facts

Things to tell your friends

1973

The von Neumann legend

The story of von Neumann instantly "summing the series" is most often quoted from Paul Halmos's article "The Legend of John von Neumann" in the American Mathematical Monthly, 1973. Halmos gives it as one of the legends, not as something he witnessed.

7

Legs down to one metre

After three legs the fly has covered 74.4 km, or 99.2% of the path. After the seventh it has 96 cm left to fly, after the twelfth a third of a millimetre. A real fly is wider than that, so its flight would end long before "infinity".

III ст.

Archimedes and the parabola

In "The Quadrature of the Parabola" (3rd century BC) Archimedes found the area of a parabolic segment by adding triangles, each layer a quarter of the one before: 1 + 1/4 + 1/16 + … = 4/3. It is one of the oldest known sums of a geometric series.

V ст.

Achilles and the tortoise

Zeno of Elea (5th century BC) argued that Achilles never catches the tortoise: every time he reaches where it was, it has moved on a little. Aristotle retells the paradox in his "Physics". The structure is the fly's: infinitely many steps fit into a finite time.

1751

British consols

Britain issued "consols", bonds with no maturity that pay interest forever, from 1751. They traded for over 250 years until the government bought back the last of them in 2015. Their price is the same sum C / r as in round 5.

1648

A bond that still pays

In 1648 the Dutch water board Lekdijk Bovendams issued a perpetual bond to repair a dike on the river Lek. Yale's Beinecke Library bought it in 2003, and in 2015 a curator travelled to the Netherlands and collected twelve years of interest.

Discussion

What do you think?

Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

Is “School maths” the right level for this puzzle?

Thank you! This helps set the levels right.

Newsletter

New puzzles, explanations and discussions

I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

The sign-up form will appear here soon.