1 votes 1 votes L = {a^nb^m : n >= m+3} below context grammer is correct?? S ==> aA | Aa A ==> aAb | bAa | abA | baA | aa Theory of Computation theory-of-computation context-free-grammar + – akhileshreddy asked Jul 12, 2017 • reshown Jul 12, 2017 by akhileshreddy akhileshreddy 573 views answer comment Share Follow See 1 comment See all 1 1 comment reply akhileshreddy commented Jul 12, 2017 reply Follow Share are there any algorithms / techniques for determining best possible context-free grammers? please let me know 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Your grammar is not correct as we are able to generate "aabaa". CFG can be :- A -> aAb / aaaC C -> aC / epsilon. Xylene answered Jul 12, 2017 • edited Jul 12, 2017 by Xylene Xylene comment Share Follow See all 10 Comments See all 10 10 Comments reply joshi_nitish commented Jul 12, 2017 reply Follow Share your grammer is also not correct, it is generating 'aa'...which is not in language as n>=m+3..here m=0, so n>=3.. 0 votes 0 votes akhileshreddy commented Jul 12, 2017 reply Follow Share we can't generate "aabaaba" with your solution 0 votes 0 votes joshi_nitish commented Jul 12, 2017 reply Follow Share @akhileshreddy, "aabaaba" is not in language.. 0 votes 0 votes Xylene commented Jul 12, 2017 reply Follow Share @joshi , how is my grammar generating aa ? See it properly. I think that my grammar is correct. 0 votes 0 votes joshi_nitish commented Jul 12, 2017 reply Follow Share you have edited it....initially it was aaC, now you have edited it to aaaC.. 0 votes 0 votes Xylene commented Jul 12, 2017 reply Follow Share @joshi, yeah I saw your comment after editing. It's proper now. 0 votes 0 votes akhileshreddy commented Jul 12, 2017 reply Follow Share @joshi: in aabaaba n = 5 and m = 2 which is satisfying condition n >= m+3 0 votes 0 votes joshi_nitish commented Jul 12, 2017 reply Follow Share @akhilesh, but once the run of a's are finished and b's start...'a' cant start again...or simply we can say a can not come after b... 0 votes 0 votes joshi_nitish commented Jul 12, 2017 reply Follow Share yeah...its perfect now.. 0 votes 0 votes akhileshreddy commented Jul 12, 2017 reply Follow Share thanks for the help 0 votes 0 votes Please log in or register to add a comment.