The Halting Problem Sipser 4.2 (pages 173-182). CS 311 Mount Holyoke College 2 Taking stock All languages Turing-recognizable Turing-decidable Context-free.

Slides:



Advertisements
Similar presentations
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Advertisements

Turing -Recognizable vs. -Decidable
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
Computability and Complexity 5-1 Classifying Problems Computability and Complexity Andrei Bulatov.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
Measuring Time Complexity Sipser 7.1 (pages )
Algorithms Sipser 3.3 (pages ). CS 311 Mount Holyoke College 2 Computability Hilbert's Tenth Problem: Find “a process according to which it can.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
Introduction to Computability Theory
Turing machines Sipser 2.3 and 3.1 (pages )
Reducibility Sipser 5.1 (pages ).
The Halting Problem Sipser 4.2 (pages ).
Mapping Reducibility Sipser 5.3 (pages ).
More Turing Machines Sipser 3.2 (pages ).
Mapping Reducibility Sipser 5.3 (pages ). CS 311 Fall Computable functions Definition 5.17: A function f:Σ*→Σ* is a computable function.
Decidable languages Sipser 4.1 (pages ). CS 311 Mount Holyoke College 2 Hierarchy of languages All languages Turing-recognizable Turing-decidable.
CSCI 2670 Introduction to Theory of Computing October 19, 2005.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
CHAPTER 4 Decidability Contents Decidable Languages
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Computer Language Theory
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Turing -Recognizable vs. -Decidable
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
The Acceptance Problem for TMs
Discrete Mathematics CS 2610
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
This statement is false.
CSCI 2670 Introduction to Theory of Computing
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
Reductions Costas Busch - LSU.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
Theory of Computability
CS21 Decidability and Tractability
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Decidability continued….
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

The Halting Problem Sipser 4.2 (pages )

CS 311 Mount Holyoke College 2 Taking stock All languages Turing-recognizable Turing-decidable Context-free languages Regular languages 0n1n0n1n anbncnanbncn D 0*1*0*1* ?

CS 311 Mount Holyoke College 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?

CS 311 Mount Holyoke College 4 What about deciding TMs? A TM = { | M is a TM and M accepts w } Theorem 4.11: A TM is undecidable! Is it even recognizable? Let U = “On input, where M is a TM: 1.Simulate M on input w. 2.If M ever enters its accept state, accept; if M ever enters its reject state, reject.”

CS 311 Mount Holyoke College 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

CS 311 Mount Holyoke College 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 numbers 1, 2, 3,… )

CS 311 Mount Holyoke College 7 For example… E = { even natural numbers } is countable Define f : N → E as f(n) = 2n nf(n) ……

CS 311 Mount Holyoke College 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. nf(n) … … … … ……

CS 311 Mount Holyoke College 9 Put your thinking caps on! How do we show that: – Σ* is countable assume Σ = {0,1} – B = { all infinite binary sequences } is uncountable

CS 311 Mount Holyoke College 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 = …

CS 311 Mount Holyoke College 11 The Halting Problem A TM = { | M is a TM and M accepts w } Theorem 4.11: A TM is undecidable. Proof: By contradiction. Assume H is a decider for A TM. We construct a TM D = “On input, where M is a TM: 1.Run H in input > 2.If H accepts, reject; if H rejects, accept.”

CS 311 Mount Holyoke College 12 D( ) = accept if M does not accept reject if M accepts Huh? What if we run D on ? Then Contradiction! Then H cannot exist and A TM is undecidable. D( ) = accept if D does not accept reject if D accepts

CS 311 Mount Holyoke College 13 Where is the diagonalization? Running a machine on its description … M1M1 accept M2M2 M3M3 M4M4 …

CS 311 Mount Holyoke College 14 Where is the diagonalization? Running H on a machine and its description … M1M1 acceptrejectacceptreject M2M2 accept M3M3 reject M4M4 accept reject …

CS 311 Mount Holyoke College 15 Where is the diagonalization? Adding D to the picture … … M1M1 acceptrejectacceptreject M2M2 accept M3M3 reject M4M4 accept reject … D accept ? …

CS 311 Mount Holyoke College 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 A TM is not Turing-recognizable!

CS 311 Mount Holyoke College 17 Updating the picture All languages Turing-recognizable Turing-decidable Context-free languages Regular languages 0n1n0n1n anbncnanbncn D 0*1*0*1* A TM