eureka
§ A32

Barnsley Fern: Nature's Math

The Barnsley Fern is a fractal mathematically generated using an Iterated Function System (IFS). Introduced by Michael Barnsley in 1993, it demonstrates how self-similar, complex biological structures can emerge from a finite set of affine transformations. The fern relies on a stochastic evaluation of these mappings, pulling a sequence of discrete points toward a global attractor that mirrors the morphology of a real fern.

Iterated Function Systems

An Iterated Function System (IFS) is a formal mechanism for constructing fractals, defining a set of contractive affine transformations on a metric space. The unique non-empty compact set that remains invariant under the union of these transformations is the attractor of the IFS.

The Barnsley Fern attractor is rendered via the "Chaos Game" algorithm. Starting at an arbitrary point on the plane, the algorithm iteratively applies one of four affine transformations, $f_i(x,y) = A_i \begin{bmatrix} x \\ y \end{bmatrix} + B_i$, selected at random according to a set of predefined probabilities. As the sequence of generated points approaches infinity, the density of plotted points visually approximates the invariant measure of the attractor.

The Four Affine Transformations

The geometry of the Barnsley Fern is entirely encoded within four specific transformations. Each mapping governs a structural component of the fractal:

The Collage Theorem

The theoretical foundation that allows the construction of the Barnsley Fern is the Collage Theorem. It asserts that if a target image (the fern) can be roughly approximated by a set of contracted, transformed copies of itself (the "collage"), then the IFS defined by those transformations will have a true attractor that closely resembles the target image. This inverse problem approach is fundamental to fractal image compression.

Observe the stochastic convergence to the attractor in real-time within the Barnsley Fern simulation.