I have this language:
{an bm | m+n is an even number}
What's the proper grammar for this?
S -> aaS | aB | bbC | ε
B -> bbB | b
C -> bbC | ε
you see, it is a regular language. 'S' stands for "we have constructed an even number of a's and more a's may follow, 'B' stands for "we have constructed an uneven number of a's and now an uneven number of b's follows. 'C' stands for "we have constructed an even number of a's and now an even number of b's follows.
ε stands for "", the empty string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With