GATE / CS ARCHIVE

GATE CSE 2021 SET 1 / QUESTION 39

GATE CSE 2021 Set 1 Q39

Theory of Computation · Decidability & Computability · Full GATE CSE 2021 Set 1 paper

GATE 2021 Set 1, Q39 2 marks · MCQ
Report issue

Decidability & Computability

Question 39, GATE 2021: For Turing-machine encodings ⟨M⟩, L1={⟨M⟩: M takes more than 2021 steps on all inputs}, L2={⟨M⟩: M takes more than 2021 steps on some input}. Which is correct? A both decidable; B L1 decidable/L2 undecidable; C L1 undecidable/L2 decidable; D both undecidable.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

A computation limited to 2021 steps can inspect only finitely many input positions. Enumerate all finite relevant prefixes, including end-of-input cases, and simulate M for that fixed bound on each representative. Check whether all representatives run longer than 2021 for L1, or at least one does for L2. Both procedures terminate, despite a very large finite enumeration. Therefore both languages are decidable, A.

This is bounded-time behavior, unlike the unbounded halting problem. In 2021 steps a standard single-tape input head can visit only a bounded initial portion of the input; choose a conservative prefix bound 2022 and include all shorter words and all words of that prefix length as representatives for longer inputs. Simulate each for exactly the fixed bound, detecting whether it halts within it. The enumeration is enormous but finite, which is sufficient for decidability; no practical polynomial-time claim is made.

Original paper, page 33 · Answer key