0
$\begingroup$

After reading all the answers on the turing machines tag i cannot answer my question (i think maybe it's related to that question).

The language L is:

L = { < M , w > | M on input w, transition (i reall couldn't find the correct word here, hope it is understandable) to all states }

Is that decidable or not?

  • 0
    Is $M$ a deterministic TM, and do you mean that the run of $M$ on input $w$ visits all of $M$'s states? Do you assume that a TM has at least one accepting state, which cannot be left once entered?2017-01-07
  • 0
    Can you see how, if you had a program that decides your $L$, you could use it to decide the halting problem?2017-01-07
  • 0
    @Fabio Somezni Yes it's a deterministic TM and yes i mean that the run of M on input w visits all of M's states. I am not sure of that assume, but maybe yes, i suppose that w should at least have one symbol if L is decidable which means TM would at least have on accepting state, if i am not wrong on my thought on that.2017-01-07
  • 0
    The assumption is meant to nudge you in the direction that @HenningMakholm explicitly mentions. BTW, if the input alphabet is empty, the only possible input is the empty string, and that's easily decidable.2017-01-07
  • 0
    Instead of editing your question, you shoud have asked another one. Can you unroll the edit? Right now, the discussion makes no sense, because the context is missing. Think of people now reading your question and my answer. They'd be perplexed to say the least?2017-01-07
  • 0
    I've rolled the question back to its previous form. Akris, if you want to ask another question, do so - don't modify an existing (and answered) one.2017-01-07
  • 0
    I thought it would be better if i changed it to the originate of the problem. Otherwise i still think it's better to have it as my edit, check it again please. The answer will still be valid for the question. Sorry for any inconvinience.2017-01-07

1 Answers 1

2

A language over a given alphabet is decidable if and only if there exists a Turing machine that reads strings over that alphabet and eventually delivers a yes/no answer. The answer must be "yes" for strings in the language and "no" otherwise. (That implies that eventually the TM halts.)

The most famous undecidable problem is whether a TM halts on a given input. That means that there is no TM that reads the description of a TM and its input, churns for a while, and inevitably halts with the correct verdict. For some TMs and inputs it's easy to say whether they halt, but the undecidability of the halting problem means that there is no TM that works in general.

Incidentally, if there is no TM that gets the job done, no program in any of the languages that you or I may know can do it either.

In computability and complexity, we often use reductions. The idea, in the case of decidability, takes this simple form: if I could find a TM that decides this language, then I could trick it into deciding this other language. Since a theorem assures me that the "other language" is undecidable, the TM I'm looking for does not exist.

In this specific case, as in many other cases, we investigate if the decidability of language $L$ implies the decidability of the halting problem. If it does, then $L$ must be undecidable.

The choice of the halting problem is a natural one, because in both cases, a Turing machine reads another machine and an input string. "Tricking" the TM for $L$ to solve the halting problem, however, means that to decide whether $M$ halts on input $w$ using the TM for $L$, we may need to construct another machine $M'$ from $M$, and possibly another input $w'$ from $w$, for which we test membership in $L$. How should we go about it?

If a TM does not halt it does not enter its accepting or rejecting states. So, clearly, if $M$ does not halt on input $w$, our hypothetical TM for $L$ will answer "no." However, if $M$ halts on input $w$, it may still not visit all states; in particular, it either does not visit the accepting state or does not visit the rejecting state. It may also not visit other states. This is what we need to fix in obtaining $M'$ from $M$.

I'm sure there's more than one way to do it, but here's one way. Modify $M$ so that, on entering either the accepting state or the rejecting state of $M$, it executes an "endgame" procedure, in which it replaces the input with a string of special symbols (symbols in the tape alphabet that are not in the input alphabet). It then visits all the states one by one and finally halts. The transition relation of $M$ is extended in such a way that, from every state, on reading the special "endgame" symbol, $M'$ moves to the next state in a pre-determined enumeration of the states.

While the above may seem a little messy, a programmer will immediately recognize that it's doable with a little patience. (Programming TMs takes a lot of patience.) The upshot is that if we could tell whether $M'$ visits all its states on input $w$, we could tell whether $M$ halts on input $w$. Since we cannot do the latter...