1.

State true or false:Statement: R->R|TT->ε is an ambiguous grammar(a) Statement: R->R|TT->ε is an ambiguous grammar(b) true(c) falseI had been asked this question during an interview.The origin of the question is Ambiguous Grammar topic in portion Context Free Grammars and Languages of Automata Theory

Answer»

The correct answer is (a) STATEMENT: R->R|TT->ε is an ambiguous grammar

The explanation is: The production can be either itself or an empty string. Thus the empty string has more than ONE leftmost derivations, depending on how many times R->R is being USED.



Discussion

No Comment Found

Related InterviewSolutions