No. 028 · Chaos game

150,000 random jumps draw a fern

Four shrink-and-turn rules, picked at random. After 150,000 jumps the dots draw Barnsley's fern.

85% · 7% · 7% · 1%: four shrink-and-turn rules

A dot starts at the foot of the stem. At every step one of four rules is picked at random, and the dot jumps to wherever that rule sends it. Each rule shrinks the plane, turns it a little and shifts it. After 150,000 jumps the dots draw a fern. The colour shows height: pink at the base, cyan at the tip.

Four rules

ChanceWhat the rule does
85%shrinks everything to 85%, tilts it slightly and lifts it up
7%squeezes the whole fern into the lowest leaflet on the left
7%the same for the lowest leaflet on the right, flipped
1%flattens everything onto the stem

The first 10 jumps are shown slowly, and they look like noise. Then thousands land at once and the fern appears.

Why it's a fern

Each rule maps the whole fern onto one part of itself. The 85% rule moves it up to the next smaller copy, so the frond is the bottom pair of leaflets plus a smaller frond above them. Each leaflet is itself a small fern, with its own leaflets, and so on.

The fern is the one shape that equals the four shrunk copies of itself put together. Shrinking always pulls points closer, so wherever the dot starts, after a few jumps it is on the fern and stays there. The random choices only decide where on the fern it lands next.

This is Barnsley's fern, from Michael Barnsley's 1988 book Fractals Everywhere. Each of its four rules has the same form, with its own six numbers:

x' = a·x + b·y + e, y' = c·x + d·y + f

Part of Chaos game (2 videos): Jump part of the way to a random corner, again and again. A fractal appears from noise.

Use this picture

SVGJPG

Free to reuse, also commercially, under CC BY 4.0. Credit “What Math Means” with a link to whatmathmeans.dev/v/150000-jumps-draw-a-fern.