0
$\begingroup$

Is $L =$ { $\langle M \rangle$ | $M$ moves left on at least one input } decidable? What would the proof look like?

Intuitively, I would say it's undecidable: We cannot predict if a given TM ever reaches an accepting transition on a specific input, let alone predicting if it would reach some transition $\delta(q,a) = (p,b,-1)$ on ANY input.

This leads me to another question: Let $L' =$ { $\langle M, w \rangle$ | $M$ moves left on input $w$ }. Is L' decidable? Could two such "versions" of a language, where one version asks about any input and the other about a specific input, differ in decidability?

$\endgroup$
2
  • 1
    $\begingroup$ On the other hand, if the machine does not move left, then it only moves right, stands still or halts. And intuitively these 3 actions don't seem to be enough for Turing-completeness. You basically steal the memory from the machine. $\endgroup$
    – rus9384
    Commented Jan 26 at 23:08
  • $\begingroup$ Cross-posted: cs.stackexchange.com/q/165256/755, cstheory.stackexchange.com/q/53821/5038. Please do not post the same question on multiple sites. You got a hint and feedback on CS Theory. When you get such feedback, please update your question based on the feedback you have received elsewhere, and spend the time to consider based on the feedback you've received before posting the question elsewhere. $\endgroup$
    – D.W.
    Commented Jan 26 at 23:48

2 Answers 2

0
$\begingroup$

The language $L'$ is decidable. Consider the operation of a TM $M$ on an input $w$. If $M$ does not move its head to the left when it runs on $w$, then after $|w|-1$ steps, $M$'s head reaches the first blank tape cell and it enters some state $q_1$. When in $q_1$ and $M$ reads a blank, it moves to the right and enters a state $q_2$ (possibly equals $q_1$). Applying the latter considerations again, you get that from $q_2$, $M$ reads a blank symbol, moves its head to the right and enters a state $q_3$, etc. As we're only reading blanks and moving to the right, we will eventually repeat a state and get stuck in a loop of states, and that is guaranteed to happen within at most $|w|-1 + |Q|$ steps of the machine's. In total, we have the following. If $M$ does not move its head to the left upon reading the input $w$, then it enters a loop of states (where it only reads blanks and moves to the right) after at most $|w|-1+|Q|$ steps. Hence, the following algorithm decides $L'$. On input $\langle M, w \rangle$, simulate the run of $M$ on $w$ for at most $|w|-1 + |Q|$ steps, and accept only when $M$ moves its head to the left during the simulation.

Regarding the language $L$, it is also decidable! The idea is as follows. Given a machine $M$, check if there is a path (according to the definition of the transition function) from $q_0$ to a transition that moves the head of the machine to the left. We distinguish between two cases:

1- No such path exist: this case is easy, as it implies that there is no input on which the machine moves its head to the left.

2- Such a path exists: consider a minimal path $p$ from $q_0$ to a Left-transition. As $p$ is minimal, when the machine reads the input word $w$ that is induced by $p$'s transitions, it never moves to the left, and thus we can say for sure that $M$ moves its head to the left on at least one input.

Notes:

  • I assumed that the machine moves only to the left or right.

  • Your intuition is misleading. Checking if a machine accepts at least one input is undecidable since even if we detect that $q_{acc}$ is reachable, it can be reachable via transitions that can only be used upon reading a specific tape content that we can never reach because what we write on the tape right before moving to the left can change the tape's content in a way that makes it impossible to use some "reachable" transitions.

$\endgroup$
4
  • $\begingroup$ Wow! Thank you for the great answer!!! $\endgroup$
    – Dilara
    Commented Jan 27 at 1:29
  • $\begingroup$ You're welcome! $\endgroup$ Commented Jan 27 at 10:58
  • $\begingroup$ Can this be simplified to "A TM that does not move its head to the left can be simulated with a regular automaton, and whether a TM can be simulated with a regular automaton is decidable"? $\endgroup$
    – rus9384
    Commented Jan 27 at 12:34
  • $\begingroup$ Not sure if this approach simplifies it as the idea is straightforward. Also, there are TMs that can move their head to the left, yet can be simulated by a regular automaton. So proving whether a TM can be simulated by a DFA is decidable or not, needs to also consider machines that can move to the left, but have other restrictions, such as two-way finite automata. $\endgroup$ Commented Jan 27 at 13:19
0
$\begingroup$

Concerning the general question Could two such “versions” of a language, where one version asks about any input and the other about a specific input, differ in decidability?:

They sure can. E.g., consider $L=\{\langle M\rangle:\text{$M$ halts}\}$ and $L'=\{\langle M,n\rangle:\text{$M$ halts in $n$ steps}\}$ (where $M$ is a TM with no input). Or, in the other direction: $L=\{w:\text{$w$ is accepted by some TM $M$}\}$ and $L'=\{\langle w,M\rangle:\text{$M$ accepts $w$}\}$.

$\endgroup$
1
  • $\begingroup$ Much appreciated! $\endgroup$
    – Dilara
    Commented Jan 27 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.