The algorithm for computing the fractal is summarized as follows:[more]
1. Choose a string of A’s and B’s of any nontrivial length (e.g., AABAB).
2. Construct the sequence formed by successive terms in the string, repeated as many times as necessary.
3. Choose a point .
4. Define the function if , and if .
5. Let , and compute the iterates .
6. Compute the Lyapunov exponent: . In practice, is approximated by choosing a suitably large (in the Manipulate code, the variable “iterations” corresponds to ).
7. Color the point according to the value of obtained.
8. Repeat steps 3–7 for each point in the image plane.[less]
For more information, see the Wikipedia entry for “Lyapunov fractal”.