### Determining the size of an L-System string

Posted:

**Sat Jul 02, 2016 1:04 pm**I've been writing a program to play around with L-Systems (Lindenmayer System). https://en.wikipedia.org/wiki/L-system if your curious about them. I'd like to add a progress bar for higher order calculation, but to do that I need to develop a method to determining the total number of items that will be in the final string. I was wondering if there is an easy way to determine the total number of items in the final string (if not necessarily what they are). For example if you had this sytem.

A->AB

B->A

Iniital String = A

Starting with A you get :

A = 1

AB = 2

ABA = 3

ABAAB = 5

ABAABABA = 8

This just continues on with the Fibonacci sequence.

Another example is the Dragon Curve (which includes some constants).

X = X+YF+

Y=−FX−Y

Initial String = FX

FX = 2

FX+YF+ = 6

FX+YF++−FX−YF+=14

and grows rather quickly. I'd like to be able to figure out a method to determine the total string length of a paticular order.

A->AB

B->A

Iniital String = A

Starting with A you get :

A = 1

AB = 2

ABA = 3

ABAAB = 5

ABAABABA = 8

This just continues on with the Fibonacci sequence.

Another example is the Dragon Curve (which includes some constants).

X = X+YF+

Y=−FX−Y

Initial String = FX

FX = 2

FX+YF+ = 6

FX+YF++−FX−YF+=14

and grows rather quickly. I'd like to be able to figure out a method to determine the total string length of a paticular order.