GATE Computer ScienceHardGATE CS (PYQ pattern)
Which of the following languages is inherently ambiguous?
- A. { aⁿbⁿcᵐ : n, m ≥ 0 }
- B. { w wᴿ : w ∈ {a, b}* }
- C. { aⁱbʲcᵏ : i = j or j = k }
- D. { aⁱbʲ : i = j or i ≠ j }
Correct answer: C. { aⁱbʲcᵏ : i = j or j = k }
Strings with i = j = k have two essentially different derivations in any grammar for the union of the two CFLs; this is the standard inherently ambiguous language. The others have unambiguous grammars.
More Theory of Computation questions
- Which of the following languages cannot be accepted by any deterministic pushdown automaton?
- Which of the following languages is context-free?
- Which of the following unary languages is NOT regular?
- Which one of the following statements is FALSE?
- Which regular expression denotes exactly the set of strings over {a, b} with an EVEN number of a's (zero included)?
- A DFA has 8 states. To decide whether the language it accepts is infinite, it suffices to check whether it accepts some string whose…