Using this grammar, over the alphabet $\Sigma=\{a\}$ $$ S \rightarrow a \\ S\rightarrow CD \\ C\rightarrow ACB \\ C\rightarrow AB \\ AB\rightarrow aBA \\ Aa\rightarrow aA \\ Ba\rightarrow aB \\ AD\rightarrow Da \\ BD\rightarrow Ea \\ BE\rightarrow Ea \\ E\rightarrow a \\ $$ Im trying to show that the working string $aaaaaaaaaBBBAAAD$ or $a^{n^2} B^nA^nD$ generates the word $a^{(n+1)^2}$
|
|
Start at the end! There is only one applicable production: #8. $D$ moves backward over the $A$'s turning them into $a$'s. Then use #9, and repeatedly #10. Please take a piece of paper and count the $a$'s generated. Probably the expression $(n+1)^2 = n^2+2n+1$ is useful. |
||||
|
|
Firstly, let's see step by step a sequence of production usage in order to draw the general conclusion: Finally, we have 16 'a's in our word, which verifies the general formula: $a^{{(n+1)}^2}$.
To sum up, we have: $n^2$ 'a's from the given word, $n$ from the 1st step, $1+(n-1)=n$ from steps 2 & 3 and at last $1$ 'a'as described in step 4 $\Rightarrow n^2+2n+1=(n+1)^2$ 'a's. |
|||
|
|