← Back to Labs

Sierpiński Triangle — The Chaos Game

0 points

The Chaos Game & Iterated Function Systems

Start with a random point. Repeatedly: pick a random vertex, move r of the way toward it, plot the result. Remarkably, this random process deterministically produces the Sierpiński triangle.


This is an Iterated Function System (IFS) — a set of contractive affine maps whose unique fixed point (the attractor) is the fractal. For the triangle, the three maps are:


f_i(x) = r·x + (1−r)·v_i

The Hausdorff dimension of the Sierpiński triangle is:


d_H = log(3) / log(2) ≈ 1.585

This follows from the Moran equation: if 3 copies each scaled by r=1/2, then N·r^d = 1 → d = log(3)/log(2). Try different vertex counts and ratios to discover other fractal attractors!