How can I generate a Context Free Grammar for a specific language

45 views Asked by At

I have the description of a language L as follows:

L is the language consisting of all strings over the alphabet {a,b} such that there is at least one b in the string, there are more a’s than b’s, and there is at least as many a’s after the last occurrence of b in the string as the total amount of b’s in the string.

Condition 1 and 2 seem easy to meet, but I’m not sure how to go about the last bit.

How would I make a CFG for this language?

0

There are 0 answers