Question

Which of the following decision problems are undecidable?
I. Given NFAs N1N_1 and N2N_2, is L(N1)∩L(N2)=∅L(N_1) \cap L(N_2) = \emptyset?
II. Given a CFG G=(N,Σ,P,S)G = (N, \Sigma, P, S) and a string x∈Σ∗x \in \Sigma^*, does x∈L(G)x \in L(G)?
III. Given CFGs G1G_1 and G2G_2, is L(G1)=L(G2)L(G_1) = L(G_2)?
IV. Given a TM MM, is L(M)=∅L(M) = \emptyset?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2016 answer key

Solution

Classify the decidability of standard language decision problems for regular, context-free, and recursively enumerable languages.

Evaluate Problem I: 'Given NFAs N1N_1 and N2N_2, is L(N1)∩L(N2)=∅L(N_1) \cap L(N_2) = \emptyset?'
Regular languages are closed under intersection. We can construct a cross-product automaton NN recognizing L(N1)∩L(N2)L(N_1) \cap L(N_2) and check whether any accept state is reachable from the start state using breadth-first search or depth-first search in polynomial time. Hence, Problem I is DECIDABLE.

Evaluate Problem II: 'Given a CFG GG and a string xx, does x∈L(G)x \in L(G)?'
This is the CFG membership problem. It can be solved in O(∣x∣3)O(|x|^3) time using the Cocke-Younger-Kasami (CYK) dynamic programming algorithm or Earley's parser. Hence, Problem II is DECIDABLE.

Evaluate Problem III: 'Given CFGs G1G_1 and G2G_2, is L(G1)=L(G2)L(G_1) = L(G_2)?'
Equivalence of context-free languages is a well-known undecidable problem (proven by reduction from the Post Correspondence Problem or CFG universality L(G)=Σ∗L(G) = \Sigma^*). Hence, Problem III is UNDECIDABLE.

Evaluate Problem IV: 'Given a TM MM, is L(M)=∅L(M) = \emptyset?'
Emptiness of a recursively enumerable language is undecidable by Rice's Theorem, as emptiness is a non-trivial semantic property of Turing machine languages. Hence, Problem IV is UNDECIDABLE.

Therefore, problems III and IV only are undecidable.

Final answer

C

Common trap

Thinking that CFG equivalence is decidable because DFA equivalence is decidable, or thinking CFG membership is undecidable.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 1
Question
27 of 65, printed as CS Q.17
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.