Skip to content
Official PYQ · 2021

GATE CS 2021 Set 1 Q39 — Undecidability

Explain with AI

For a Turing machine MM, ⟨M⟩\langle M \rangle denotes an encoding of MM. Consider the following two languages.

L1={⟨M⟩∣M takes more than 2021 steps on all inputs}L2={⟨M⟩∣M takes more than 2021 steps on some input}\begin{array}{ll} L_1 = \{ \langle M \rangle \mid M \text{ takes more than } 2021 \text{ steps on all inputs} \} \\ L_2 = \{ \langle M \rangle \mid M\text{ takes more than } 2021 \text{ steps on some input} \} \end{array}

Which one of the following options is correct?

Choose one option
View worked solution

Answer: A

To determine the decidability of L1L_1 and L2L_2, we analyze the behavior of a Turing machine MM within a bounded number of steps (k=2021k = 2021).

In at most 20212021 steps, MM can scan at most the first 20212021 symbols of its input tape. Consequently, the computation of MM on any input ww of length greater than 20212021 during the first 20212021 steps is identical to its computation on the prefix of ww of length 20212021.

This leads to the following key observations:

  • MM takes more than 20212021 steps on all inputs if and only if it takes more than 20212021 steps on all inputs of length ≤2021\le 2021.
  • MM takes more than 20212021 steps on some input if and only if it takes more than 20212021 steps on some input of length ≤2021\le 2021.

Since the input alphabet Σ\Sigma of MM is finite, the set of all inputs of length ≤2021\le 2021 is finite (specifically, ∑i=02021∣Σ∣i\sum_{i=0}^{2021} |\Sigma|^i inputs). We can decide both properties by simulating MM on each of these finitely many inputs for at most 20222022 steps. Since this simulation is guaranteed to terminate in finite time, both L1L_1 and L2L_2 are decidable.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Undecidability questions