Iterated function systems
Pick a polygon. Start anywhere. Roll a die, jump partway toward that vertex, mark the spot, repeat forever. On a square this fills in a dull grey blob. Then forbid one thing — never pick the same vertex twice in a row — and a Sierpiński-like fractal appears out of the same randomness. Everything below is computed live in your browser.
Each button is a step relative to the vertex you just used. Switch one off to forbid that move.
The chaos game is three lines long, and that is the point — no fractal is designed, drawn, or subdivided anywhere in it. The structure is a side effect of which moves you refuse to make.
Each jump is a contraction: it shrinks the whole plane by a factor of 1 − r toward the chosen vertex. With every move allowed, the attractor is n shrunken copies of itself. Forbid some moves and it becomes A copies instead, where A is the number of offsets left switched on. Because the rule is written as offsets, it applies identically at every vertex — the transition matrix is circulant, so its Perron eigenvalue is exactly A, and the similarity dimension collapses to something you can read straight off the controls:
D = log A ⁄ log ( 1 ⁄ (1 − r) )
A square with every move allowed gives log 4 / log 2 = 2 — a solid blob, exactly what you see. Ban the repeat and A drops to 3: log 3 / log 2 = 1.585, the Sierpiński triangle's dimension, on a square. Nothing about the geometry changed. One outlawed move removed half a dimension.
The formula assumes the A copies don't overlap. When it returns more than 2 they must — the pieces collide, the excess is wasted, and the measured value falls below the prediction instead of matching it. The plate flags that case as it happens.
Before building this page I ran the same simulation offline: 6 million points per configuration onto a 1024 × 1024 grid, box-counted across five scales, dimension read off the log–log slope. Prediction against measurement:
| Polygon | r | Rule | A | Predicted | Measured | Δ |
|---|---|---|---|---|---|---|
| Triangle | 0.500 | all moves | 3 | 1.585 | 1.597 | +0.012 |
| Square | 0.500 | all moves | 4 | 2.000 | 1.975 | −0.025 |
| Square | 0.500 | no repeat | 3 | 1.585 | 1.594 | +0.009 |
| Square | 0.500 | no neighbour | 2 | 1.000 | 0.999 | −0.001 |
| Square | 0.500 | no opposite | 3 | 1.585 | 1.580 | −0.005 |
| Pentagon | 0.618 | all moves | 5 | 1.672 | 1.668 | −0.004 |
| Pentagon | 0.618 | no repeat | 4 | 1.440 | 1.430 | −0.011 |
| Pentagon | 0.500 | no repeat | 4 | 2.000 | 1.827 | copies overlap |
| Hexagon | 0.667 | all moves | 6 | 1.631 | 1.619 | −0.012 |
| Hexagon | 0.667 | no repeat | 5 | 1.465 | 1.436 | −0.029 |
| Hexagon | 0.667 | no neighbour | 4 | 1.262 | 1.267 | +0.005 |
| Heptagon | 0.692 | all moves | 7 | 1.652 | 1.649 | −0.003 |
| Heptagon | 0.692 | no repeat | 6 | 1.521 | 1.525 | +0.003 |
Twelve of the thirteen land within 0.03 of the prediction — ordinary box-counting bias at finite resolution. The thirteenth misses by 0.17, and it is precisely the row where the formula returns 2.0 for a set whose four copies are known to overlap. The one configuration that breaks the rule is the one the rule says it cannot describe.
Ban both neighbours on a square and the orbit is trapped between two opposite vertices — the attractor is a straight vertical line, dimension exactly 1. For a long time this plate read about 0.84 for it, roughly half the times you loaded it, and blamed the gap on convergence or overlapping copies. Both were wrong.
cos(π/2) is 6.1 × 10⁻¹⁷, not 0, so the line's true x sits a hair right of centre. A run that happens to start on the negative side crosses zero about fifty steps in, and the few points plotted before it does land one pixel column to the left. That column falls on the plate's exact midpoint, so no halving ever merges the two — the strays add a constant to the count at every scale, and a constant on top of a halving sequence bends the fitted slope down. Burning the transient to below float noise fixes it; the burn-in is now sized from r rather than fixed at 30 steps.
Worth keeping in mind while reading any measured column on this page: the prediction was right, the mathematics was right, and the instrument was quietly wrong in a way that looked like physics.