-1

I want to ask about a turing-machine-like construct with an infinite number of states. in this post the claim is that every language is accepted: Can a Turing machine have infinite states?

I understand that we can scan over the input from left to right once, and end up at a unique state for each possible input string. but what if the language is a description like HALT' = {< M,w >|M don't halt on w}, can we know what input in our language? how can we know the encodes that not in our language? how can we know M wont halt on w in the first place?

In addition, can we decide any language with such a machine or just accept any language? for example can we decide HALT = {< M,w >|M halt on w} ?

yaniv
  • 1
  • 1
  • This question doesn't make sense. What is an infinite state? Do you mean an infinite number of states? A Turing machine has a finite number of states. You cannot just say: let's assume it doesn't, and then ask us to describe the consequences, any more than you can say: let's assume a triangle has 4 sides, and then ask us to describe the consequences. If you want to discuss a Turing-machine-like construct with an infinite number of states, provide a definition for it, and then we can discuss it. – reinierpost Aug 26 '22 at 10:46
  • yes, i mean a Turing-machine-like construct with an infinite number of states. Q size is infinite. i want to understand why we can accept any language with that. – yaniv Aug 26 '22 at 10:57
  • It depends on the definition. Can the transition function be infinite as well? – reinierpost Aug 26 '22 at 11:43
  • yes the domain and range of transition function infinite as well – yaniv Aug 26 '22 at 12:35

1 Answers1

2

You can decide any language in linear time. Given a language $L \subseteq \Sigma^*$, consider the following Turing machine:

  • Create a state for every word $w \in \Sigma^*$ and pick the tape alphabet $\Gamma$ as $\Sigma \cup \{ \bot \}$, where $\bot$ denotes the blank symbol. The initial state is $\varepsilon$.
  • When you read an alphabet symbol $\alpha \in \Sigma$ transition from the current state $w$ to $w\alpha$ and move right.
  • When you are in a state $w$ and you read $\bot$ move to an accepting state if $w \in L$ and to a rejecting state otherwise.
Steven
  • 29,419
  • 2
  • 28
  • 49
  • thank you for the answer. but i think that my misunderstanding derive from the lack of knowledge what is W in the first place. how can i build a state for every input if i dont know what the correct input should look like. to build this state in my example i need to know if M wont Halt on w (as the input). sorry about the digging into details with this unusual question but it was a question inside exam few years ago and i would like to understand this point. – yaniv Aug 26 '22 at 21:41
  • $w$ is just a word in $\Sigma^$, i.e., the set of all possible* words, not just the words in $L$. Also one key point is that you do not need to actually be able to build the Turing machine, you just need to show that such a machine exists. That is, you are not asking about the problem of producing a representation of a "infinite Turing machine" (what would this representation even be?) given a representation of $L$ (and how would you encode $L$?). You are just asking whether, given a language $L$, there exists an "infinite Turing machine" that decides $L$. The answer is "yes". – Steven Aug 26 '22 at 21:45