A Lindenmayer system, or L-System is a collection of symbols and set of rules for replacing any symbol with one or more other symbols. That may not sound immediately interesting, but when combined with a means to generate a graphical representation of a sequence of symbols, L-Systems are capable of producing a huge array of complex images.
More precisely, an L-System consists of three items:
Once an L-System is defined, the rules can be applied simulaneously to each symbol in the axiom to generate a new sequence of symbols. This process can be repeated for the new sequence, and so on.
A simple example of an L-System has alphabet \(\{A, B\}\) (both variables), rules \(\{A \rightarrow AB, B \rightarrow BA\}\), and axiom \(A\). Then repeated application of the rules, starting from the axiom, yields
To visualize an L-System, geometric notions are typically associated with the symbols. For example, a symbol might mean "draw a line segment of unit length" or "rotate by angle \(\pi/2\)". The following app has a collection of pre-defined L-Systems that can be loaded, and the rules can be applied iteratively and visualized. The details of the L-System will be printed below the image.
A huge gallery of interesting examples of L-Systems can be found here.