Sunday, December 28, 2008

A Turing Machine with infinitely many states

I have came across this problem and found it interesting in many aspects. I wanted to share it with you. So, I will show the problem, the interesting points about it that my professor and I reached after some discussion, and I would like to see also what did this problem arise in your minds, it is probably a classical problem, yet anyway I liked it.

Let a computational model be a Turing Machine that is allowed to have countably infinitely many states, will it be more powerful than a normal Turing Machine? Is there a problem (language) that it can solve (decide) and a normal Turing Machine can not? What are the languages decidable by such a class of Turing Machines?

So, before going to read the solution and the intuition behind it, take some time trying to solve the problem. I think this may lead you to a different way of thought and give you a deeper intuition about why the solution is correct. I would like to hear from the readers if they have other views or ways in looking into the problem. Comments are welcomed.

Before going to the solution, I will go through three steps asking similar questions and trying to apply the same answers. The questions are: How much languages are undecidable? And, Give an example of one. I will apply this question to three types of computational models:
1) Normal Turing Machines
2) Turing Machines with infinite states, yet finitely describable
3) Turing Machines with infinite states (not necessarily finitely describable)

First type: Normal Turing Machines
There are uncountably infinitely many undecidable languages for the normal Turing Machine. The argument behind follows:
- The normal Turing Machines can be described using a finite string from a finite alphabet according to a well-defined coding based on its formal definition (the 7-tuple definition). Or let it be the code of the algorithm it applies in a well-defined programming language. That is also a sufficient coding of the Turing Machine.
- Out of a finite alphabet, any string (and thus any description of a Turing Machine) can be expressed as a natural number, one way to do that is to assume that the alphabet are digits and that the string in question is a number written using these digits (the base is the size of the alphabet).
- Follows that there are at most Turing Machines as there are natural numbers, the number of Turing Machines is infinite, and thus The cardinality of the class of Turing Machines is the same as the natural numbers (countably infinite), named as aleph-0.
- The number of possible input strings to a Turing Machine is also, by the same argument, countably infinite.
- A language (a problem) is a set of strings generated from the alphabet. So, any element of the power set of the set of strings is a language (problem)
- Thus, the cardinality of the class of languages is uncountable, namely 2^aleph-0.
- Every Turing Machine decides at most one language (none if it is not a decider).
- There is, therefore, a class of uncountably infinitely many unrecognizable languages (of cardinality 2^aleph-0 - aleph-0 = 2^aleph-0).
Philosophical conclusion, there are just way too much problems that we can not solve.

There is also a language that is known to be undecidable, namely the Halting Problem, the reader can go for a definition and proof of its undecidability here:
http://en.wikipedia.org/wiki/Halting_problem

Second type: Turing Machines with infinite states, yet finitely describable
Let's handle an intermediate problem, investigating a Turing machine with countably infinitely many states named as {1, 2, 3, ...} = N. The transition function as well as the accept states are both, unlike the original problem, describable in a finite well-defined manner. This type of Turing Machines will have a finite description as the states are known beforehand (N), and the transition function is finitely describable.
The counting argument used in solving the problem for the normal Turing Machines still holds. There are countably infinitely many Turing Machines of this type, via a similar argument.
Also, a problem similar to the Halting Problem will be constructable (specifically the Halting Problem on these Turing Machines with infinite states, yet finite description).

Third type: The initial problem
The Turing Machines in this class which are not in the second class are not describable in any finite manner. There is no finite representation whatsoever either for the delta function or for the accept states. These Turing Machines (the difference between the third and the second type) are inherently infinite in their description.

Trying to apply one of the two proof ideas used before will fail in an amusing manner:
The counting argument will fail because the number of Turing Machines in the third class is not countably infinite (aleph-0). In fact, it is 2^aleph-0 as will follow later from the solution.
Construction of the Halting Problem to such class of Turing Machines will also fail. The not-so-obvious reason is that the strings in these language (problem) would be infinite in length. The Halting Problem is described as {<T, X> | T halts on input X}. The description of T in the first place is infinite and thus this is not a well-defined language (a language can only contain strings of finite length). So, the Halting Problem is inapplicable to these machines, i.e.: such a problem is not present using the normal definition of a language.

The solution is: Any normal language (problem) is solvable by one such Turing Machine. In fact, it is even solvable by a Deterministic Automata with countably infinite states (finitely describable), finitely describable transition function, and possibly infinitely describable accept states. No need for the tapes. A proof goes by construction:

Let L be a language over the alphabet A.
Let the states of the automata to be A* (The set of all strings over A including the empty string which will be the start state), which are countably infinite, finitely describable.
Let the transition function of the automata be defined as follows:
- For a state named X, when a symbol (a) is read, the automata moves to state Xa. (Also, finitely describable transition function)
The accept states are all X where X is a string in L (the language to be decided). Now, this can not always be finitely described.

The automata will work as follows, it will always be at the state named by the part of the input it has already read. It will begin at the empty string. Reading an (a) will move the state to a. Following by reading an (x) would move the state to ax. Once the input is done, it is already at the state named by the input string. It would be an accept state if and only if the string is in the language.
What has been done in such construction is that an automata was made to remember "everything" of the past input.

The number of such machines is equal to 2^aleph-0. A hint to prove that cardinality is to prove it is larger than or equal to 2^aleph-0 by finding a subclass of them of that cardinality. Then, proving it is less than or equal to 2^aleph-0 by mapping them injectively to the real interval [0.0, 1.0) which are of the same cardinality of the real numbers (2^aleph-0).

Here the question is solved, but a philosophical question stroke me and I tried to formulate it mathematically:
Given this endless infinite power, will this enable solving any problem. Well, still the answer is no.
It can solve any problem of a smaller level (any language whose strings are of finite length). But to extend the Halting Problem correctly, the strings of this new Halting Problem will not all be finitely describable (which was what we sacrificed in the first place, we assumed we have the power to deal with infinite descriptions). This power should give us also the ability to create bigger problems, something like extending the language definition to hold strings with infinite length would be an idea. By doing that:
The number of problems (languages) will be 2^(2^aleph-0) and the counting argument will hold again. We will end up with 2^(2^aleph-0) unsolvable problems.
The Halting Problem proof then will also hold.

The more you have power to solve problems, the more problems you have unsolvable.