Fractals and Self-Similarity

The fractal geometry of L-system output is not a visual impression. It is a mathematical consequence of the recursive rewriting structure. An L-system applies the same production rule at every generation, replacing each instance of a symbol with the same pattern. The result is a structure that contains copies of itself at every scale --- the defining property of a fractal.

L-Systems as Fractal Generators

Several canonical mathematical fractals can be specified as L-systems. In each case, the production rule encodes the self-similar construction step directly.

The Koch curve. Axiom: F. Rule: F -> F+F—F+F, with angle delta = 60 degrees. At each generation, every straight segment is replaced by a segment with a triangular bump. The curve at generation n contains 4^n segments, each 1/3^n the length of the original. The limit object (as n approaches infinity) is a continuous curve that is nowhere differentiable: it has a “corner” at every point. The Koch snowflake is the closed figure formed by applying this construction to the three sides of an equilateral triangle.

The Sierpinski triangle. Two symbols: A and B. Rules: A -> B+A+B, B -> A-B-A, with delta = 60 degrees. Starting from axiom A, the curve traces out approximations to the Sierpinski triangle --- the fractal formed by repeatedly removing the central triangle from an equilateral triangle. At each generation, the curve visits all three sub-triangles at finer resolution.

The Dragon curve. Axiom: FX. Rules: X -> X+YF+, Y -> -FX-Y. The curve at generation n folds a strip of paper n times and unfolds it with all creases at 90 degrees. The limit is a space-filling curve that tiles the plane with copies of itself.

The Hilbert curve. A space-filling curve that visits every point in a unit square. It can be expressed as an L-system with rules that recursively subdivide the square into quadrants and connect them with a continuous path. At generation n, the curve passes through 4^n points on a 2^n x 2^n grid.

In each case, the L-system specification is compact --- an axiom and one or two production rules --- but the output at high generation count is geometrically rich. The fractal structure is not designed into the output; it is an automatic consequence of applying the same rule recursively.

Fractal Dimension

The standard measure of fractal complexity is the Hausdorff dimension (or, more practically, the box-counting dimension). For a set in d-dimensional Euclidean space, cover the set with boxes of side length r and count the minimum number N(r) of boxes required. If N(r) scales as r^(-D) as r approaches zero, then D is the fractal dimension.

For integer-dimensional objects, this recovers the usual dimension: a smooth curve has D = 1, a filled square has D = 2. Fractals have non-integer dimensions, indicating that they are “more than a line but less than a surface” or “more than a surface but less than a solid.”

For self-similar fractals generated by L-systems, the dimension is computable from the production rule parameters:

Koch curve. Each segment is replaced by 4 copies scaled by 1/3. D = ln(4)/ln(3) approximately equal to 1.2619. The curve is more than a line (it “fills” more of the plane than a smooth curve) but less than a surface.

Sierpinski triangle. Each triangle is replaced by 3 copies scaled by 1/2. D = ln(3)/ln(2) approximately equal to 1.585.

Hilbert curve. In the limit, it fills the entire unit square: D = 2. This is a space-filling curve --- a continuous surjection from the unit interval to the unit square.

Dragon curve. D = 2 in the limit --- it also fills a region of the plane, though the region has a complex boundary.

The formula D = ln(k)/ln(1/r), where k is the number of self-similar copies and r is the scaling ratio, applies to strictly self-similar fractals. For stochastic L-systems, where the production varies randomly at each step, the fractal dimension is defined in expectation and may differ from the deterministic case.

The Connection to Iterated Function Systems

L-systems and iterated function systems (IFS) are two formalisms for generating the same class of self-similar structures. The IFS approach, developed by Michael Barnsley in Fractals Everywhere (1988), specifies a set of contractive affine transformations. Applied iteratively (or randomly), these transformations converge to a unique fixed-point set --- the attractor --- which is the fractal.

The Barnsley fern. Four affine transformations, applied with probabilities 0.01, 0.85, 0.07, and 0.07, generate a recognizable fern frond. The first transformation collapses points to the stem base. The second maps the fern to a copy of itself rotated and translated upward (the main frond). The third and fourth map to the left and right sub-fronds. The result is a self-affine structure --- self-similar under different scaling in different directions --- that closely resembles Asplenium adiantum-nigrum (black spleenwort).

The equivalence between L-systems and IFS is formal for a class of deterministic L-systems. Prusinkiewicz and Hammel (1993) showed that any D0L system with a turtle graphics interpretation defines an IFS whose attractor is the limit set of the L-system derivation. Conversely, any IFS composed of similarity transformations can be expressed as a D0L system (though the L-system may be less compact).

The practical difference is in how the two formalisms are used. L-systems are generative --- they produce the structure step by step, generation by generation, and the intermediate stages have biological meaning (they represent the organism at earlier developmental stages). IFS are convergent --- they define the limit object directly, and the intermediate stages are approximations without independent meaning. For modeling biological development, L-systems are natural. For rendering static fractals efficiently, IFS (via the chaos game or deterministic algorithms) may be more direct.

Natural Fractals and Fractal Dimension as a Descriptor

Mandelbrot’s The Fractal Geometry of Nature (1982) argued that natural forms are better described by fractal geometry than by Euclidean geometry. Coastlines, cloud boundaries, mountain profiles, river networks, vascular systems, and tree branches all exhibit approximate self-similarity across a range of scales.

For tree branching structures, measured fractal dimensions fall in the range D = 1.5 to 2.0, depending on species. Deciduous trees with dense branching have higher dimensions (closer to 2.0, meaning their branches nearly fill a plane) than conifers with sparse branching (closer to 1.5).

This observation connects to two scaling laws from biology:

Leonardo da Vinci’s rule. Da Vinci noted that the total cross-sectional area of branches at any level of a tree is approximately constant --- the area of the trunk equals the sum of the areas of all branches at any height. This area-preserving branching implies a specific relationship between parent and daughter branch diameters that L-systems can implement as a parametric rule.

Murray’s law (1926). In vascular systems (blood vessels, plant xylem), the cube of the parent vessel’s radius equals the sum of the cubes of the daughter vessels’ radii. This minimizes the total work of transport (pumping blood or sap) through the branching network. Murray’s law predicts a specific fractal dimension for vascular networks, and West, Brown, and Enquist (1997) used this to derive the 3/4-power scaling law relating metabolic rate to body mass across organisms spanning 27 orders of magnitude in size.

The connection between L-system geometry, fractal dimension, and biological scaling laws is not a metaphor. The branching rules in a parametric L-system can be set to satisfy Murray’s law or da Vinci’s rule, and the resulting fractal dimension matches biological measurements. This is evidence that the recursive, self-similar growth logic captured by L-systems is mechanistically operative in real organisms, not merely visually similar.

The caveat: natural self-similarity is approximate, not exact. Real trees are self-similar only across a finite range of scales (from the trunk diameter down to the smallest twig) and only statistically (individual branches differ from one another). L-systems reproduce this statistical self-similarity through stochastic productions, but the mathematical fractals generated by deterministic L-systems (Koch curves, Sierpinski triangles) are exactly self-similar at all scales --- a property no physical object possesses.


Further Reading