Question

Which of the following problems are decidable?

  1. Does a given program ever produce an output?
  2. If LL is a context-free language, then, is L‾\overline{L} also context-free?
  3. If LL is a regular language, then, is L‾\overline{L} also regular?
  4. If LL is a recursive language, then, is L‾\overline{L} also recursive?
Choose one option
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.

  1. 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.

  2. Problem 2: 'If LL is a context-free language, then, is L‾\overline{L} 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.

  3. Problem 3: 'If LL is a regular language, then, is L‾\overline{L} also regular?'
    Regular languages are closed under complementation. For every regular language LL, its complement L‾\overline{L} is guaranteed to be regular (we can construct a DFA for L‾\overline{L} simply by swapping the accept and non-accept states of the DFA for LL). Because the statement is unconditionally true for all regular languages, the decision algorithm always answers YES. Hence, Problem 3 is decidable.

  4. Problem 4: 'If LL is a recursive language, then, is L‾\overline{L} also recursive?'
    Recursive (decidable) languages are closed under complementation. If a Turing machine MM halts on all inputs and decides LL, we construct a decider for L‾\overline{L} by simply inverting the accept and reject states of MM. Since every recursive language has a recursive complement, the decision algorithm always answers YES. Hence, Problem 4 is decidable.

  5. Thus, problems 3 and 4 are decidable.

Final answer

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.