Sign up ×
Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It's 100% free, no registration required.

Suppose there are $n$ ants on a stick which has length 1. At any time, the ants may be facing left or right, the initial directions of the ants are arbitrary. Each ant can be modeled as a point in the stick.

At time 0, all ants start moving in the direction they're facing at speed 1.

Each time an ant collides with another ant, both ants reverse direction instantly and continue moving in the new direction.

If an ant reaches the ends of the stick, it falls down (quite a strange species of ant).

Now, you are observing this stick full of ants, starting at time 0. You are very interested of one ant, which appears in a distinct color from the other ants, so you focus your eyes just on that particular ant.

What is the maximum time you'll be watching that particular ant until it falls off the stick?

share|improve this question
What about this situation > ant going right, < ant going left.. >>>>><<<<< –  Adam Speight Jun 26 '14 at 13:55
@AdamSpeight you can run the simulation and see for yourself :) –  Tallmaris Jun 26 '14 at 14:11
@AdamSpeight: That sort of confusion is what makes this riddle interesting, and as Tallmaris said, try it! =) –  justhalf Jun 26 '14 at 14:21
@justhalf I did below –  Adam Speight Jun 26 '14 at 14:23
Thank you for bringing this question into my life. –  Going hamateur Jul 23 at 0:59

3 Answers 3

up vote 27 down vote accepted

And the answer is:

Surprisingly, it's 1, that is, it's the same as if nothing happens when the ants collide, and this doesn't depend on $n$.


The phrase that says you're watching a particular ant is just a distraction so that people will think that there is complexity in this riddle, while in fact it's very simple. When two ants collide and each reverses its direction, position-wise it's the same as if each ant simply continues moving in the original direction. So the maximum time is when there is an ant at on end of a stick facing the other end. Since the maximum time an ant can be in the stick is 1 (from one end to the other), therefore by time 1 all ants will already fall off the stick, including the particular ant that you're watching.

Alternative explanation:

Imagine that each ant holds a number, and when two ants collide (and reverse their directions), they will exchange the number. Now the crucial observation is: the numbers will never change its direction. So the maximum time a number can be on the stick is 1 (the numbers are always moving on the same direction with the same speed). So by the time 1, all numbers will have fallen down. Since every number is held by an ant, when there is no number, there is no ant either. Therefore by the time 1, all ants will have already fallen from the stick, including the particular ant you are watching.

share|improve this answer
I think this is the right answer, but as it is not explicitly mentioned that the point where the ant is has nonzero width, one could adjust the solution for that case. The solution you give should then be reduced with the size of the ant in question. –  Dennis Jaheruddin Jun 26 '14 at 22:11
Hmm, I thought the concept of point already convey dimensionless entity? Point is defined as "that which has no part". At either case, even if the ant has width, it doesn't change the answer, consider the case where there is only one ant at the end of the stick facing the other. The ant width is irrelevant, if we assume the point to represent the ant's location (and to determine when it would fall) is the middle of the ant. –  justhalf Jun 27 '14 at 1:02

@justhalf is correct but here is a visual aid. The spots on the stick are labeled 0-9 and ants facing right are > and ants facing left are <.

>        <
 >      <
  >    <
   >  <
   <  >
  <    >
 <      >
<        >

Note that the ants appear to "pass through" each other which was @justhalf's point. Two ants colliding mean they have each traveled half of the distance between them. They then turn around and walk back over that exact same distance. There will never be a case where an ant will have to walk past 5 to get to another ant and collide and, once it does, it will only have 5 more spaces to walk before it falls off of the stick.

Here is another example with three ants:

> >      <
 > >    < 
  > >  <   
   > ><    
    <> >  
   <  > > 
  <    > >
 <      > 
<        >

The ant that starts at 0 still turns around at the same spot and it still looks like the ants just walk through each other. It doesn't matter how many ants are added to the stick, the most one ant will ever have to travel is 10 spaces.

share|improve this answer
Let us continue this discussion in chat. –  Adam Speight Jun 26 '14 at 16:56

The answer is N, the length of the stick.

The complexity is that you're being distracted by the fact that they're bumping into each other while in reality nothing happens.

So you'd have to look for the maximum distance an ant has to travel for it to fall off, which would be on either sides of the stick.

share|improve this answer
By N I'm sure it means the length of the stick, right? –  justhalf Jun 26 '14 at 15:27
The stick has length 1. Not n, which is the number of ants. –  smci Nov 3 '14 at 21:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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