On this page
Michael Barnsley's fern looks like a leaf pressed in a botany notebook, yet it comes from four short formulas and a random number generator. Barnsley described it in his book *Fractals Everywhere* and made it to resemble the black spleenwort fern, as the Barnsley fern article records. If you can multiply a 2×2 matrix by a vector, you can follow every step.
What is the Barnsley fern iterated function system?
An iterated function system (IFS) is a finite set of contraction mappings: maps that bring any two points closer together. The idea dates from John Hutchinson's 1981 paper and was popularised by Barnsley's book (iterated function systems). In 1985 Barnsley and S. Demko of Georgia Tech presented IFSs as a unified way of generating a broad class of fractals, in the Proceedings of the Royal Society A.
Each of the fern's maps is affine: multiply the point by a 2×2 matrix, then add a shift, so f(x, y) = (ax + by + e, cx + dy + g). Our guide to what affine transformations keep and change works through that form first.
What does each of the four maps do?
These are Barnsley's coefficients and probabilities, as tabulated in the Barnsley fern article and in Wolfram MathWorld:
f1, picked 1% of the time: (x, y) → (0, 0.16y). It squashes the whole fern onto the stem, the segment from (0, 0) to (0, 1.6).
f2, picked 85% of the time: (x, y) → (0.85x + 0.04y, −0.04x + 0.85y + 1.6). It shrinks the fern to about 85%, turns it slightly clockwise and lifts it by 1.6: the whole fern minus its bottom pair of leaflets.
f3, picked 7% of the time: (x, y) → (0.20x − 0.26y, 0.23x + 0.22y + 1.6). It shrinks the fern to about 30% and turns it roughly 50° anticlockwise: the largest left leaflet.
f4, picked 7% of the time: (x, y) → (−0.15x + 0.28y, 0.26x + 0.24y + 0.44). A similar shrink with a mirror flip: the largest right leaflet, attached lower down the stem.
Check it yourself: f3 sends (1, 0) to (0.20, 0.23) and (0, 1) to (−0.26, 0.22), each turned about 50°. f4's determinant is (−0.15)(0.24) − (0.28)(0.26) ≈ −0.109; a negative determinant means a reflection. The fern's tip is the fixed point of f2 (MathWorld again): solving x = 0.85x + 0.04y and y = −0.04x + 0.85y + 1.6 gives about (2.66, 9.96).
How does the chaos game draw the fern?
The chaos game draws an IFS: start at a point, pick a map at random, apply it, plot the new point, repeat (iterated function systems). The fern needs tens of thousands of iterations, so a computer does the drawing (Barnsley fern article), but you can do the first five on paper, starting from (0, 0):
f2 sends (0, 0) to (0, 1.6), the top of the stem.
f2 again sends it to (0.064, 2.96), further up the spine.
f3 sends it to (−0.757, 2.266), out on the lowest left leaflet.
f4 sends it to (0.748, 0.787), on the lowest right leaflet.
f1 sends it to (0, 0.126), back on the stem.
Because (0, 0) already lies on the fern and each map sends the fern into a part of itself, every dot lands on the fern, whatever order the dice choose.
Why is the fern the only picture the maps can make?
John Hutchinson proved, in the Indiana University Mathematics Journal in 1981, that a finite family of contractions leaves exactly one nonempty closed and bounded set unchanged. Here that means one set S with S = f1(S) ∪ f2(S) ∪ f3(S) ∪ f4(S), and for Barnsley's maps that set is the fern.
The trick is to treat a whole shape as a single point. The rule "replace a shape by the union of its four images" brings any two shapes closer together, so the contraction mapping theorem gives it exactly one fixed shape, and repeating the rule from any starting shape converges to it. Start from a square or your initials: you end at the same fern. The probabilities never change the shape, only where the ink is dense.
How do you grow a new plant by changing coefficients?
Playing with the coefficients produces mutant ferns, as the Barnsley fern article shows. Code a chaos game, plot a few hundred thousand points, then try these one at a time, predicting each result first:
Straighten the spine. Set f2's b and c to 0. f2 is now a pure shrink and lift, so its fixed point, the fern's tip, moves to (0, 1.6/0.15) ≈ (0, 10.67).
Curl the frond. Set f2's b to 0.08 and c to −0.08. Each step up turns about twice as far, so the frond bends over.
Shorten it. Change f2's two 0.85s to 0.75. The tip moves to about (1.0, 6.24): fewer, faster-shrinking leaflets.
Slim the leaflets. Halve a and c in f3 and f4. Those entries carry the fern's width into each leaflet.
Keep every map shrinking, or the dots can fly off instead of settling onto a plant.
If matrices as transformations or fixed points still feel shaky, the Fermi Concept Library gives every concept in mathematics its own lesson, so you can fill the gap before you experiment. To work through problems with a step-by-step solver that explains the reasoning, try the Fermi Problem Library.
Once your fern grows, measure how rough it is with box-counting fractal dimension.



