# Seven robot ants that stay forever on a rod

You must place 7 robot ants on a long rod and set each of them to move left or right starting at time 0. You can set any positive speed for each ant. When 2 or more ants meet, they turn around. When an ant reaches the end it falls off.

Show that you can place and set the ants in such a way that none of them ever falls off.

Bonus question: Can you do this for other odd numbers, too?

• Since someone tried to wiggle out of the intended wording with the last problem, perhaps clarify that "left or right" is along the direction of the rod/parallel to its run/equivalent to moving along a long but not infinite axis Commented May 29, 2022 at 4:40
• What happens if I put two ants with the same starting position and direction and speed? Commented May 29, 2022 at 4:56
• @justhalf Starting positions must be different.
– Eric
Commented May 29, 2022 at 5:14
• I have found that for 3 ants is impossible. Interesting problem. Commented May 29, 2022 at 5:32
• @justhalf how? can you elaborate a bit Commented May 29, 2022 at 6:56

Picture showing how to place 4,7 or 10 ants:

x-axis is time, y-axis is position. The 4 black ants alone are viable as are the blacks together with the 3 blues or all 10.

Ants here move either at speed 1 or 1/3. Except for the first and last ones, the slower ants can be left out.

Therefore this construction yields solutions for 4, 6, 7, 8, 9, 10, 11, ... ants.

P.S.: 5 is also possible:

• One of those where a well presented diagram says it all. Great answer! Commented May 30, 2022 at 21:07
• Worth noting that this involves instances of three ants meeting. (Yes, this is allowed by the rules.) (Maybe 3+ ants meeting is needed to get 7 or any odd number?) Commented May 30, 2022 at 23:31
• Does this mean that 5 ants is not possible? Commented May 31, 2022 at 1:20
• @DmitryKamenetsky No, it only gives positive answers. Commented May 31, 2022 at 7:29
• Congratulations! You've solved the most difficult 5 ants case!
– Eric
Commented May 31, 2022 at 14:28