The Limits of Computation: 1. The Church-Turing Thesis
The Limits of Computation: 1. The Church-Turing Thesis
The Limits of Computation: 1. The Church-Turing Thesis
Here’s how Turing put it, in 1948: “[Turing machines] can do anything that
could be described as ‘rule of thumb’ or ‘purely mechanical’ . . . This is sufficiently
well established that it is now agreed amongst logicians that ‘calculable by means
of [a Turing machine]’ is the correct accurate rendering of such phrases.”
It is generally believed that the Church–Turing thesis is true; that is, any “al-
gorithm” can be turned into a set of instructions for a machine that has a finite
processing unit, input, output, and memory.
2. All other attempts to give “algorithm” a precise meaning (and there have been
many) have been shown to be equivalent to the standard Turing machine.
3. We will see shortly that there exists a single Turing machine U that can
simulate any other Turing machine. This was invented by Turing and is
called the universal Turing machine.
36
37
of this course, and will define an algorithm to be something that can be carried out
on a Turing machine. As a consequence, in this chapter we will only give higher
level descriptions of our Turing machine algorithms.
So, for example, to encode the Turing machine M1 from Chapter 3, Example
1.2, we would first number the states as q0 , q1 , q2 = qa , q3 = qr . We would encode
the alphabet ⌃ = {a, b} with {0, 1}, and the alphabet = {a, b, t} with {0, 1, 2}.
The beginning of the word encoding hM1 i would then be
4#2#1#0 ⇤ 0 ⇤ 0 ⇤ 0 ⇤ R#0 ⇤ 1 ⇤ 1 ⇤ 1 ⇤ R#
We emphasise that the above is just one example of a way of encoding a Turing
machine: there are many others.
Let’s show that Turing machines are themselves Turing-complete.
Theorem 1.3 (Turing 1936) There exists a Turing machine U , called the Uni-
versal Turing machine ( UTM), which on input hM, wi, an encoding of a Turing
machine M and an input word w for M , simulates the action of M on w.
cell of w, just as in the proof of Chapter 3, Theorem 2.3. The machine U stores the
number of the current state of M (initially the start state) after the description of
M on Tape 1.
The machine U simulates the action of M on w by repeatedly checking the
current letter a of M ’s tape that is indicated by the ⇤ on Tape 2, and the current
state qi of M stored on Tape 1. The machine U then finds on Tape 1 the part
of M ’s transition function that corresponds to (qi , a), and copies the output of
(qi , a) to update the state of M on Tape 1, and the current letter of M on Tape
2. The machine U then moves the ⇤ on Tape 2 to indicate the new location of M ’s
tape head.
If M accepts then U accepts, and if M rejects then U rejects. ⌅
The Universal Turing Machine is often described as the first fully general con-
cept of a programmable computer: on input hM, wi, the Turing machine M is the
programme, and the word w is the input to the programme. It is not too difficult
to give a formal description of a Universal Turing Machine: for example, Marvin
Minsky in 1962 managed to design one with only 7 states, and a tape alphabet of
size 4.
2. Decidability
[See Sipser §4.1]
The study of decidability is the study of what can be computed in finite time.
Despite much study, it is still not known whether f (n) returns 1 for all n 2 N,
or if there are values of n for which the recursion never terminates.
Example 2.4. The Turing machine M1 from Chapter 3, Example 1.2 is a decider.
To see this, notice that M1 always moves right unless it is going to a halt state. So
each letter of the input word is read at most once, and the first blank cell is read
at most once and is the only blank cell that is read. So M1 always halts in finite
time. So the language from this example is decidable.
The Turing machine M2 from Chapter 3, Example 1.5 is also a decider. To
see this, notice that at each pass through the word, M2 crosses out half of the
remaining 0s, and looks at at most one blank cell. Either M2 stops early (if it
rejects), or eventually all but one of the 0s will be crossed o↵, and M will accept.
n
In either case, M2 is guaranteed to halt in finite time, so L2 = {02 : n 0} is
decidable.
The proof of the following theorem is omitted, as it uses Chomsky Normal Form
for CFGs, which we haven’t covered. If you’d like to see the proof anyway, it’s
Sipser Theorem 4.8 (you’ll also need to read Sipser Theorem 4.6).
In particular, Theorem 2.6 shows that all regular languages are decidable.
That is, design a Turing machine that will decide whether or not a given Turing
machine accepts a given word.
Notice that the Universal Turing Machine is not a decider. If the machine M
runs forever on input w, then U runs forever on input hM, wi.
Theorem 3.3 (Alan Turing, 1936) The language AT is not decidable, so the
acceptance problem cannot be solved.
1. Simulate M1 on input hM i.
Hence either way around there is a contradiction, and so our initial assumption
must have been wrong: there does not exist a decider MT for AT . ⌅
Problem 3.4. [The Halting Problem] Find a decider for the language
2. If MH rejects, reject.
If M accepts w then S accepts hM, wi. If M rejects w then S rejects hM, wi.
If M runs forever on w then S rejects hM, wi. Hence L(S) = AT , the language
from the Acceptance Problem 3.1. Furthermore, S is a decider. But we showed in
Theorem 3.3 that AT is undecidable. This is a contradiction, so there is no such
Turing machine S, and H is undecidable. ⌅
4. Turing recognisability
[See Sipser §4.2]
We finish this part of the course by showing that in fact almost all languages are
not even Turing recognisable. Hence almost all decision problems cannot be solved
on a computer.
Recall that if K ✓ ⌃⇤ is a language then the complement of K, denoted K, is
the language of all words in ⌃⇤ that are not in K.
Corollary 4.2. Let AT be the language from the Acceptance Problem 3.1. Then
the language AT is not Turing recognisable.
We now show that almost all languages are not recognisable. The proof is via
a mathematical trick called diagonalisation, which can be used to show that one
infinite set is bigger than another, and is due to Georg Cantor in 1873. Cantor
observed that two finite sets have the same size if the elements of the first set can
be paired up with the elements of the other sets: this is a way of thinking about size
that doesn’t rely on counting both sets, and so lets us measure the sizes of infinite
sets.
Theorem 4.5. The set B of all infinitely-long words over {0, 1} is uncountable.
44 CHAPTER 4. THE LIMITS OF COMPUTATION
Theorem 4.6. 1. There are only countably many languages that are Turing
recognisable.
2. There are uncountably many languages that are not Turing recognisable.
Proof. We proved the first containment in Chapter 2, Theorem 1.4, and asserted
the second in Theorem 2.6. The fact that every decidable language is recognisable
was Lemma 2.3. Now we know that almost all languages, including AT in particular,
are not recognisable. ⌅