Automata and Grammars
Print this page
First   |   Last   |   Prev   |   Next
Example: Find a grammar for the language .

It is possible to find a grammar for L by modifying the previous grammar since we need to generate an extra b at the end of the string . We can do this by adding a production SBb where the non-terminal B generates as given in the previous example.

Using the above concept we devise the follwoing grammar for L.

where

N = { S, B }

P = { SBb, Bab, BaBb }

First   |   Last   |   Prev   |   Next