AI authored to showcase ironpad capabilities.
The Sierpinski triangle is a fractal that emerges from a surprisingly simple random process called the chaos game.
Despite the randomness, the plotted points converge to a self-similar fractal, the Sierpinski triangle, with Hausdorff dimension \log 3 / \log 2 \approx 1.585.
Vec<(f64, f64)>, len = 50000, [(0.25, 0.14433756729740643), (0.625, 0.07216878364870322), (0.3125, 0.03608439182435161), (0.40625, 0.4510548978043951), (0.703125, 0.22552744890219756), (0.3515625, 0.11276372445109878), (0.67578125, 0.05638186222554939), (0.587890625, 0.461203633004994), (0.7939453125, 0.230601816502497), (0.89697265625, 0.1153009082512485), (0.448486328125, 0.05765045412562425), (0.7242431640625, 0.028825227062812125), (0.61212158203125, 0.44742531542362535), (0.306060791015625, 0.22371265771181267), (0.1530303955078125, 0.11185632885590634), (0.07651519775390625, 0.05592816442795317), (0.038257598876953125, 0.027964082213976584), (0.5191287994384766, 0.013982041106988292), (0.2595643997192383, 0.006991020553494146), (0.12978219985961914, 0.003495510276747073), ...]
(output too large to embed; run the cell to regenerate it)
The chaos game works because of iterated function systems (IFS). Each "move halfway to a vertex" is a contraction mapping that shrinks the plane by a factor of \tfrac{1}{2}. The Sierpinski triangle is the unique attractor of these three contractions: regardless of the starting point, the orbit converges to the same fractal.
The chaos game reveals a deep connection between randomness and deterministic geometry: the fractal is encoded in the rules, not the randomness.