Question

Which one of the following problems is undecidable?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2014 answer key

Solution

Recall standard decidability and undecidability results for Context-Free Grammars.

  1. Decidable Properties of CFGs:

    • Membership problem (w∈L(G)w \in L(G)): Decidable in polynomial time using the CYK algorithm or Earley's parser (O(n3)O(n^3)). Hence option B is decidable.
    • Emptiness problem (L(G)=∅L(G) = \emptyset): Decidable in polynomial time by finding whether the start symbol SS can generate any string of terminal symbols. Hence option C is decidable.
    • Finiteness problem (∣L(G)∣<∞|L(G)| < \infty): Decidable in polynomial time by testing for cycles in the non-terminal dependency graph that can generate terminal substrings. Hence option D is decidable.
  2. Undecidable Property of CFGs:

    • Ambiguity problem: Determining whether an arbitrary context-free grammar GG 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.