Interview Prep

Ants on a Stick Puzzle Answer: 1 Minute [Solved]

Ants on a stick puzzle answer: 100 ants, 1 minute, how long until they all fall off

Answer: 1 minute. The ants on a stick puzzle answer is 1 minute. Whatever the starting arrangement, the stick is empty within 60 seconds. The trick is that two ants bouncing off each other end up in exactly the same places as two ants passing straight through each other.

One hundred ants are dropped onto a stick one meter long. Each ant walks at one meter per minute, either to the left or to the right. When two ants meet, they bounce off each other and reverse direction. When an ant reaches either end of the stick, it falls off. The question asks for the longest time you would have to wait, over every possible starting arrangement, before the stick is empty for sure. It is a real interview question: a candidate’s first-hand account describes being asked it at a GCHQ internship interview, and Harvey Mudd College lists it in its Math Fun Facts collection.

The Ants on a Stick Puzzle, Stated Clearly

The stick is one meter long. The ants are identical, they all walk at the same speed, and they never stop until they fall off an end. Each ant starts at some position on the stick, facing left or facing right. Two ants that meet turn around.

Two details do most of the work. First, the question asks for the longest time over all starting arrangements, so you must give a guarantee for the worst arrangement, not the average one. Second, the ants are identical, which is what makes the pass-through trick possible.

Why 100 Ants Look Impossible to Track

Most candidates start by trying to follow the collisions. With 100 ants, that path leads nowhere: one collision reverses two ants, which changes the next one, and the starting positions are unknown anyway, so a simulation would need an answer for every arrangement.

The other instinct is to add up the ants. One ant can take up to a minute to cross the stick, so 100 ants must take up to 100 minutes. That is wrong too. They walk at the same time. The time the last ant falls off is set by the slowest single ant, not by the sum of all of them.

Why the Ants on a Stick Puzzle Answer Is 1 Minute

Here is the one idea that solves it. Take two ants walking toward each other. They meet, bounce, and walk away in opposite directions. Now imagine the same two ants passing straight through each other instead, each continuing in its original direction. Because the ants are identical, the two scenes look exactly the same a moment later: in the bouncing scene, the ant now walking left is the one that was walking right, and in the passing scene, the ant now walking left is the one that was walking left all along. You cannot tell the two scenes apart.

That means you can forget the bouncing entirely. Pretend every ant walks straight through every other ant, in its original direction, at the same speed. Each ant then walks in a straight line until it reaches an end and falls off. The farthest any ant can walk is the full length of the stick: one meter. At one meter per minute, that takes one minute, so every ant is off within one minute, whatever the starting arrangement was. One ant at the left end facing right takes the full minute, so 1 minute is the exact answer, not just an upper limit.

A Two-Ant Worked Example

Check the pass-through idea with numbers. Put two ants on the stick: ant A sits 25 cm from the left end, facing right, and ant B sits 75 cm from the left end, facing left. Both walk at one meter per minute.

Time Bouncing ants Passing ants
0 seconds A at 25 cm facing right, B at 75 cm facing left Same starting positions
15 seconds They meet at 50 cm, both turn around They meet at 50 cm, pass through each other
45 seconds A off the left end, B off the right end A off the right end, B off the left end

At 45 seconds, one ant falls off each end in both versions. The only difference is which ant falls off which end, and since the ants are identical, that difference does not exist. Scale it to 100 ants and the ants on a stick puzzle answer stays 1 minute, whether there are 2 ants, 25 ants, or 100 ants.

Three Variations Interviewers Ask Next

Once you say 1 minute, expect a twist that tests whether you know why the trick works and where it stops working.

Variation 1: the speed changes to one meter per second

Same stick, same 100 ants, but now each ant walks at one meter per second. The reasoning is unchanged and only the clock changes: the longest walk is still one meter, so the answer is 1 second. This is the GCHQ form of the question, and it checks that you scale the time with the speed rather than memorizing a number.

Variation 2: the stick is 10 meters long

Stretch the stick to 10 meters, keep the speed at one meter per minute. The longest walk is now 10 meters, so the answer is 10 minutes. The answer always equals the length of the stick divided by the speed, because that is the longest straight walk any ant can make.

Variation 3: the ants are painted different colors

Now the trick breaks. If ant A is red and ant B is blue, bouncing and passing through are no longer the same, because you can watch the red ant turn around at the collision. The stick is still empty within one minute, but you can no longer prove it by pretending the ants pass through each other. It checks whether you noticed that the solution rests on the ants being identical.

Three Traps That Catch Candidates

First, do not try to simulate the collisions. With unknown starting positions and dozens of bounces, a simulation is not a solution. The interviewer wants the reframing, not the arithmetic.

Second, do not answer 100 minutes. One minute per ant times 100 ants sounds careful, but it adds times that run in parallel. The ants walk at the same time, so the total is set by the longest single walk, not by the sum. If your answer grows when you add more ants, something is wrong.

Third, do not answer “it depends” and stop there. It does depend on the starting arrangement, and the question asks for the longest time over all of them. Give the worst case, then show the arrangement that reaches it: one ant at an end, facing the far end.

What the Interviewer Is Testing in the Ants on a Stick Puzzle

This puzzle tests whether you can reframe a messy problem into a clean one. The collisions look like the heart of the problem, and they are a distraction. The real skill is noticing an equivalence: two identical ants bouncing is the same as two identical ants passing through.

It also tests worst case thinking. The question does not ask how long the ants usually take, or how long they take in one lucky arrangement. It asks for the longest wait over every arrangement. That is why the single ant at the end of the stick matters: it turns an upper bound into an exact answer. For interview practice, lead with the answer, then the equivalence, then the worst case.

Try Another Puzzle Next

If you liked this one, try the Ants on a Triangle Puzzle Answer: Only One Ant Survives. It uses the same ants, but the triangle changes everything, because now the ants can chase each other in a circle. Or try the puzzle published this morning, the Sock Drawer Puzzle Answer: 3 Socks [Solved], which turns on the pigeonhole principle.

Frequently Asked Questions

What is the ants on a stick puzzle answer?

The ants on a stick puzzle answer is 1 minute. With 100 ants on a one-meter stick at one meter per minute, the stick is empty within 60 seconds in every starting arrangement.

Why is the answer 1 minute and not 100 minutes?

The ants walk at the same time, not one after another. Each ant walks at most the full length of the stick, which takes one minute, so the last ant falls off within one minute no matter how many ants there are.

How does bouncing equal passing through?

When two identical ants meet and bounce, the ant now walking left is the one that was walking right. If the ants had passed through each other, the same two positions would be occupied by ants walking in the same directions. Because the ants are identical, the two scenes are indistinguishable.

Sources: Harvey Mudd College, Math Fun Facts, Ants on a Stick; a candidate’s first-hand account of the GCHQ internship interview, First things first.

Leave a Reply

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