Question:

For a Turing machine \(M\), \(\langle M \rangle\) denotes an encoding of \(M\). Consider the following two languages: \[ 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}\} \] Which one of the following options is correct?

Show Hint

Any language that asks whether a Turing machine halts within or exceeds a fixed constant number of steps is decidable, because the simulation space is finite.
Updated On: Jan 2, 2026
  • Both \(L_1\) and \(L_2\) are decidable.
  • \(L_1\) is decidable and \(L_2\) is undecidable.
  • \(L_1\) is undecidable and \(L_2\) is decidable.
  • Both \(L_1\) and \(L_2\) are undecidable.
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Key observation about time bounds.
The number \(2021\) is a fixed constant. For any Turing machine \(M\), we can simulate its computation for at most \(2021\) steps on any given input and observe whether it halts within that bound.

Step 2: Decidability of \(L_2\).
To decide whether \(M\) takes more than \(2021\) steps on some input, we can enumerate all possible inputs of length up to \(2021\) symbols and simulate \(M\) on each of them for at most \(2021\) steps.
If for at least one input the machine does not halt within \(2021\) steps, then \(\langle M \rangle \in L_2\). Otherwise, it is not. Since this process is finite, \(L_2\) is decidable.

Step 3: Decidability of \(L_1\).
To decide whether \(M\) takes more than \(2021\) steps on all inputs, we again simulate \(M\) on all inputs of length up to \(2021\) for \(2021\) steps.
If \(M\) halts within \(2021\) steps on even one input, then \(\langle M \rangle \notin L_1\). Otherwise, it belongs to \(L_1\). This is also a finite procedure.

Step 4: Conclusion.
Since both properties can be checked using finite simulations bounded by a constant number of steps, both \(L_1\) and \(L_2\) are decidable.

Final Answer: (A)

Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions