Question

For the following non regular language, I want the Context Free Grammar and the rightmost derivation for the string 011000.

L={0^m 1^n 0^(m+n)| m,n >=0}

For the CFG I have done this: S --> 0S0 | A A --> 10A | E Is it right?

For the rightmost derivation for the string 011000 im having some dificulties.

Was it helpful?

Solution

The CFG for this language is as follows

S->0S0|A
A->1A0|^

Your CFG will accept this string 010100 which is wrong. Now you might get your right-most derivation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top