On this page
Christopher Langton described this tiny machine in his 1986 paper Studying artificial life with cellular automata90237-X) in Physica D. It needs only squared paper and a pencil, yet it still holds an open problem.
What is Langton's ant?
Picture an endless grid of white squares with one ant sitting on a square, facing up. Each move follows the rule as stated on Wikipedia's Langton's ant page:
On a white square, turn 90 degrees right, flip the square to black, step forward one square.
On a black square, turn 90 degrees left, flip the square to white, step forward one square.
Wolfram MathWorld calls it a 4-state two-dimensional Turing machine and states the turns the other way round. Swapping left and right just mirrors the pattern, so either version works if you stay consistent.
How do you trace the first steps by hand?
Take a sheet from a squared notebook. Label the starting square (0, 0), with x increasing to the right and y increasing upward. The ant faces up (north). Then:
(0, 0) white: turn right (east), make it black, move to (1, 0).
(1, 0) white: right (south), black, move to (1, -1).
(1, -1) white: right (west), black, move to (0, -1).
(0, -1) white: right (north), black, back to (0, 0).
(0, 0) now black: turn left (west), make it white, move to (-1, 0).
(-1, 0) white: right (north), black, move to (-1, 1).
(-1, 1) white: right (east), black, move to (0, 1).
(0, 1) white: right (south), black, move to (0, 0).
(0, 0) white again: right (west), black, move to (-1, 0).
(-1, 0) black: left (south), white, move to (-1, -1).
Count the black squares after each step: 1, 2, 3, 4, 3, 4, 5, 6, 7, 6. That matches the opening terms of OEIS sequence A255938, the number of black cells after the ant has moved n times, so you can check your own tracing against it.
Why does the ant turn chaotic?
According to Wikipedia, the first few hundred moves produce very simple, often symmetric patterns. After that, a large irregular blob of black and white squares appears, and the ant follows a pseudo-random path until step 9,977.
Part of the reason is feedback. Every turn depends on a colour the ant itself wrote earlier, so its past keeps steering its future. Nothing is random: run it twice from a white grid and you get the same picture both times.
When does Langton's ant build the highway?
At step 9,977 the ant settles into a cycle of 104 moves that then repeats forever (Wikipedia). MathWorld notes that each cycle shifts the ant two squares horizontally and two squares vertically, so it marches off diagonally, laying down a striped road.
The OEIS entry gives a sharp check: a(n+104) = a(n) + 12 for n > 9976, meaning every 104-step cycle adds exactly 12 black squares.
You can work out the highway's speed yourself. Moving 2 squares across and 2 squares up covers a diagonal of 2 times the square root of 2, about 2.83 squares, in 104 steps. Divide and you get the square root of 2 over 52, about 0.027 squares per step, the same figure Jean Pierre Boon derived in How fast does Langton's ant move?
Why is such a simple rule hard to analyse?
Boon's abstract puts it plainly: despite the simplicity of its basic algorithm, the ant has remained a puzzle in terms of analytical description. Three facts show why.
The highway is unproven. MathWorld says it is believed the ant always builds a highway, whatever finite pattern it starts on, but this remains formally unproved.
One thing is proven. Whatever finite pattern it starts on, the ant's path is always unbounded: it can never stay trapped in a finite patch. Wikipedia cites Leonid Bunimovich and Serge Troubetzkoy's 1992 paper Recurrence properties of Lorentz lattice gas cellular automata for this result, which is also known as the Cohen-Kong theorem.
The ant can compute. Anahi Gajardo, Andres Moreira and Eric Goles showed that a single ant's trajectory can calculate any boolean circuit, which makes the ant universal and some questions about it undecidable. So for some questions about the ant's behaviour, no general method can always give the answer.
For more rules that are easy to state and hard to analyse, read the look-and-say sequence and Conway's constant or why a 3D random walk may never return.
If terms such as cellular automaton, Turing machine or undecidable are new to you, the Fermi Concept Library explains concepts across mathematics and computing. For ideas that are easier to see than read, the Fermi Simulation Lab has interactive simulations to explore.



