Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computability Theory

Similar presentations

Presentation on theme: "Introduction to Computability Theory"— Presentation transcript:

1 Introduction to Computability Theory
04:39:06 Introduction to Computability Theory Lecture14: The Halting Problem Prof. Amos Israeli

2 The Halting Problem In this lecture we present an undecidable language. The language that we prove to be undecidable is a very natural language namely the language consisting of pairs of the form where M is a TM accepting string w:

3 The Halting Problem Since this language requires to decide whether the computation of TM M halts on input w, it is often called The Halting Problem. Theorem The halting problem is Turing Recognizable.

4 Proof Consider a TM U that gets a pair as input and simulates the run of M on input w. If M accepts or rejects so does U. Otherwise, U loops. Note: U recognizes ATM ,since it accepts any pair , that is: any pair in which M accepts input w.

5 Simulating an Input TM On the previous lecture, we detailed the simulation of a DFA by a TM. Simulating one TM by another, using the encoding of the first TM is a very similar process. In the next slide we review the main characteristics of TM N simulating TM M, using M’s encoding <M>.

6 Simulating an Input TM TM N works as follows:
Mark M’s initial state and w’s initial symbol as the “current state” and “current head location”. Look for M’s next transition on the description of its transition function. Execute M’s transition.

7 Simulating an Input TM Move M’s “current state” and “current head location” to their new places. If M’s new state is a deciding state decide according to the state, otherwise – repeat stages 2-5.

8 The Language ___ Is Undecidable
So far we proved the existence of a language which is not Turing recognizable. Now we continue our quest to prove: Theorem The language is undecidable.

9 The Language ___ Is Undecidable
Before we start the proof let us consider two ancient questions: Question1: Can god create a boulder so heavy such that he (god) cannot lift?

10 The Language ___ Is Undecidable
Question2: In the small town of L.J. there is a single barber: Over the barber’s chair there is a note saying: “I will shave you on one condition: Thaw shall never shave thyself!!!” Who Shaves the Barber?

11 Proof Assume, by way of contradiction, that is decidable and let H be a TM deciding . That is Define now another TM, D, that uses H as a subroutine as follows:

12 Proof Define now another TM new D that uses H as a subroutine as follows: D=“On input where M is a TM: 1. Run H on input . 2. Output the opposite of H’s output namely: If H accepts reject, otherwise accept.“

13 Proof Note: What we do here is taking advantage of the two facts: Fact1: TM M should be able to compute with any string as input. Fact2: The encoding of M, , is a string.

14 Proof Running a machine on its encoding is analogous to using a compiler for the computer language Pascal, to compile itself (the compiler is written in Pascal). As we recall from the two questions self-reference is sometimes means trouble (god forbid…)

15 Proof What we got now is: Consider now the result of running D with input . What we get is:

16 Proof So if D accepts, it rejects and if it rejects it accepts. Double Trouble. And it all caused by our assumption that TM H exists!!!

17 Proof Review Define Assume that id decidable and let H be a TM deciding it. Use H to build TM D that gets a string and behaves exactly opposite to H’s behavior, namely:

18 Proof Review Run TM D on its encoding and conclude: Contradiction.

19 So Where is the Diagonalization?
The following table describes the behavior of each machine on some machine encodings:

20 So Where is the Diagonalization?
This table describes the behavior of TM H. Note: TM H rejects where loops.

21 Proof Review Now TM D is added to the table…

22 __ Is Not Turing Reecognizable
So far we proved the existence of a language which is not Turing recognizable. Now we will prove a theorem that will enable us to identify a specific language, namely , as a language that is not Turing recognizable.

23 __ Is Not Turing Reecognizable
(Reminder) A Language L is Turing recognizable if there exists a TM recognizing L. That is, a TM that accepts any input . A Language L is co-Turing recognizable if the complement of L, , is Turing recognizable.

24 __ Is Not Turing Reecognizable
Theorem A language L Is decidable, if and only if it is Turing recognizable and co-Turing recognizable. Proof -> If L is decidable so is its complement, . Any decidable language is Turing recognizable.

25 __ Is Not Turing Reecognizable
Proof -> If L is decidable so is its complement, . A TM to decide , is obtained by running a TM deciding L and deciding the opposite. Any decidable language is Turing recognizable, hence is Turing recognizable and L is co-Turing recognizable.

26 __ Is Not Turing Recognizable
Proof <- If L and are both Turing recognizable, there exist two TM-s, , and , that recognize and , respectively. A TM M to decide L can be obtained by running both , and in parallel and halt when one of them accepts.

27 __ Is Not Turing Recognizable
Corollary The language is not Turing recognizable. Proof We already know that is Turing recognizable. Assume is Turing recognizable. Then, is co-Turing recognizable. By the previous theorem is decidable, a contradiction.

28 Discussion This is the diagram we had after we studied CFL-s: RL-s Ex:
??? Non CFL-s Ex: CFL-s Ex: RL-s Ex:

29 Discussion Now, we can add some more details: Non Turing recognizable
Ex: Now, we can add some more details: Turing recognizable Ex: Decidable Ex: CFL-s Ex: RL-s Ex:

Download ppt "Introduction to Computability Theory"

Similar presentations

Ads by Google