GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 35

GATE CSE 2014 Set 3 Q35

Theory of Computation · Decidability & Computability · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q35 2 marks · MCQ
Report issue

Decidability & Computability

Question 35, GATE 2014: Which problem is undecidable for arbitrary context-free grammars? A whether a grammar is ambiguous; B whether it generates a given string; C whether its language is empty; D whether its language is finite.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step 1: Membership is decidable by a general CFG parsing algorithm, so B is not the answer. Step 2: Emptiness is decidable by marking nonterminals that can derive terminal strings and checking the start symbol. Finiteness is decidable by analyzing useful recursive growth, so C and D are also decidable. Step 3: There is no algorithm deciding ambiguity for every CFG: whether some string has multiple parse trees is an undecidable property of arbitrary grammars. Thus A. This does not say that ambiguity cannot be demonstrated for a particular grammar by an explicit witness.

Original paper, page 60 · Answer key