Reputation: 355
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.
Upvotes: 1
Views: 159
Reputation: 1074
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.
Upvotes: 0