All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2019

Consider the following languages : L = {anbncm} ∪ {anbmcm}, n, m ≥ 0 1 L = {wwR ∣ w ∈ {a, b}*} 2 Where R represents reversible operation. Which one of the following is (are) inherently ambiguous language(s)? L

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. only 1 L

Explanation

{aⁿbⁿcᵐ} ∪ {aⁿbᵐcᵐ} is the classic inherently ambiguous CFL (strings aⁿbⁿcⁿ have two derivations in every grammar). wwᴿ has an unambiguous grammar S → aSa | bSb | λ.

More Theory of Computation and Compilers questions