Question

Consider the following languages.
L1={⟨M⟩∣M takes at least 2016 steps on some input}L_1 = \{\langle M \rangle \mid M \text{ takes at least 2016 steps on some input}\},
L2={⟨M⟩∣M takes at least 2016 steps on all inputs}L_2 = \{\langle M \rangle \mid M \text{ takes at least 2016 steps on all inputs}\} and
L3={⟨M⟩∣M accepts ε}L_3 = \{\langle M \rangle \mid M \text{ accepts } \varepsilon\},
where for each Turing machine MM, ⟨M⟩\langle M \rangle denotes a specific encoding of MM. Which one of the following is TRUE?

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

Solution

Check whether bounding execution steps allows decidability by examining inputs of bounded length.

Examine L1L_1 and L2L_2:
In at most 2016 computation steps, the read/write head of any Turing machine MM can visit at most the first 2016 cells of the input tape. Any symbols beyond the 2016th position on the tape can never be reached or influence the execution during the first 2016 steps.
Consequently, the first 2016 steps of MM on any input string ww are identical to its execution on the prefix of ww of length ≤2016\le 2016.

Since the input alphabet Σ\Sigma is finite, the number of distinct input strings of length at most 2016 is finite:

Total test strings=∑k=02016∣Σ∣k\text{Total test strings} = \sum_{k=0}^{2016} |\Sigma|^k

A universal Turing machine simulator can test MM on each of these finitely many strings for at most 2016 steps:

  • For L1L_1: If MM takes ≥2016\ge 2016 steps on at least one of these strings, accept; otherwise reject. This always halts, so L1L_1 is recursive (decidable).
  • For L2L_2: If MM takes ≥2016\ge 2016 steps on every string in this finite set, it will take ≥2016\ge 2016 steps on all inputs of any length. Accept if it holds for all, reject otherwise. This always halts, so L2L_2 is recursive (decidable).

Examine L3={⟨M⟩∣M accepts ε}L_3 = \{\langle M \rangle \mid M \text{ accepts } \varepsilon\}:
This language asks whether a given Turing machine accepts the empty input. By reduction from the Halting Problem (or by Rice's Theorem, since accepting ε\varepsilon is a non-trivial semantic property of recursively enumerable languages), L3L_3 is undecidable. Thus L3L_3 is not recursive.

Therefore, L1L_1 and L2L_2 are recursive, and L3L_3 is not recursive.

Final answer

C

Common trap

Believing L2L_2 is undecidable because it specifies 'on all inputs', overlooking that a bound on the number of steps strictly bounds the relevant input length to a finite set.

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 2
Question
54 of 65, printed as CS Q.44
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.