0 votes 0 votes Consider the following two ambigious context free grammars. Which of the above ambigious CFG’s has an equivalent unambiguous CFG I only II only Both I and II Neither I nor II eyeamgj asked Mar 20, 2018 eyeamgj 674 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes every DCFL have unambiguous grammar . both languages are DCFL then it must have an equivalent unambiguous grammar . abhishekmehta4u answered Mar 20, 2018 abhishekmehta4u comment Share Follow See all 3 Comments See all 3 3 Comments reply pallaviamu commented Mar 20, 2018 reply Follow Share Second grammar is NDCFL, so it doesn't have an unambiguous grammar. 0 votes 0 votes abhishekmehta4u commented Mar 20, 2018 i edited by abhishekmehta4u Mar 20, 2018 reply Follow Share ......... 0 votes 0 votes Gate Fever commented Dec 9, 2018 reply Follow Share is there any standard approach for this?? how to solve these kind of questions?? @abhishekmehta4u 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes both have unambigious grammar- 1- s->aSb/ab 2- s->aaAb/aAb , A->aaAb/aAb/e Poonam Gupta 1 answered Mar 20, 2018 Poonam Gupta 1 comment Share Follow See 1 comment See all 1 1 comment reply Gate Fever commented Dec 9, 2018 reply Follow Share is there any standard approach for this?? how to solve these kind of questions?? @Poonam Gupta 1 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes For 1st one we have $S\rightarrow aSb / \epsilon$. For 2nd one we have $S\rightarrow aaSb/ aab/ aSb/ \epsilon$ Jason answered Mar 20, 2018 Jason comment Share Follow See 1 comment See all 1 1 comment reply Neha_16 commented Apr 13, 2018 reply Follow Share @jason your 2nd cfg is ambiguous because for string 'aab' 2 derivation trees are possible. check this for 2nd one S ->aSb | a | ϵ 0 votes 0 votes Please log in or register to add a comment.