Question 98
Explanation
Consider the following languages :
L1={anbncm} ∪ {anbmcm}, n,m>=0
L2 ={wwR | w ∈ {a, b}*} Where R represents reversible operation.
Which one of the following is (are) inherently ambiguous language(s)?
Answer : (1) only L1 L1={anbncm} ∪ {anbmcm}, n,m>=0
L2 ={wwR | w ∈ {a, b}*} Where R represents reversible operation.
Which one of the following is (are) inherently ambiguous language(s)?
Explanation
Previous | Next |
UGC NET CS December 2019 - Question 97 | UGC NET CS December 2019 - Question 99 |
Reference : Inherently ambiguous languages
L2 is Not inherently ambiguous and one unambiguous grammar for this language is :
S→aSa|bSb|ε
A typical derivation in this grammar is S → aSa → aaSaa → aabSbaa → aabbaa.
It is not hard to show that the above grammar is unambiguous. (Hint : At every symbol, while reading the string from the left, you only have one choice of production rule in the parse tree.)
So, option 1 is correct answer.