0 votes 0 votes Give a context-free grammar that generates the language $A=\{a^{i}b^{j}c^{k}\mid i=j$ $\text{or}$ $ j=k$ $\text{where}$ $ i,j,k\geq 0\}.$ Is your grammar ambiguous$?$ Why or why not$?$ Theory of Computation michael-sipser theory-of-computation context-free-language ambiguous grammar + – admin asked May 1, 2019 • edited May 4, 2019 by Lakshman Bhaiya admin 559 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes A is union of two languages $a^nb^nc^m \cup a^mb^nc^n$ PDA for this language is NPDA. So it is ambiguous aditi19 answered Aug 14, 2019 aditi19 comment Share Follow See all 4 Comments See all 4 4 Comments reply Doraemon commented May 20, 2020 reply Follow Share YOU can have a string where i=j=k which can be created by both a^nb^nc^m or a^mb^nc^n 0 votes 0 votes aditi19 commented May 20, 2020 reply Follow Share How does that answers whether the language is ambiguous or not? 0 votes 0 votes Doraemon commented May 20, 2020 reply Follow Share S->A|B A->aAb|abC B->bBc|Xbc C->cC|c X->aX|a The above is the grammar,So we can choose any one of the path from S either A or B ,which will give us a^nb^nc^m or a^mb^nc^n where m=n. 0 votes 0 votes Shruti_p commented Sep 9, 2020 reply Follow Share This grammar is incorrect as it will accept strings in which c comes before b also. 0 votes 0 votes Please log in or register to add a comment.