(A -> AB, B -> BA) -> in result you get AB BA
n=3: ABBABAAB (A->AB;B->BA;B->BA;A->AB) result: AB BA BA AB
n=4: ABBABAABBAABABBA (etc. etc.)
You can find some more details in 'The Algorithmic beauty of plants' - it is freely available as a PDF:
http://algorithmicbotany.org/papers/abop/abop.pdf
Best…