GATE / CS ARCHIVE

SIMILAR QUESTIONS / THEORY OF COMPUTATION

Decide bounded-step machine properties

2 questions solved the same way, newest first. Back to Theory of Computation

How these are solved

2016 asks recursive status of three languages: at least 2016 steps on some input, on all inputs, and acceptance of epsilon. 2021 asks decidability of only two languages, more than 2021 steps on all/some inputs.

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

2 marks · MCQ
Report issue

Decidability & Computability

Question 44, GATE 2016: Let L1={⟨M⟩:M takes at least 2016 steps on some input}, L2={⟨M⟩:M takes at least 2016 steps on all inputs}, L3={⟨M⟩:M accepts ε}. Which are recursive? A only L1; B only L2; C L1 and L2 only; D all three.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Whether a machine takes at least 2016 steps depends only on its first 2016-step computation prefix. In that time its input head can inspect only a bounded initial segment, so finitely many representative inputs suffice: all short inputs and one representative extension for each sufficiently long prefix. Simulate each for the fixed bound and test whether any (L1) or every (L2) representative survives that many steps. Both tests halt. Acceptance of epsilon (L3) is undecidable by the standard reduction that builds a machine ignoring its input and simulating an arbitrary machine/input pair. Hence C.

The constant 2016 is essential: this is bounded simulation, not the general halting problem. A machine cannot inspect arbitrarily far into its input in a fixed number of steps. For L3, given M,w, construct N that ignores its own input and simulates M on w, accepting iff M accepts w. Deciding whether N accepts ε would decide the undecidable acceptance problem.

Original paper, page 38 · Answer key