0% found this document useful (0 votes)
5 views6 pages

halting_lecturenotes

The lecture notes discuss the Halting Problem and related concepts in computability theory, including Turing-recognizable and Turing-decidable languages. Key results include the undecidability of the languages XT M and AT M, as well as the use of reductions to demonstrate the undecidability of other languages like HALTT M and REGT M. The notes emphasize that while some Turing machines can predict the output of others, no Turing machine can universally predict halting behavior or recognize all languages.

Uploaded by

Shirshak Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

halting_lecturenotes

The lecture notes discuss the Halting Problem and related concepts in computability theory, including Turing-recognizable and Turing-decidable languages. Key results include the undecidability of the languages XT M and AT M, as well as the use of reductions to demonstrate the undecidability of other languages like HALTT M and REGT M. The notes emphasize that while some Turing machines can predict the output of others, no Turing machine can universally predict halting behavior or recognize all languages.

Uploaded by

Shirshak Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Lecture Notes:

The Halting Problem; Reductions


COMS W3261
Columbia University
20 Mar 2012

1 Review
Key point. Turing machines can be encoded as strings, and other Turing machines can read
those strings to peform “simulations”.

Recall two definitions from last class:

Definition 1. A language is Turing-recognizable if there exists a Turing machine which


halts in an accepting state iff its input is in the language.

Definition 2. A language is Turing-decidable if it halits in an accepting state for every


input in the language, and halts in a rejecting state for every other input.

Intuitively, for recognizability we allow our TM to run forever on inputs that are not in
the language, while for decidability we require that the TM halt on every input.
Now recall our two most important results:

Theorem 1. There exist (uncountably many!) languages which are not Turing-recognizable.

Proof. (intuitive) There are as many strings as natural numbers, because every (finite) string
over a finite alphabet can be encoded as a binary number. There are as many TMs as strings,
because every TM can be encoded as a string. Thus, both the strings and the TMs are
countably infinite.
There are as many languages as real numbers. Every language is a subset of the set of
strings; we can think of this subset as being encoded by an infinite binary sequence (i.e. a
real number) with 1s at indices corresponding to strings in the language and 0s everywhere
else.
Thus there are more languages than Turing machines; we conclude that some (indeed,
“most”) languages are not recognized by any TM.
Now we will construct a specific undecidable language.

1
Definition 3. The language XT M = {hM i : M does not accept hM i}

Theorem 2. XT M is not Turing-decidable.

Question. Give the “paradox” proof.

Proof 1. (by Epimenides’ paradox) Suppose we had a Turing machine M deciding this lan-
guage. What happens when we run M with input hM i? If we claim it accepts, then by
definition it ought to reject; if it rejects, then it ought to accept! Either way, we have a
contradiction.
Alternatively, here’s a proof that it’s not even Turing-recognizable.

Question. Give the “diagonalization” proof.

Proof 2. (by diagonalization) Suppose we constructed an (infinite) chart listing all the Turing
machines and all encodings of Turing machines. We write 1 in cell [i, j] if Mi accepts hMj i
and 0 otherwise:
hM1 i hM2 i hM3 i · · ·
M1 0 1 1
M2 1 1 1
M3 1 0 1
.. ..
. .
(The particular arrangement of 1s and 0s is unimportant—it will depend on our encoding
scheme.) Note that by reading the 1s from the ith row, we get the language decided by
Mi . Does XT M appear in any row of this list? Not the first row: M1 rejects hM1 i, so hM1 i
must be in XT M . Not the second row: M2 accepts hM2 i, so hM2 i must not be in XT M .
Continuing with this procedure, we can show that XT M is not the same as any row of this
enumeration of TMs, and as a consequence is not decided by any TM.

2 The Accepting Problem


XT M is admittedly a rather strange language, and it’s not obvious why we should really care
that it’s not recognizable. Let’s look at a different one:

Definition 4. The language AT M = ({hM i, w) : M accepts w}

The question of whether AT M is decidable is precisely the question of whether one TM


can predict the output of another TM!

Question. Is this language Turing-recognizable?

Yes. Given hM i, w as input, we can just simulate M on w.

Question. Is this language Turing-decidable?

2
No.
Theorem 3. AT M is undecidable.
Proof. Suppose, towards contradiction, that we had a TM M deciding AT M . Then we could
construct a TM N deciding XT M , as follows:
• Given input hP i:

• Run M on hP, P i.

• If M accepts, reject.

• If M rejects, accept.
Clearly, N is a TM deciding XT M . But we know that there no such TM exists! Because the
existence of M implies the existence of N , we conclude that M also does not exist.
Clarification. Understand why AT M is recognizable but not decidable.
Key point. There is no Turing machine which can predict the output of all other Turing
machines. However, there are Turing machines which can predict the output of some other
Turing machines.

3 The Halting Problem


Let’s try a more modest goal: rather than actually attempting to predict output, let’s just
predict whether a Turing machine halts on its input, or runs forever.
Definition 5. The language HALTT M = {(hM i, w) : M halts on input w}
Question. Is this language Turing-recognizable?
Yes: again, it just simulates (but it will run forever if the simulated machine does!).
Question. Is this language Turing-decidable?
No.
Theorem 4. HALTT M is undecidable.
Proof. This is very much like the previous proof. Suppose we had a TM M deciding
HALTT M . The we could construct a TM N deciding AT M , as follows:
• Given input (hP i, w):

• Run M on (hP i, w).

• If M rejects, reject: P runs forever given input w, so does not accept w.

3
• Otherwise, we know that P terminates, and it is “safe” to simulate it on w. Do so.

• If P accepts, accept.

• If P rejects, reject.

Clearly, N decides AT M . Similarly to the previous proof, we know that AT M is undecidable,


so M cannot exist.

Key point. There is no Turing machine which finds infinite loops in all other Turing ma-
chines (though again, it may do so for a restricted subset). This is a problem which would
have real, practical benefits if it were soluble, but it’s not.

Clarification. Is this clear?

4 Other Undecidable Languages


Definition 6. The language ET M = {hM i : L(M ) = ∅}

Question. Is this language decidable?

No: we can construct a decider for AT M again.


Proof. Suppose M decides ET M .

• Given input hP, wi:

• Construct a new TM P 0 which rejects if its input is not w, and otherwise simulates P
on w.

• Run M on hP i.

• If M accepts, reject.

• If M rejects, accept.

We have a contradiction.

5 Reductions
In working through these examples we’ve come across a very powerful proof technique: to
prove that some language is undecidable, we assume that we have a decider, and show that
this implies the existence of a decider for a known undecidable problem. This technique is
called reduction.
There are several different kinds of reduction; the kind that we’ve discussed so far is
called Turing reduction (for reasons that are hopefully obvious). The general idea is that

4
we assume we have a TM which computes the solution to one problem, and we use that to
compute the solution to another problem.
To say that a solver for B allows us to solve A (“A reduces to B”), we write

A ≤T B

(I’ve always found this notation weird. An easy way to remember it is that if A is reducible
to B, the machine that computes B is at least as powerful as the machine that computes
A: it is definitely powerful enough to solve A, and maybe other problems as well. So A is
“easier than” B.)
Question. AT M ≤T XT M , or vice-versa?
Vice-versa.

Let’s formalize the proof technique we’ve been using so far:


Theorem 5. A ≤T B and B decidable → A decidable.
Corollary 1. A ≤T B and A undecidable → B undecidable.

6 Other Undecidable Languages, continued


Now let’s try a few more reductions:
Definition 7. The language REGT M = {hM i : L(M ) is regular}
Question. Prove that this is undecidable. (Hint: reduce from AT M )
Proof. Suppose we have a decider M for REGT M .
• Given input hP, wi:

• Construct a new TM P 0 as follows:

– If the input is of the form 0n 1n , accept.


– Otherwise, ignore the input and run P on w

• Run M on P 0

If M doesn’t accept w, L(P 0 ) = {0n 1n }, and is not regular. If M accepts w, L(P 0 ) = Σ∗ .


Thus,

• If M accepts, accept.

• If M rejects, reject.
Once again, a contradiction.

5
Definition 8. The language EQT M = {(hM i, hN i) : L(M ) = L(N )}

Question. Prove that this is undecidable. (Hint: reduce from ET M )

Proof. Suppose we have a decider M for EQT M . Construct the following decider for ET M :

• Given input hP i:

• Construct a TM Q which rejects immediately on all inputs.

• Run M on (hP i, hQi), and accept iff it accepts.

Once again, a contradiction.

7 Next Class
It seems like every interesting language of Turing machines we’ve come up with is undecid-
able. Is there any property of Turing machines which can be decided?

You might also like