Question
Which of the following problems are decidable?
- Does a given program ever produce an output?
- If is a context-free language, then, is also context-free?
- If is a regular language, then, is also regular?
- If is a recursive language, then, is also recursive?
Official answer and solution
- Official answer
- D
- From
- Official GATE 2012 answer key
Solution
Assess the decidability of each problem using Turing machine theory and language closure properties.
-
Problem 1: 'Does a given program ever produce an output?'
This is a non-trivial semantic property of program behavior. By Rice's Theorem (or reduction from the Halting Problem), determining whether an arbitrary program produces an output on any input is undecidable. -
Problem 2: 'If is a context-free language, then, is also context-free?'
Context-free languages are not closed under complementation. Determining whether the complement of a given CFL is also context-free is an undecidable problem in formal language theory. -
Problem 3: 'If is a regular language, then, is also regular?'
Regular languages are closed under complementation. For every regular language , its complement is guaranteed to be regular (we can construct a DFA for simply by swapping the accept and non-accept states of the DFA for ). Because the statement is unconditionally true for all regular languages, the decision algorithm always answers YES. Hence, Problem 3 is decidable. -
Problem 4: 'If is a recursive language, then, is also recursive?'
Recursive (decidable) languages are closed under complementation. If a Turing machine halts on all inputs and decides , we construct a decider for by simply inverting the accept and reject states of . Since every recursive language has a recursive complement, the decision algorithm always answers YES. Hence, Problem 4 is decidable. -
Thus, problems 3 and 4 are decidable.
D
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2012 Computer Science and Information Technology (CS)
- Question
- 24 of 65, printed as CS Q.24
- 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.