HiveBrain v1.2.0
Get Started
← Back to all entries
patternMajor

Is the set of Turing machines which stops in at most 50 steps on all inputs, decidable?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
inputsthemostallstepswhichdecidablemachinesstopsturing

Problem

Let $F = \{⟨M⟩:\text{M is a TM which stops for every input in at most 50 steps}\}$. I need to decide whether F is decidable or recursively enumerable. I think it's decidable, but I don't know how to prove it.

My thoughts

This "50 steps" part immediate turns the R sign for me. If it was for specific input it would be decidable. However, here it's for every input. Checking it for infinite inputs makes me think that the problem is co-RE, i.e. its complement is acceptable.

Perhaps, I can check the configurations and see that all configurations after 50 steps don't lead to accept state- how do I do that?

Solution

Let's consider the more general problem of machines which stop after at most $N$ steps, for some $N \geqslant 1$. (The following is a substantial simplifcation of a previous version of this answer, but is effectively equivalent.)

As swegi remarks in an earlier response, if the machine stops after at most $N$ steps, then only the cells $0,1,\ldots,N-1$ on the tape are significant.
Then it suffices to simulate the machine $M$ on all input strings of the form $x \in \Sigma^N$, of which there are a finite number.

  • If any of these simulations fail to enter a halting state by the $N^{\text{th}}\:\!$ transition, this indicates that any input string starting with $x$ is one for which the machine does not stop within the first $N$ steps.



  • If all of these simulations halt by the $N^{\text{th}}\:\!$ transition, then $M$ halts within $N$ steps on all inputs of any length (of which the substring of length $N$ is all that it ever acts on).

Context

StackExchange Computer Science Q#3101, answer score: 22

Revisions (0)

No revisions yet.