Langton's ant is a cellular automaton (See the Notes at the bottom of this page for more on cellular automata) which poses a problem that is currently baffling mathematicians. The ant lives by three simple rules:

If it is on a yellow cell it makes a 90° turn to the left.

If it is on a grey cell it makes a 90° turn to the right.

As it moves to the next square, the one that it is on changes colour from yellow to grey, or the reverse.

The result is a quite complicated and apparently chaotic motion... but after about ten thousand moves the ant locks into a cycle of 104 moves which causes it to build a broad diagonal "highway". What's more, the ant seems to always build the highway (though nobody has been able to prove this yet) even if "obstacles" of yellow squares are scattered in its path, provided it finds enough grey squares on the periphery. Try it out yourself in the applet below.

Quick Start:

Just click Start and watch the ant run around - the "highway" appears after about 10,000 moves.

Instructions:

The ant's initial direction is North. Click Next to walk it through a few moves, and satisfy yourself that it follows the rules described above. (N.B. ant shown dark grey when on a grey square, and orange when on a yellow square)

Then click Start and look out for the highway. To see how it behaves with an obstacle click AddObstacle.

Another Ian Stewart inspired applet on this site is Out of Order, Chaos - based on his book Does God Play Dice? The New Mathematics of Chaos.

Notes:

A cellular automaton is a grid of cells which switch to different states (in this case yellow and grey) according to a specific set of rules. Langton's ant (named after its inventor, mathematician Christopher Langton) is one of the simplest cellular automata. For a more complex example of a cellular automaton see the Conway's Game of Life applet on this site .