2 votes 2 votes Given the Grammar, S -> abB, A -> aaBb, B -> bbAa, A -> ∈ Please explain how we get expression:- L = { ab(bbaa)^n bba (ba)^n / n>= 0 } Please explain step by step. Theory of Computation theory-of-computation context-free-language + – Shubhanshu asked Jul 5, 2017 Shubhanshu 3.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 0 votes 0 votes smallest string generated by this grammer = S=>abB s=>abbbAa there is two option A->aaBb or epsilen put epsilen then smallest string =>abbba next but A=aaBb s=>abbbaaBba again put B=bbAa s=>abbbaabbAaba there is two option A->aaBb or epsilen put epsilen then next string =>ab(bbaa)(bba)(ba) put A=aaBb abbbaabbaaBbaba put value of B abbbaabbaabbAababa put A=epsilon ab(bbaabbaa)(bba)(baba) you can see that there is a loop between A and B so we can say L = { ab(bbaa)^n bba (ba)^n / n>= 0 } Nitesh Choudhary answered Jul 5, 2017 • selected Jul 5, 2017 by Shubhanshu Nitesh Choudhary comment Share Follow See all 2 Comments See all 2 2 Comments reply Shubhanshu commented Jul 5, 2017 reply Follow Share Thanks that is nice explanation. And I am getting abbb (aabb)^n (ab)^n a / n>=0 I think it is also correct. Since we have abbba abbb(aabb)(ab)a abbb(aabb)(aabb)(ab)(ab)a. ryt? 0 votes 0 votes Nitesh Choudhary commented Jul 5, 2017 reply Follow Share it is also right . 0 votes 0 votes Please log in or register to add a comment.