Question
Let be the language represented by regular expression . Let be the language generated by a context free grammar . Let be the language accepted by a Turing machine .
Which of the following decision problems are undecidable?
I. Given a regular expression and a string , is ?
II. Given a context-free grammar , is ?
III. Given a context-free grammar , is for some alphabet ?
IV. Given a Turing machine and a string , is ?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2017 answer key
Solution
Recall standard decidability and undecidability results for regular expressions, context-free grammars, and Turing machines.
Examine each decision problem:
- Problem I (Membership for regular expressions): Given and , is ? We can convert to a DFA and simulate it on in linear time . This problem is decidable.
- Problem II (Emptiness of CFL): Given context-free grammar , is ? This can be decided in polynomial time by finding all generating non-terminals and checking if the start symbol is generating. This problem is decidable.
- Problem III (Universality of CFL): Given context-free grammar , is ? This problem is known to be undecidable (by reduction from the Post Correspondence Problem or computation history of Turing machines).
- Problem IV (Membership for Turing machine): Given Turing machine and string , is ? This is the classic Acceptance Problem for Turing Machines (), which is well-known to be undecidable.
Thus, problems III and IV only are undecidable, which corresponds to option D.
D
Confusing emptiness of CFL (which is decidable) with universality of CFL (which is undecidable).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2017 Computer Science and Information Technology (CS) Session 2
- Question
- 41 of 65, printed as CS Q.41
- 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.