Question
Which one of the following problems is undecidable?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2014 answer key
Solution
Recall standard decidability and undecidability results for Context-Free Grammars.
-
Decidable Properties of CFGs:
- Membership problem (): Decidable in polynomial time using the CYK algorithm or Earley's parser (). Hence option B is decidable.
- Emptiness problem (): Decidable in polynomial time by finding whether the start symbol can generate any string of terminal symbols. Hence option C is decidable.
- Finiteness problem (): Decidable in polynomial time by testing for cycles in the non-terminal dependency graph that can generate terminal substrings. Hence option D is decidable.
-
Undecidable Property of CFGs:
- Ambiguity problem: Determining whether an arbitrary context-free grammar is ambiguous (generates at least one string with two or more distinct parse trees) is undecidable.
- This is established via reduction from the Post Correspondence Problem (PCP).
Therefore, the undecidable problem is deciding if a given CFG is ambiguous (option A).
Final answer
A
Common trap
Assuming CFG ambiguity is decidable like emptiness or finiteness.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 3
- Question
- 45 of 65, printed as CS Q.35
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.