90 likes | 315 Vues
The halting problem - proof. Review. What makes a problem decidable ? 3 properties of an efficient algorithm? What is the meaning of “ complete ”, “ mechanistic ”, and “ deterministic ”? Is the Halting Problem decidable/undecidable? How would you define the Universal Turing Machine ?.
E N D
Review • What makes a problem decidable? • 3 properties of an efficient algorithm? • What is the meaning of “complete”, “mechanistic”, and “deterministic”? • Is the Halting Problem decidable/undecidable? • How would you define the Universal Turing Machine?
Halting problem is undecidable Proof • Proof by contradiction • Assume that there is a TM H that solves the halting problem • The computation of H can be depicted as follows: M halts with input w Accept H R(M)w Reject M does not halt with input w
Halting problem is undecidable Proof • We modify H to construct a new TM H’, which behaves very much as H: • The computations of H’ are the same as H, except that H’ loops indefinitely whenever H terminates in an accepting state, i.e., whenever H halts on input w, and halts otherwise M halts with input w Loop H’ R(M)w Halt M does not halt with input w
Halting problem is undecidable Proof • H’ is combined with a copy machine to construct a new TM D: • The input to D is a TM representation R(M) • A computation of D begins with copying the string R(M) to yield R(M)R(M) • The computation continues by running H’ on R(M)R(M) M halts with input R(M) Loop H’ Copy R(M) R(M) R(M) Halt M does not halt with input R(M) D
Halting problem is undecidable Proof • Consider a computation of D with input R(D): • The input to D is the representation to any arbitrary TM D halts with input R(D) Loop H’ Copy R(D) R(D) R(D) Halt D does not halt with input R(D) D • Examining the preceding computation, we see that: • D halt on input R(D) iff Ddoes not halt on input R(D), which is a contradiction • Therefore, the original assumption is wrong and the halting problem is undecidable