Langton's Ant

a cellular automaton


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:

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.

Langton's ant applet - requires java enabled browser

Quick Start:

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


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.


cohen book

My description of Langton's Ant and cellular automata is taken from the book: The Collapse of Chaos - Discovering Simplicity in a Complex World - by Jack Cohen and Ian Stewart.

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.


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 .

valid xhtmlvalid xhtml 1.0 strict
valid cssvalid css