在这个答案中,假设图灵机具有双向无限大的磁带。该声明不适用于单向无限磁带。
我先定义语言的类别 C′3作为类所有语言的可判定由一个磁带图灵机与3种状态(C3 was defined as the class of languages recognizable by one-tape Turing machines with 3 states). I introduced the class C′3 because in my original answer, I unconsciously swaped the classes C3 and C′3 (I only considered the class C′3).
This answer is more a complement to @MarzioDeBiasi answers. He showed that the classes C3 and C′3 are not contained in CFL and thus contain quite interesting languages. However, as I will show in this post, each language L in C′3 has the property that the set {1n;n∈N∖{0}} is either in L or in its complement LC. Thus C′3 is also very restrictive, eg. it contains only trivial unary languages {}, {ε}, {1n;n∈N} and {1n;n∈N∖{0}}. The class C3 contains a bit more unary languages. However, it holds that if L∈C3 and 1n∈L for n≥1, then 1m∈L for all m≥n. A simple corollary is that not all regular languages are in C3 nor in C′3. Also the language {1} is not in C3 nor in C′3.
For the claim (in bold) about C′3, it is enough to prove that a one-tape Turing machine M with 3 states that always halts either accepts or rejects all strings from {1n;n∈N∖{0}}. Suppose that a string of the form 1n, n∈N∖{0}, is given to M. There are three cases:
1) When M reads 1, it accepts or rejects.
2) When M reads 1, it moves the head to the left. If we want M to halt on this input, it must accept, reject or move to the right on the blank symbol. Hence, it never visits the cell to the right of the initial cell of the tape. If it would, it would run forever on input 1.
3) When M reads 1, it moves the head to the right. It follows that after n steps, the content of the tape is An where A is some symbol from the tape alphabet and the head of M is on the leftmost blank symbol to the right of the last A. If we want M to halt on this input, it must accept, reject or move to the left on the blank symbol. As in case 2), the head of M will now never visit the cell directly to the left of the rightmost A. If it would, then M would run forever on input 1.
It is clear that in all three cases M accepts all strings from the set {1n;n∈N∖{0}} or it rejects them all.
The proof of the claim (in bold) about C3 follows the same line as above. We take a one-tape 3-state Turing machine M that accepts a string 1n for some n≥1. Suppose M is given an input 1m for m≥n. We have to prove that M accepts this input. We have 3 cases:
1) When M reads 1, it accepts.
2) When M reads 1, it moves the head to the left. Because M accepts the input 1n, it has to accept or move to the right on the blank symbol. Hence, it never visits the nth cell to the right of the initial cell. If it would, it would run forever on input 1n.
3) When M reads 1, it moves the head to the right. It follows that after m steps, the content of the tape is Am where A is some symbol from the tape alphabet and the head of M is on the leftmost blank symbol to the right of the last A. Because M accepts the input 1n, it must accept or move to the left on the blank symbol. As in case 2), the head of M will now never visit the nth cell to the left of the rightmost A. This is because on the input 1n, M does not visit the cell directly left of the initial cell, because it contains the blank symbol and if it would read it, it would run forever.
It is clear that in all three cases M accepts all strings from the set {1m;m≥n}.