ExplorationsTwo lines of rule, ten thousand steps of mess, and then a highway
The Ant That Builds a Road
Place an ant on an all-white square grid. On white it turns right; on black it turns left. Each turn is 90 degrees, after which it flips the square’s colour and moves forward one square. From this start, a repeating diagonalDefinition: A diagonal joins non-neighbouring polygon vertices, or follows matching row-and-column steps through an array or grid. path appears after about 10,000 steps; this finite wrapping grid lets you inspect its formation, not prove its infinite continuation.
Current view: The grid
The squares the ant has flipped, and the ant standing on one of them.
readswhitedoesturn right, leave blackthensteps south to (1, 1)next step2
1 of 11,000 steps drawn, on a window 9 squares by 9 that widens to hold everything coloured so far.
Where the ant was, step by step
| Step | Square | Facing | Coloured squares |
|---|---|---|---|
| 0 | (0, 0) | north | 0 |
| 1 | (1, 0) | east | 1 |
| 2 | (1, 1) | south | 2 |
| 3 | (0, 1) | west | 3 |
| 4 | (0, 0) | north | 4 |
| 5 | (-1, 0) | west | 3 |
| 6 | (-1, -1) | north | 4 |
| 1,375 | (12, -9) | west | 151 |
| 2,750 | (-1, -11) | south | 250 |
| 4,125 | (-1, -4) | east | 309 |
| 5,500 | (22, 0) | south | 410 |
| 6,875 | (14, -5) | west | 475 |
| 8,250 | (-7, 9) | north | 572 |
| 9,625 | (-9, -20) | east | 689 |
| 9,976 | (-14, -10) | north | 716 |
| 10,080 | (-16, -8) | south | 726 |
| 11,000 | (-34, 14) | south | 834 |
- square
- one square of the grid, pale while it holds the background colour
- coloured square
- a square the ant has left, darker the further round the colours it has gone
- the ant
- the ring, standing on the square it is about to read
- the heading
- the line out of the ring, showing which way the ant will step
One square of the picture is one square of the grid. A pale square has been left in the background colour and a filled one has been coloured; with a turn word longer than two letters the fill darkens through the colours in order. The ant is the outlined square with a mark showing which way it faces, and it is the only thing that moves: every other square is the record of a visit. What to look for is the moment the outline stops circling the knot and starts walking away from it in a straight band, laying the same 104 squares over and over.
1 of 11,000 steps drawn, and 1 square coloured. The ant is at (1, 0) facing east.
- Turn word
- RL
- Coloured squares
- 1
- Road begins
- step 9,976
How far to run
Just past the step where the road begins, so the knot and the road are both on screen.
There is no ending to wait for: the ant never stops and never repeats a state, so this is a limit on the computation rather than on the machine. The largest run this page will do is 60,000 steps.
Step by step
Use Step for one change you can inspect, or Run to watch the changes accumulate.
1 of 11,000 steps drawn. The whole run is computed before anything is drawn, so moving this cannot change what the ant does; it only decides how much of it is on screen. The first two dozen steps are one notch each, and after that each notch is a longer stride.
The turn word
One letter per colour, saying which way to turn on a square of that colour. RL is the original ant. A longer word gives the grid more colours, and a square the ant leaves advances to the next colour rather than simply flipping.
Advanced parameters
Four black squares placed diagonally around the ant, and nothing else changed. This is the control that shows the step at which the road begins is a fact about the rule and the starting grid together rather than about the rule alone.
Cases worth seeing
Try this
Step through the first six moves. The ant turns right five times and then turns left. What changed?
What is going on
Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.
- (0, 0) northwhite, turn right, black, move(1, 0) eastThe square under the ant is white, so it turns a quarter turn right, from north to east.
- (1, 0) eastwhite, turn right, black, move(1, 1) south
- (1, 1) southwhite, turn right, black, move(0, 1) west
- (0, 1) westwhite, turn right, black, move(0, 0) northFour right turns have brought the ant back to the square it started on.
- (0, 0) northblack, turn left, white, move(−1, 0) westThat square is black now, because the ant coloured it on the way out. So the other half of the rule fires and the turn goes the other way.
The laboratory draws the same squares. The ring is the ant, the line out of the ring is the way it is facing, and a square darkens the moment the ant leaves it, so every filled square on the stage is the record of one step exactly like the five above.
Four right turns took the ant round a loop and back to where it began, and the fifth step went the other way, not because anything changed but because the square underneath had. That is the only memory in the whole system: the ant reads what it wrote. Run it for ten thousand more steps and it is still doing nothing else.
What you are seeing
A plain description of the process
Place an ant on an all-white grid, facing one of the four compass directions. It reads the square underneath it and turns 90 degrees right on white or 90 degrees left on black. It then flips that square's colour and moves forward one square. Turning, flipping and moving together count as one step.
For example, an ant facing north on white turns east, colours its old square black and moves one square east. Its next turn depends on the colour of the new square, not the square it just left. The grid records the history; there is no random choice or destination built into the rule.
From the blank start, this laboratory detects a repeated 104-step path beginning at step 9,976 under the stated detection criterion. Each repeat ends two squares west and two squares south of where it began, creating a diagonalDefinition: A diagonal joins non-neighbouring polygon vertices, or follows matching row-and-column steps through an array or grid. band called a highway.
The original mathematical setting is an infinite grid. This laboratory uses a finite grid with wrapping edgesDefinition: An edge is a connection between two nodes in a graph., so a long run can eventually meet its earlier path. The finite highway detector checks a stated number of repeats; it does not prove endless continuation or a highway for every possible starting pattern.
Why it starts to make sense
Intuition, before any argument
Two observations do most of the work, and neither of them explains the road.
The ant reads what it wrote. Every square it leaves has changed, so the grid is a message the ant is writing to itself. That is why a rule with no memory can behave as though it has one, and it is also why nothing about the ant can be predicted by looking only at the rule. The interesting object is not the ant. It is the ant together with the grid it has already coloured.
Nothing can ever be undone by accident. Take the ant at any moment and ask where it just came from. It stepped forward in the direction it is now facing, so it came from the square immediately behind it. That square was flipped on the way out, so flipping it back recovers what the ant actually read, and what it read is precisely what decided the turn. Undo the turn and you have the heading it arrived with. Every state has exactly one predecessor, computed rather than searched for.
The consequence is worth pausing on, and it is smaller than it first looks. A machine that can always be run backwards can never fall into a loop, because falling in would need two different states leading into the same one. So the ant cannot wander for a while and then settle into a cycleDefinition: A cycle is a repeating loop of states reached by a rule..
It can, however, be in a cycleDefinition: A cycle is a repeating loop of states reached by a rule. from its very first step, and reversibility says nothing against that. Set the turn word to LL and watch: the ant walks a two-by-two square, uncolours everything it coloured, and after eight steps it is on the square it started on, facing the way it started, with an empty grid in front of it. Then it does the same eight steps again, forever. That run is reversible like every other, and it never leaves a patch four squares across. So a turn word can be periodic, and the statement that the ant must travel arbitrarily far is a theoremDefinition: A theorem is a mathematical statement established by a proof from accepted definitions and earlier results. about RL rather than about ants in general.
For RL the loop is ruled out too, by a published argument about the boundary of the region the ant has visited. This page cites that argument and does not reproduce it, which is worth saying plainly, because the reversibility above is the part you can check yourself and it is not the part that does the work.
Either way it is a long way from explaining the road. It says the RL ant will not stop; it says nothing about why it starts building something so regular that a person can measure its periodDefinition: For a sequence, a period is a positive shift that leaves every comparable entry unchanged..
The key idea
Where the number comes from, and what it is a number about
The sentence worth carrying away is this one.
The step at which the road begins is not a fact about the rule. It is a fact about the rule, the starting grid, and a definition of "road" that somebody had to choose.
All three parts of that are load-bearing, and the laboratory lets you test each one.
Change the starting grid and the number moves. Colour four squares around the ant before it starts, which the control panel will do for you, and the road appears at step 542 rather than step 9,976. The rule did not change; the message the ant reads first did.
Change what counts as a road and the number moves again. This page uses a criterion it states in full: the road begins at the first step from which the trajectory is exactly itself, translated, over eight consecutive stretches of 104 steps. Demand fewer stretches and you would accept flimsier evidence; demand more and you would push the number later. As it happens the number is the same at two, four, eight, sixteen and twenty-four stretches for this run, which is checked in the test suite, and that stability is a small piece of evidence that the criterion is measuring something real rather than being tuned to a nice answer.
What does not change is the shape of what happens. Every finite starting configuration anybody has run has eventually produced a road. Nobody has proved that one has to.
Formal statement
Precisely what is being claimed
Let the grid be , with a colouring in which all but finitely many squares hold . A turn word is a string . The ant's state is with and one of four headings, and one step is
Write for the position before step , and for a periodDefinition: For a sequence, a period is a positive shift that leaves every comparable entry unchanged. define .
- Each step has a unique predecessor, so the map on states is injectiveDefinition: A function is injective when different inputs always produce different outputs.. Proved, and reproduced here.
- For and any starting colouring with finitely many coloured squares, the trajectory is unbounded. Proved in the literature, cited rather than reproduced.
- From the empty grid with , the smallest with and for all is , with and . Observed, in exactly one run of the computation described in the ledger.
- Whether every finite starting colouring with eventually admits such an is open.
- For , the number of coloured squares changes by exactly at every step. Proved.
Statement 3 is the one the page is arranged around, and it is the weakest of the five: it is a measurement, and its scope is one run.
Proof
Of the parts that admit one
Every step is reversible. Given the state after a step, let be the current heading and the current position. The step moved the ant forward along , so . The step also advanced the colour of , so recovers the colour that was read. That colour selects the letter of the turn word, and recovers the heading. Every quantity on the right is available and the result is unique, so the map on states is injectiveDefinition: A function is injective when different inputs always produce different outputs.. ∎
Therefore the ant never repeats a state, once the published theoremDefinition: A theorem is a mathematical statement established by a proof from accepted definitions and earlier results. is granted. Suppose for . Applying the inverse times gives , so the trajectory is periodic with periodDefinition: For a sequence, a period is a positive shift that leaves every comparable entry unchanged. from the start, and in particular it visits finitely many states. But each of the first steps moved the ant to an adjacent square and the colouring is determined by the states, so periodicity in the state forces periodicity in the position, and the ant would be confined to a bounded region. The published theorem rules that out for the plane. Here, the point that stands on its own is the injectivity: no finite computation is being trusted, and no step limitDefinition: A limit is the value that a sequence or function approaches under a stated limiting process. is being mistaken for an answer. ∎
The count of coloured squares moves by one, for a two-letter word. One step touches exactly one square and changes its colour from to or from to . Both cases change the number of non-zero squares by exactly one, in opposite directions. Hence the graphDefinition: A graph is a collection of nodes joined by edges that record relationships or transitions. in the "coloured squares" view is made of unit steps, and any straight stretch of it means the ant is adding the same number of squares per periodDefinition: For a sequence, a period is a positive shift that leaves every comparable entry unchanged., which is what a repeating sequenceDefinition: A sequence is an ordered list of values, usually indexed by whole numbers. of moves does. ∎
What is not proved here. The road. Not that it begins at step 9,976, which is a measurement of one run; not that it begins at all, which is the open question; and not that it continues forever once begun, which this page checks only as far as it runs. The straight-line extrapolation drawn on the counts view stops where the computation stops, deliberately.
Limits and frontier
Where this page stops being able to help
What this laboratory computes. Up to 50,000 steps of one ant on a square torusDefinition: A torus is a surface shaped like a doughnut, or a rectangle whose opposite edges are identified., at most 2,001 squares on a side, in exact integerDefinition: An integer is a whole-number value, including zero and negative whole numbers, with no fractional part. arithmetic with no floating point anywhere in the rule. The torus is a compromise the mathematics does not make: leaving the right edgeDefinition: An edge is a connection between two nodes in a graph. arrives at the left, so a run that reached the edge would be a picture of a different machine. Every run therefore records whether it got near the edge, and the widths are chosen, and re-measured in the test suite, so that none of the runs offered here does.
A run of fifty thousand steps that finds nothing has found nothing. The turn word LRRRRRLLR
stays within 43 squares of its start for the whole run and the detector reports no road at any
periodDefinition: For a sequence, a period is a positive shift that leaves every comparable entry unchanged. it examines. That is not evidence that it never builds one. By the cited theoremDefinition: A theorem is a mathematical statement established by a proof from accepted definitions and earlier results. it is going
to leave any region you draw around it eventually, and this page simply stops watching first. The
ledger marks that result observed for exactly this reason.
Where the mathematics is still moving. The open question is whether every finite starting configuration eventually produces a road. It has resisted since the ant was first studied, and one reason to expect it to keep resisting is that the ant is powerful enough to simulate an arbitrary computation given a suitable starting grid: a short general argument about what it always does would be a short general argument about what every computation does. Related questions with rather more progress behind them concern turn words longer than two letters, where some words provably fill the plane with a symmetricDefinition: A symmetry is a transformation that leaves an object looking exactly the same. pattern and others are as opaque as RL.
Read this next to the Collatz orbit atlas. The two pages are the same predicament in different clothing: a rule small enough to write on a hand, a pattern that every computation anybody has run agrees on, and a general statement that no amount of computation touches. Reading them together makes the distinction this whole site is built around concrete, because in both cases the evidence is overwhelming and the question is open, and those two facts are not in tension.
What is actually established
Every statement on this page, with its status, its exact scope, and the date that status was last checked.
From the stated empty grid, the RL run satisfies the eight-window highway criterion beginning at step 9,976, with a displacement of two squares west and two squares south per 104-step block.
- Scope
- One run: the turn word RL, an empty grid, the ant starting at the centre facing north, on a torus 481 squares across which the ant never leaves. The step is the first at which the criterion below holds for eight consecutive windows. It is a fact about this run and this criterion together, and both halves of that matter: colouring four squares in advance moves it to step 542.
- Why
- The criterion, exactly. Write p(t) for the position before step t and D(t) for p(t + 104) − p(t). The road is said to begin at the smallest step s for which D(s) is not zero and D(t) equals D(s) for every t from s to s + 832, that is for every one of eight consecutive periods rather than only at the multiples of 104. That quantifier is the whole content of the test: it says the trajectory from s onwards is that stretch of itself translated, which is what a road is, rather than merely that the ant keeps arriving 104 steps ahead of where it was. The step 9,976 is unchanged when two, four, sixteen or twenty-four windows are demanded instead of eight, which is checked in the test suite. Nothing here is evidence that a road has to appear.
- Status checked
For the turn word RL, whatever finite set of squares is coloured to begin with, the ant never stays inside any bounded region: it visits squares arbitrarily far from where it started.
- Scope
- The turn word RL only, over every starting configuration in which finitely many squares are coloured and all of the infinitely many steps. Proved in the literature for that rule and cited here; this page runs one ant and proves nothing. Other turn words are not covered, and some of them are periodic.
- Why
- The argument turns on the ant being unable to repeat a state. Each square it leaves has advanced its colour, and the rule reads only the square underneath, so a step is reversible: from the current square and heading there is exactly one square the ant can have come from, and exactly one colour that square must have held. A machine whose steps are reversible can never enter a loop from outside it, because entering one would require two different states to lead to the same next state. Confined to a bounded region the ant would have only finitely many states available and would have to repeat one, and reversibility then forces the whole run to be a single loop closing back on the starting state rather than a tail leading into one. Reversibility does not by itself rule that loop out, and this page does not pretend it does: the published proof is about the turn word RL and rules the loop out by an argument about the boundary of the visited region, and that is the half cited rather than stated here. That the loop has to be ruled out separately is not a technicality. The turn word LL, from an empty grid, walks a two-by-two square, clears every cell it coloured and comes back to its exact starting square, heading and grid after eight steps, and then does it again forever. It is reversible like every other turn word and it is periodic, so reversibility alone settles nothing about how far an ant travels. The kernel test suite runs those eight steps and checks the state that comes back.
- Status checked
Whether every finite starting configuration eventually produces a road is unknown.
- Scope
- The general question, over all finite starting configurations of the turn word RL. Every configuration anyone has run has produced a road, and that is a statement about the configurations anyone has run.
- Why
- This is the question the page exists to hand over, and the shape of it is worth noticing. The road is not rare or delicate: it turns up from every starting grid that has been tried, usually within a few tens of thousands of steps, and it is stable enough that this laboratory can detect it with a criterion written in one line. None of that is an argument. The ant has no invariant anyone has found that forces the road, and it is powerful enough to simulate an arbitrary computation given the right starting squares, which is a reason to expect the general question to be hard rather than a proof that it is.
- Status checked
Every step of the ant can be undone, and each state has exactly one predecessor.
- Scope
- Every turn word, every starting configuration, every step.
- Why
- A complete argument, and a short one. Suppose the ant is on a square facing some direction. It arrived by stepping forward in that direction, so it came from the square immediately behind it. That square had its colour advanced by one on the way out, so rolling the colour back one recovers the colour the ant actually read, and that colour names the letter of the turn word that produced the current heading. Undoing that turn recovers the heading it arrived with. Nothing was searched for and nothing was assumed: the predecessor is computed. The laboratory’s kernel implements exactly this as an inverse step, and the test suite runs whole trajectories backwards and checks that the grid comes out empty. What this does not give you is that the ant keeps finding new states. A reversible machine cannot run into a cycle sideways, but it can be sitting in one from the first step, and the turn word LL is: eight steps from an empty grid return it to that exact grid, square and heading. Reversibility rules out the tail, not the loop.
- Status checked
With a two-letter turn word, each step changes the number of coloured squares by exactly one.
- Scope
- Every two-letter turn word and every starting configuration.
- Why
- One step touches exactly one square and flips it, so the count goes up by one when a background square is coloured and down by one when a coloured square is cleared. It never stays the same. That is why the graph of coloured squares against steps is made of unit moves and why a straight stretch of it means the ant is repeating itself rather than merely being busy. With a longer turn word a square can advance from one colour to another without changing the count, so this stops being true and the page stops saying it.
- Status checked
The turn word LRRRRRLLR builds no road within fifty thousand steps: every square it touches lies within 43 squares of its start, and the detector finds nothing at any period up to 208.
- Scope
- One run of fifty thousand steps from an empty grid, with the detector confirming each candidate period over at least 832 steps of trajectory, which is eight windows of the original ant’s 104-step road. It says nothing about step fifty thousand and one.
- Why
- Included because it is the honest shape of a negative result here. The ant is still moving, still colouring squares, and by the cited theorem it will eventually leave any region you draw around it; what it has not done is settle into a repeating road inside the run this page performs. Compare it with RL over the same fifty thousand steps, which has by then travelled 787 squares from its start. The contrast is the point, and the absence is not a proof of absence.
- Status checked
Sources
Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.
- Christopher G. Langton, Studying artificial life with cellular automata, Physica D: Nonlinear Phenomena 22, pp. 120–149, 1986. Link
Where the ant is introduced, as one of a family of very small machines built to ask how little a rule can contain and still produce structure. Cited for the origin of the rule rather than for any number on this page.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: source text.
University archive supplies the original Physica D paper.
- Leonid A. Bunimovich, Serge E. Troubetzkoy, Recurrence properties of Lorentz lattice gas cellular automata, Journal of Statistical Physics, 1992. Link
The theorem that the ant’s trajectory is unbounded: it cannot be confined to any finite region of the plane, whatever the starting configuration, provided only finitely many squares are coloured to begin with. Cited for a result this page does not prove and could not: no finite run can establish a statement about every step.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: library record.
Research bibliography identifies both authors and the 1992 Journal of Statistical Physics article.
- David Gale, James Propp, Scott Sutherland, Serge Troubetzkoy, Further travels with my ant, The Mathematical Intelligencer 17(3), pp. 48–56, 1995. Link
Where the highway question is stated as a question. Every finite starting configuration anyone has run has eventually produced the road, and nobody has proved that one has to. Cited for the open problem, and for the survey of turn words longer than two letters.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: author record.
Author submission confirms title and four authors; Propp's university CV confirms the 1995 journal appearance.
- Anahí Gajardo, Andrés Moreira, Eric Goles, Complexity of Langton’s ant, Discrete Applied Mathematics 117(1–3), pp. 41–50, 2002. Link
The result that the ant is powerful enough to compute anything a computer can, given a suitable starting configuration. Cited in the closing layer as the reason not to expect a short argument for the highway.
Bibliographic record checked. This is not an independent verification of the proof.
Bibliographic review:
AI-assisted bibliographic audit. Evidence type: author record.
Author submission explicitly gives the final 2002 journal reference despite the 2003 preprint upload.
Related by mechanism
Connected by how they work, not by sharing a topic label.