eureka
experiment 029 · fractal geometry · iteration

Chaos Game

A simple geometric rule generating intricate fractal patterns. Plot a point, pick a random vertex of a polygon, and plot the next point at a fixed fraction of the distance towards it. Repeat thousands of times. Out of randomness emerges perfect structure.

The Algorithm

The Chaos Game is a method of generating fractals using a simple iterative process. First, define a regular polygon with $n$ vertices. Then, pick a random starting point anywhere on the plane.

In each step, choose one of the polygon's vertices at random. Plot a new point at a specific fraction $r$ of the distance from the current point to the chosen vertex. The new point becomes the starting point for the next iteration.

Sierpinski Triangle

The most famous example is generated by a triangle ($n=3$) with a distance fraction of $r=0.5$. Despite the randomness of the vertex choices, the sequence of points will inevitably trace out the Sierpinski triangle. Any point outside the fractal will quickly be drawn into it within a few iterations.

Restrictions

If we increase the number of vertices, say to a square ($n=4$) with $r=0.5$, the points will eventually fill the entire interior uniformly. To generate fractals with higher-order polygons, we must introduce rules restricting which vertex can be chosen next:

Experimenting with the number of vertices, the distance fraction, and these exclusion rules reveals a vast family of intricate, self-similar attractors emerging entirely from constrained random walks.

← back to workshop