Fractal Lab

Lindenmayer systems

L-systems

Aristid Lindenmayer introduced L-systems in 1968 to model plant growth. A symbolic axiom is rewritten in parallel at every step by applying production rules; the resulting string is then interpreted by a turtle that walks and turns, drawing the fractal as it goes.

An L-system at iteration 4: axiom F++F++F with rule F → F-F++F-F at 60°, drawing the Koch snowflake.

At a glance

InventorAristid Lindenmayer, 1968
Original motivationModelling cell division in algae
Formal classParallel string-rewriting grammar
Common variantsD0L (deterministic context-free), stochastic, parametric, 3D

How an L-system works

  1. Axiom: a starting string, e.g. F or F++F++F.
  2. Production rules: each symbol can be replaced by a string, e.g. F → F+F−F−F+F.
  3. Iteration: apply every rule to every symbol in parallel. After n steps the string can be exponentially long.
  4. Turtle interpretation: walk through the final string. F G A B step forward (drawing); + − turn by a fixed angle; [ ]push and pop the turtle’s position and heading on a stack so the curve can branch.

Classic examples

Why parallel rewriting matters

In a context-free grammar, derivation is sequential, one symbol at a time. L-systems rewrite all symbols simultaneously at each step, modelling biological cells that divide together. Mathematically this means an L-system step is a homomorphism on strings, and string length under iteration is governed by the rule’s growth matrix.

Try it

The L-system playground renders any of seven classic systems with adjustable iteration depth.

References

Quick quiz

Test yourself on lsystems

10 multiple-choice questions. Pick an answer for each, then submit to see explanations.

  1. Q1.An L-system was originally introduced to model:

  2. Q2.A deterministic context-free L-system is sometimes abbreviated:

  3. Q3.In turtle interpretation of L-systems, the symbol '+' usually means:

  4. Q4.Square brackets [ and ] are used in L-systems to:

  5. Q5.How many iterations of an L-system roughly suffice to produce a recognisable Koch curve?

  6. Q6.The growth of an L-system string with rule F → FF is:

  7. Q7.Non-drawing 'helper' symbols like X and Y in L-systems are useful because:

  8. Q8.Stochastic L-systems differ from deterministic ones by:

  9. Q9.A 3D extension of L-systems uses extra symbols for:

  10. Q10.L-systems are closely related to:

0 of 10 answered