The Power of One-State Turing Machines
Marzio De Biasi

TL;DR
This paper explores the computational power of one-state Turing machines, demonstrating they can recognize complex languages beyond regular and context-free, surpassing pushdown automata in certain tasks.
Contribution
It extends previous results by proving one-state Turing machines can recognize non context-free languages, showing greater computational power than previously known.
Findings
One-state Turing machines can accept non regular languages.
They can recognize some non context-free languages.
They are more powerful than pushdown automata for certain tasks.
Abstract
At first glance, one-state Turing machines are very weak: the halting problem for them is decidable, and, without memory, they cannot even accept a simple one element language such as . Nevertheless it has been showed that a one-state Turing machine can accept non regular languages. We extend such result and prove that they can also recognize non context-free languages, so for some tasks they are more powerful than pushdown automata.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
Topicssemigroups and automata theory · Computability, Logic, AI Algorithms · DNA and Biological Computing
The Power of One-State Turing Machines
Marzio De Biasi
Abstract
At first glance, one–state Turing machines are very weak: the halting problem for them is decidable, and, without memory, they cannot even accept a simple one element language such as . Nevertheless it has been showed that a one–state Turing machine can accept non regular languages. We extend such result and prove that they can also recognize non context–free languages, so for some tasks they are more powerful than pushdown automata.
1 Introduction
A Turing machine with two states is able to simulate any Turing machine; hence we can build a two–states universal Turing machine (actually 2 states and 18 symbols are enough to achieve universality [4]) hence the halting problem for them is undecidable. We dramatically clips their wings if we allow only one state: we get a device with no internal memory and the halting problem becomes decidable [1, 5]. We cannot even distinguish between accepting and non–accepting states. Nevertheless we can relax the notion of acceptance and rejection of an input: a one–state Turing machine accepts a string if it halts; it rejects if it runs forever. Under this different notion of acceptance, a one–state Turing machine is more powerful than finite–state automata [2]. In [3] Kudlek considers languages accepted by Turing machines with one state and three symbols, and with two states and two symbols. He proves that one state Turing machines with 3 symbols accept regular languages, except in one case a deterministic linear context-free language.
We extend such result and prove that a one–state Turing machine is more powerful than a pushdown automata, too: it can recognize non context–free languages.
In Section 2 we give some preliminary definitions, in Section 3 we build a one–state Turing machine that is able to compare two numbers in different bases, in Section 4 we give a formal proof that the language recognized by such machine is not context–free.
2 Definitions
We use the standard definition of Turing machine as a 7-tuple [6]:
Definition 2.1** (Turing Machine).**
A Turing machine is a 7-tuple where is the set of states, is the input alphabet not containing the blank symbol , is the tape alphabet, , is the initial state, is the accept halting state, is the reject halting state (), is the transition function that given a non-halting state and the current symbol returns a new (possibly halting) state, a symbol that is written on the tape and the direction of the move ( or ).
The single head of the Turing machine is placed on a tape with an infinite number of cells in both directions; at the beginning of the computation the state of the Turing machine is , the head is placed on the leftmost symbol of the input string; the rest of the cells contain the blank symbol .
With two states and 18 symbols () we can build an universal Turing machine [4]; we restrict our study to one–state Turing machines so [2, 5]. But with only one state available we cannot neither distinguish between an accepting and rejecting state nor between a non–halting and a halting state; so we must somewhat alter the standard definition of accept/reject:
Definition 2.2** (One–state Turing machine).**
A one state Turing machine is a 6-tuple:
where is the only state which is also the initial state, is the input alphabet not containing the blank symbol , is the tape alphabet, , is the set of halting symbols, is the transition function that given the current symbol under the head, returns the new symbol to be written and the direction of the move. If the current symbol is a halting symbol, the machine halts.
We define the language recognized by a one–state Turing machine:
Definition 2.3** (Language recognized by a one–state Turing machine).**
If is a one–state Turing machine, , we define the language recognized by the set:
[TABLE]
.
We could also consider the variant in which the one–state Turing machine is equipped with distinct sets of accept and reject halting symbols. In this case the behavior can be: halt and accept, halt and reject or run forever. However it is straightforward to see that the results would also extend to this model.
At first glance, a one–state Turing machine is very weak, indeed it cannot even recognize trivial regular languages:
Theorem 2.4**.**
No one–state Turing machine can recognize the trivial regular language .
Proof.
Suppose that recognizes ; we analyze its behavior on input . At the beginning of the computation the head is on the symbol , if it is a halting symbol then halts, but it will also halt and accept on any string . If it is not a halting symbol, either (i) or (ii), .
- (i)
Suppose that : now the head is on a blank symbol; if it is halting, then again it will also halt and accept on any ; it cannot move left again otherwise it will never halt; so it must move back to the right, i.e. . At this point the head is on symbol (written on the first step); if then the head will end on a blank symbol on the right part of the tape and it will start an infinite sequence of right moves. So must be halting or move the head to the left: ; in either cases would also halt on any string .
- (ii)
If the behavior is similar: the head falls on a blank symbol and it must halt or jump back. If it halts, then would halt on any after a sequence of right moves. If it jumps back, it cannot move left again on otherwise it would fall on a blank symbol on the left part of the input moving forever. So we must have and ; but such transitions cause to halt and accept also all .
In all cases leading to a contradiction. ∎
Nevertheless, as showed in [2], there are one–state Turing machines that can recognize non–regular languages, i.e. some of them are more powerful than finite–state automata.
In the next sections we will prove that they are even more powerful.
3 A powerful one–state Turing machine
A one–state Turing machine has no internal memory, but the symbols on the tape cells can be used to store the following information:
- •
cell has been visited times ( fixed);
- •
head has left the cell going to the right;
- •
head has left the cell going to the left.
This information is limited, but it is enough to implement both an unary counter and a binary counter. Informally we define a Turing machine with this behavior:
- •
the input is divided in two parts: the left part () is an unary counter; whenever the head finds a it marks it as counted writing and bounces back to the right part;
- •
the right part () – initially filled with [math]s – is a binary counter: whenever the head finds a zero [math] it transforms it to a and bounces back to the left part; when it finds a it marks it as a zero and continues towards the right to “propagate” the carry; when going back to the left part it will change to [math];
- •
at the (rightmost) end of the input there is the special symbol for which no transition is defined and causes the machine to halt.
Formally, we define a one–state Turing machine over a three symbols input alphabet ; the tape alphabet has eight symbols: ; the complete transition table is:
[TABLE]
Figure 1 shows an example of a computation on input .
We call the language defined by the inputs on which the Turing machine halts (i.e. reach the halting symbol for which no transition is defined and doesn’t run forever):
[TABLE]
We don’t need to characterize exactly the language ; but if we restrict the input to strings of the form , we can prove the following property:
Theorem 3.1**.**
If then if and only if .
Proof.
By construction the left part behaves like an unary counter; while the right part behaves like a binary counter. For every increment of the binary counter the unary counter is also incremented, so the head can reach the rightmost only if ; if then the head reaches the blank symbol on the left of the input and continues in that direction forever. ∎
We can say that, if the input is “well-formed”, the one–state Turing machine can compare a number represented in unary with a number represented in binary.
Using a similar technique we could build a one–state Turing machine that implements an arbitrary -ary counter or a one–state Turing machine that compare a -ary number with a -ary number, i.e. it can compare two numbers written in different bases.
4 Computational complexity
We define the languages:
[TABLE]
[TABLE]
which, by Theorem 3.1, are related to each other and to in this way:
[TABLE]
[TABLE]
We can prove that is not context–free (CF) using the well known property of context–free languages: if is CF and is regular then is CF.
The following is immediate:
Lemma 4.1**.**
* is regular.*
and using the pumping lemma for context–free languages we prove the following:
Lemma 4.2**.**
* is not context–free.*
Proof.
Suppose that is CF. Let be the pumping length. We pick the string
[TABLE]
which is in . By the pumping lemma can be written as , with substrings and , such that i) , ii) , and iii) for all . We can have the following cases:
- •
is entirely contained in ; in this case we can pump zero times () and we get the string with , hence ;
- •
is entirely contained in ; in this case we can pump two times () and we get the string with and , hence ;
- •
spans between and ; in the worst case and :
[TABLE]
should hold for any , but for large enough we have:
[TABLE]
which puts the string out of the language. So we can conclude that is not context–free.
∎
We can finally conclude that the language recognized by the one–state Turing machine is not context–free:
Theorem 4.3**.**
* is not context–free.*
Proof.
Suppose that is CF. Then is CF because is regular (Lemma 4.1). But which is not CF (Lemma 4.2) leading to a contradiction. ∎
If is the class of regular languages, is the class of Context–Free languages, and is the class of languages recognized by one–state Turing machines; by Theorem 2.4 and Theorem 4.3, we have :
Theorem 4.4**.**
[TABLE]
5 Conclusion
We proved that despite its limitations a one–state Turing machine can be used to implement a -ary counter and “compare” two numbers written in different bases (the quotes are due to the non–standard definition of acceptance/reject of an input string). So the class of languages recognized by one–state Turing machines is neither a superset of the regular languages nor a subset of the context-free languages.
As a further investigation, we state the following problem: what is the minimal number of symbols needed by a one–state Turing machine to accept a non context-free language? It is known that : proved in [3] and proved in this article.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] G. T. Herman. The halting problem of one state turing machines with n-dimensional tape. Mathematical Logic Quarterly , 14(7-12):185–191, 1968.
- 2[2] G. T. Herman. The uniform halting problem for generalized one-state turing machines. Information and Control , 15(4):353 – 367, 1969.
- 3[3] M. Kudlek. Small deterministic turing machines. Theoretical Computer Science , 168(2):241 – 255, 1996.
- 4[4] T. Neary and D. Woods. Four small universal turing machines. Fundam. Inform. , 91(1):123–144, 2009.
- 5[5] Y. Saouter. Halting Problem for One-State Turing Machines. Research Report RR-2577, INRIA, 1995.
- 6[6] M. Sipser. Introduction to the theory of computation . PWS Publishing Company, 1997.
