Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.

Similar presentations


Presentation on theme: "The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007."— Presentation transcript:

1 The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007

2 The Acceptance Problem for Turing Machines The Acceptance Problem for Turing Machines: Given a Turing machine M and a string w, does M accept w? The language is A TM = {  M, w  | M accepts w)}.

3 A TM is Turing- Recognizable Theorem: A TM is Turing- recognizable. Proof: Build a Turing machine U that will read a representation of M and simulate it on the input w.

4 A TM is Turing- Recognizable If U halts in the accept state, then accept  M, w . If U halts in the reject state, then reject  M, w . The problem is that U may run forever. That is why U is only a recognizer, not a decider.

5 Universal Turing Machines A universal Turing machine is a Turing machine that can read a description of any Turing machine and simulate it. Do universal Turing machines really exist?

6 Universal Turing Machines Yes. (We call them programmable computers.) They read a description of a Turing machine. (We call the description a program.) Then they simulate the Turing machine. (We say they execute the program.)

7 Turing-Unrecognizable Languages Theorem: There exist Turing- unrecognizable languages. Lemma: The set of all Turing machines is a countably infinite set. Proof of the Lemma: Each Turing machine has a finite description: (Q, , , , q 0, q acc, q rej ).

8 Turing-Unrecognizable Languages Express each description in binary, perhaps by using ASCII. Thus, the set of all Turing machines is represented by a set of finite binary strings. We already know that every set of finite binary strings is countable. (They can be arranged in lexicographical order.)

9 Turing-Unrecognizable Languages Lemma: The set of infinite binary strings is uncountable. Proof of the Lemma: We need to use a diagonalization argument, which is based on proof by contradiction.

10 Turing-Unrecognizable Languages Suppose the set is countable. Then the set of all infinite binary strings can be listed w 1, w 2, w 3, and so on. Create a binary array that is infinite to the right and down by letting row i be the bits in w i, for i = 1, 2, 3, …

11 Turing-Unrecognizable Languages Define an infinite binary string w as follows. If the i th bit in row i is 0, set the i th bit of w to 1. If the i th bit in row i is 1, set the i th bit of w to 0.

12 Turing-Unrecognizable Languages Certainly, w is an infinite binary string. But w cannot be in the list of all infinite binary strings because it disagrees with every w i in the list. This is a contradiction. Therefore, the set must be uncountable.

13 Turing-Unrecognizable Languages Proof of the Theorem: Suppose that every language is recognizable. Then for every language L, there is a Turing machine M that recognizes it. That is, L(M) = L.

14 Turing-Unrecognizable Languages For any language L, create an infinite binary string s as follows. Make a list of all binary strings and order it lexicographically. For the i th word w i in the list, if w i is in L, then the i th bit of s is 1. If w i is not in L, then the i th bit of s is 0.

15 Turing-Unrecognizable Languages This is a one-to-one correspondence between the set of all languages and the set of all infinite binary strings. Thus, the set of all languages is uncountable.

16 Turing-Unrecognizable Languages But for every language, there is (supposedly) a Turing machine that accepts it. That would require uncountably many Turing machines. This is a contradiction. Thus, there exist languages that are not Turing-recognizable.


Download ppt "The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007."

Similar presentations


Ads by Google