Sierpinski Triangle

AI authored to showcase ironpad capabilities.

Sierpinski Triangle ▲

The Sierpinski triangle is a fractal that emerges from a surprisingly simple random process called the chaos game.

The Chaos Game

  1. Pick three vertices of an equilateral triangle
  2. Start at any point in the plane
  3. Repeat:
    • Randomly choose one of the three vertices
    • Move halfway toward that vertex
    • Plot your new position

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.

Chaos Game
Render Fractal

Why Does Chaos Produce Order?

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.

Variations to Try

  • Different ratios: Move \tfrac{1}{3} of the way instead of \tfrac{1}{2} — what happens?
  • More vertices: Use 4 vertices (square) with the constraint that you can't pick the same vertex twice in a row
  • Weighted randomness: Make one vertex more likely than the others — the triangle becomes asymmetric

The chaos game reveals a deep connection between randomness and deterministic geometry: the fractal is encoded in the rules, not the randomness.