1 / 17

The Halting Problem

The Halting Problem. Sipser 4.2 (pages 173-182). Taking stock. All languages. Turing-recognizable. ?. D. Turing-decidable. Context-free languages. a n b n c n. Regular languages. 0 n 1 n. 0 * 1 *. Are there problems a computer can’t solve?!. But they seem so powerful…

argus
Download Presentation

The Halting Problem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Halting Problem Sipser 4.2 (pages 173-182)

  2. Taking stock All languages Turing-recognizable ? D Turing-decidable Context-free languages anbncn Regular languages 0n1n 0*1*

  3. Are there problems a computer can’t solve?! • But they seem so powerful… • What about software verification? • Given a program and a specification of what it should do, can we check if it is correct?

  4. What about deciding TMs? • ATM = {<M,w> | M is a TM and M accepts w} • Theorem 4.11: ATM is undecidable! • Is it even recognizable? • Let U = “On input <M,w>, where M is a TM: • Simulate M on input w. • If M ever enters its accept state, accept; if M ever enters its reject state, reject.”

  5. Towards proving undecidability • Cantor 1873: How can we tell whether one infinite set is “larger” than another? • A function f from A to B is • One-to-one if f(x) ≠ f(y) if x≠y • (f never maps two elements to the same value) • Onto if every element of B is hit • A correspondence is a function that is both one-to-one and onto

  6. Countable sets • Sets A and B have the same size if: • A and B are finite with the same number of elements • A and B are infinite with a correspondence between them • A set is countable if it is finite or has the same size as N • (natural numbers1, 2, 3,…)

  7. For example… • E = { even natural numbers } is countable • Define f : N→ Eas f(n) = 2n

  8. Diagonalization • Theorem 4.17: R is uncountable. • Proof: By contradiction. Assume there is a correspondence. We find a real number x ≠ f(n) for any natural number n.

  9. Put your thinking caps on! • How do we show that: • Σ* is countable • assumeΣ = {0,1} • B = { all infinite binary sequences } is uncountable

  10. Uh-oh… • Theorem 4.18: Some languages are not Turing-recognizable. • Proof: Let L be the set of all languages over Σ. Define a correspondence from L to B. Σ*= { ε, 0, 1, 00, 01, 10, 11, 000, 001,…} A = { 0, 00, 01, 000, 001,…} ΧA= 0 1 0 1 1 0 0 1 1 …

  11. The Halting Problem • ATM = {<M,w> | M is a TM and M accepts w} • Theorem 4.11:ATMis undecidable. • Proof: By contradiction. Assume H is a decider for ATM. We construct a TM D = “On input <M>, where M is a TM: • Run H in input <M, <M>> • If H accepts, reject; if H rejects, accept.”

  12. Huh? • What if we run D on <D>? • Then • Contradiction! Then H cannot exist and ATM is undecidable.

  13. Where is the diagonalization? • Running a machine on its description

  14. Where is the diagonalization? • Running H on a machine and its description

  15. Where is the diagonalization? • Adding D to the picture

  16. So have we found a language that is not Turing-recognizable? • Theorem 4.22: A language is decidable iff it and its complement are recognizable • Then ATMis not Turing-recognizable!

  17. Updating the picture All languages Turing-recognizable ATM D Turing-decidable Context-free languages anbncn Regular languages 0n1n 0*1*

More Related