This is one of a number of interesting puzzles involving colliding ants.
See the links at the bottom of the page for some interesting variations.

Ants on a Stick

How long until they all fall off?

Suppose an ant walks along a 20 cm stick at a speed of 1 cm every second.
What is the longest time the ant can be
on the stick before falling off?
Obviously 20 seconds if the ant starts at one end and walks to the other.

Now suppose there are several ants on the stick, starting from random positions and facing either left or right. When two ants collide they turn around and walk back the other way until they either collide again or fall off the stick.

Can you see through the resulting mayhem and work out what is the longest possible time that at least one ant will remain on the stick?

Use the simulation below to help solve this problem — see how long it takes a single ant to fall off the stick, then experiment with more ants. Does it ever take longer for all the ants to fall?

Number of ants:
Seconds:

Select the number of ants and hit Run to start.
Use New to reset to a random initial configuration.
Wach the Time field to see how long the ants stay on the stick.

The other buttons toggle the available options:

- Flag — give each ant a flag that it will exchange when colliding.
- Barriers — put barriers at the end of the stick so the ants will not fall off.
- Alice — highlight Alice the Ant to make it easier to watch a single ant's motion.
- Distinct — select to give each ant its own colour.
- Sounds — turn on the sound effects.
- Elephant — elephant???

This activity illustrates the beauty of mathematical problem solving — specifically how a key insight can reduce a confusing tangle of a problem into something simple and beautiful. The underlying nature of the ants motion in this problem becomes clear when the ants are given flags, and it is seen that while the motion of the ants is haphazard, the motion of the flags is wonderfully simple and admits a direct and obvious solution to the problem.