2 videos

Chaos game

Jump part of the way to a random corner, again and again. A fractal appears from noise.

Pick a point, pick a random rule from a short list, apply it, mark the spot, and repeat. The first few dots look like noise. After thousands of jumps, a perfectly regular fractal appears: a Sierpiński triangle, or a fern. This series shows how a random process can draw something that isn't random at all.

How it works

Each rule is a shrinking copy machine. A rule like "jump halfway to corner A" takes the whole plane and shrinks it, here to a half-size copy next to corner A. In Barnsley's fern every rule has the form x' = a·x + b·y + e, y' = c·x + d·y + f, which can shrink, turn, tilt and shift. A set of such shrinking rules is called an iterated function system.

There is exactly one shape that the rules rebuild. For each set of shrinking rules there is a single shape that equals the union of its own shrunk copies. For three half-way jumps it is the Sierpiński triangle, made of three half-size copies of itself with the middle missing. For the fern's four rules, each rule maps the whole fern onto one part of it: the next smaller frond, a lowest leaflet, or the stem.

Why randomness finds it. Every rule pulls points closer together, so each jump also brings the dot closer to the fractal. With half-way jumps the distance halves every time: after 10 jumps it is 1,024 times smaller, less than a pixel. Once the dot is on the fractal, every rule keeps it on the fractal. The random choices only decide where on it the dot lands next, and over many jumps every part gets visited.

The chances set the density, not the shape. In the fern the main rule is picked 85% of the time and the stem rule only 1%. Those chances don't change the shape the rules rebuild. They decide how quickly each part fills with dots, so the picture comes out evenly shaded.

What changes from video to video

  • No. 022: three corners, jump half way, 100,000 jumps: the Sierpiński triangle.
  • No. 028: Barnsley's four rules, 150,000 jumps: a fern.

Go further

Try it

Try 5 or 6 corners, then move the jump fraction until the copies just touch.