Chaos game
Place the vertices of a polygon. Pick one at random. Jump a fraction of the distance toward it. Plot a dot. Repeat. From this absurdly simple procedure, intricate fractal structure emerges — the Sierpinski triangle, pentaflakes, and dozens of other forms, all generated by pure randomness constrained by a single ratio.
xn+1 = xn + r · (vk − xn) | r = jump ratio, vk = random vertex
Order from pure randomness
The chaos game produces one of the most counterintuitive results in mathematics: deterministic structure from a purely random process. There is no blueprint, no template, no recursion in the algorithm itself. You simply pick a random vertex, jump a fraction of the way there, and plot. After a few hundred iterations, nothing is visible. After ten thousand, the Sierpinski triangle has assembled itself from noise. The fractal was always latent in the rule — randomness just reveals it, one point at a time.
Iterated function systems
What the chaos game actually computes is an Iterated Function System (IFS). Each vertex defines a contraction mapping: a function that pulls any point closer to that vertex by the jump ratio. The collection of these contractions has a unique fixed set — the attractor — and the chaos game converges to it regardless of the starting point. Michael Barnsley formalized this theory in the 1980s, proving that any IFS with contractive maps has exactly one attractor, and the random iteration algorithm will always find it. The Sierpinski triangle is the attractor of three contractions, each shrinking toward one vertex of a triangle by a factor of 0.5. The same triangle you would get from recursive subdivision — two completely different constructions converging on the same object.
Why restrictions change everything
The unrestricted chaos game with a square and ratio 0.5 fills the entire square — no fractal at all. But add the constraint that you cannot pick the same vertex twice in a row, and a striking fractal appears. Restrictions work by forbidding certain sequences of contraction maps. This prunes branches from the tree of possible orbits, and the pruned tree has a different attractor. The restriction “can’t repeat the same vertex” is equivalent to saying that no contraction map can follow itself — it removes the diagonal of the transition matrix. Different restrictions carve different subsets of the attractor, producing different fractals from the same set of vertices and the same ratio. The geometry of the fractal encodes the grammar of allowed sequences.
Barnsley and the collage theorem
Michael Barnsley’s Collage Theorem (1988) provides the theoretical foundation. It states that if a set can be approximately covered (“collaged”) by reduced copies of itself under a collection of contraction mappings, then the attractor of those mappings will approximate the set. This is why ferns, trees, and coastlines — natural objects that exhibit self-similarity — can be encoded as IFS with remarkably few parameters. Barnsley famously encoded a realistic fern using just four affine transformations. The chaos game is the simplest algorithm for rendering these attractors: no recursion, no stack, no bookkeeping — just a random walk that converges to the fractal.
The same object, two paths
The Sierpinski triangle can be constructed by recursive subdivision: start with a filled triangle, remove the central inverted triangle, repeat for each remaining triangle, ad infinitum. It can also be constructed by the chaos game: pick random vertices, jump halfway, plot. These are profoundly different procedures — one deterministic and top-down, the other stochastic and bottom-up — yet they converge to exactly the same set. This is not coincidence but a theorem: the attractor of the IFS is unique, and every algorithm that faithfully iterates the contraction maps will converge to it. The fractal is the fixed point of a map on the space of sets, and fixed points do not care how you reach them.