Theory of Computation · Countability
Motivation: Comparing Number of Turing Machines and Languages
Overview
The central question is whether every language has a Turing machine that accepts it.
Because this cannot be answered directly, an indirect proof compares the number of Turing machines with the number of languages and shows that languages form a strictly larger infinity, so some languages are not accepted by any Turing machine.
Key concepts
- Central question: for every language, does there exist a Turing machine to accept it? It is hard to answer directly, so an indirect proof is used.
- Recursively enumerable: a language is recursively enumerable exactly when it is accepted by a Turing machine. A language that is not recursively enumerable is not accepted by any Turing machine.
- One language per machine: every machine can accept only one language (strictly, a Turing machine accepts exactly one language — the set of strings it accepts).
- Two infinities: the set of all Turing machines is infinite and the set of all languages is infinite, but the infinity of languages is a bigger infinity and the infinity of Turing machines is a smaller infinity.
- Conclusion: there exist languages that are not even recursively enumerable. Even the most powerful machine, the Turing machine, cannot accept every language.
- Machinery to be built: the proof rests on set theory, developed step by step before the main argument — countable sets, uncountable sets, finite sets, infinite sets.
How it works
- Show that the set of all Turing machines is infinite.
- Show that the set of all languages is also infinite.
- Show that the number of Turing machines is "lesser" than the number of languages: both are infinite, but the infinity of languages is a bigger infinity and the infinity of Turing machines is a smaller infinity.
- Counting argument: since each machine accepts only one language, if there are, say, 10 machines they can accept only 10 languages (at most).
In general, the number of machines can "cover" only as many languages as there are machines. - If the number of languages is strictly larger than the number of machines, then after assigning one machine to each language we quickly run out of Turing machines, and some languages remain with no possible Turing machine to accept them.
- Hence there are languages for which a Turing machine can never be given — these are the languages that are not recursively enumerable.
The goal is not to exhibit a specific language and check it against every machine. Instead, the result is proved using methods and theorems built from set theory.
Formulas
- — each machine accepts exactly one language, so machines cover at most as many languages as there are machines.
- — the infinity of machines is smaller than the infinity of languages, so some languages have no accepting machine.
Worked examples
Illustration with small numbers:
- Suppose there are 10 Turing machines. Since each machine accepts only one language, at most 10 languages can be accepted.
- If the set of languages is larger than the set of machines, then some languages have no machine — so those languages are not recursively enumerable.
Revision summary
- The question "does every language have a Turing machine?" is answered by an indirect proof, not by direct construction.
- Each Turing machine accepts exactly one language, so machines can cover at most as many languages as there are machines.
- Both sets are infinite, but the infinity of languages is strictly bigger than the infinity of Turing machines.
- Consequence: there exist languages that are not recursively enumerable — the Turing machine is not powerful enough to accept every language.
- "Recursively enumerable" means accepted by some Turing machine.
- The proof is built on the theory of finite, infinite, countable and uncountable sets, developed step by step before the main argument.
Previous-year exam insights
- A set is countable if it is finite or can be placed in one-to-one correspondence with the natural numbers (i.e., its elements can be listed as a sequence); otherwise it is uncountable.
- Every subset of a countable set is countable, and any countable union of countable sets is countable; a countable set cannot have an uncountable subset.
- The set of all Turing machines (equivalently, all strings over a finite alphabet, or all finite descriptions of machines) is countably infinite, because each machine has a finite encoding over a finite alphabet.
- The set of all languages over a non-empty finite alphabet is uncountable, since it equals the power set of the countably infinite set of strings; by Cantor's theorem the power set of any set has strictly greater cardinality than the set itself.
- Cantor's diagonalisation argument proves uncountability: assuming a listing of all objects, construct a new object differing from the i-th listed object at position i, contradicting completeness of the list.
- Consequences to memorise: some languages are not recursively enumerable (not accepted by any TM); the class of recursively enumerable languages is countable, and there are uncountably many non-RE languages, so 'most' languages are not RE.