StreakPeaked· Practice

ExamsGATETechnical

Which one of the following problems is undecidable?

  1. Deciding if a given context-free grammar is ambiguous.
  2. Deciding if a given string is generated by a given context-free grammar.
  3. Deciding if the language generated by a given context-free grammar is empty.
  4. Deciding if the language generated by a given context-free grammar is finite.

Correct answer: Deciding if a given context-free grammar is ambiguous.

Solution

Ambiguity checking for a context-free grammar is undecidable. In contrast, membership, emptiness, and finiteness for context-free languages are decidable problems. Hence the first option is correct.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →