Redirected
edited by
1,484 views
3 votes
3 votes

I think the answer should be option: C but it is given option A.

Providing the snapshot of the question with the options provided.

I don't think option A should be the correct one, even if it then we cannot derive string "bda" from option A which is possible in the original grammar.

Please help with this question.

Thanks in advance.

edited by

5 Answers

0 votes
0 votes
S -> Aa/b

A -> Ac/Aad/bd/epsilon

there is left recursion for A production so remove it

A -> bdA'/A'       ------------ here A' for epsilon production as A ->epsilon  from the given production

A' -> cA'/adA'/epsilon

hence option (a) is correct
0 votes
0 votes
Your answer is correct,

The solution provided is wrong.

In the original grammar, we can generate $bda$

by using $S \rightarrow Aa$ and $A \rightarrow bd$, which will give bda

however, in the solution grammar provided, there is no way to generate $bda$

as there is no way to get $A \rightarrow bd$.
0 votes
0 votes

option B is correct 

option A can’t generate  bda

option C cant generate  cca

Related questions

4 votes
4 votes
1 answer
2
0 votes
0 votes
0 answers
3
Na462 asked Sep 19, 2018
398 views
Remove the Left Recursion from it : A - B|a|CBDB - C|bC - A|cD - d
2 votes
2 votes
2 answers
4
saumya mishra asked Jun 11, 2018
1,665 views
In this question should we eliminate left recursion by putting values of S and A in the respective productions so answer will be c but if according to the given productio...