| Overall Reading | |
|---|---|
| Decker/Hirshfield: | pp. 278-290 |
| Brookshear: | (Optionally) Ch. 11.3-11.4 |
Outline:
This is a very important theorem in Computer Science. The proof is quite involved; we will try to give the general idea.
The example we will use in this lecture is the following:
Given a TM program and an initial tape, determine whether or not the TM will come to a halt.There is no way to program a Turing Machine which solves this task. This "halting problem" is undecidable.
(the text gives several other examples of undecidable problems)
It states that,
a Turing Machine can be programmed to compute any
function which is "computable" by some other algorithmic process.
The reason that it is a conjecture and not a true theorem is that we need to first agree on a clean definition for "algorithmic process."
What is certainly true is that a Turing Machine can compute any
function which can be computed by contemporary machines. (not bad for
a model from 1936).
[Granted: using a Turing Machine may not be the most efficient method]
This isn't really a surprise.
For the record, the book comes up with a more convenient way to turn a TM into an integer. There are many possible systems.All that matters is that a TM can be converted to a number, and that the number can be converted back to the same TM.
Hopefully you could. Why? Because it is straightforward; You just follow the rules.
I bet we could write a program to do this for us!
Though we won't, it is possible to build what we call a Universal Turing Machine
Question: Can any Turing Machine computing this function P?
Answer: No!
If there were such a Turing Machine, that machine would have to have a serial number. But function P() is not computed by Mk for any such k.
In particular,
if Mk produces a non-empty string, then P(k)=""
if Mk produces the empty string, then P(k)="0"
Function P s noncomputable by Turing Machines
And if we believe the Church-Turing thesis, noncomputable by any algorithm process.
It seems a simple step from there. Given input n, calculate P(n) as follows:
Why can't we build this program? What's the flaw?
The problem is that we assume that when we run the simulation, we see
the output of that simulation.
What if that simulation never halts? P(n) should equal "0" so presumably our machine must stop the simulation to output "0".
But how did it know that the simulation was never going to halt? Maybe it was just taking a really long time, but was five seconds away from producing its answer.
In general, we can not determine whether a Turing Machine which has been running for a long time will run forever or eventually halt.