Presentation is loading. Please wait.

Presentation is loading. Please wait.

Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila.

Similar presentations


Presentation on theme: "Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila."— Presentation transcript:

1 Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila

2 Undecidable Languages We are going to make 2 proofs:  An existence proof:  We show that a language L must exist that cannot be decided/recognized with Turing machines without actually showing L  A constructive proof  We show that the halting is not decidable

3 The Existence Proof: History Irrational number exist Greek mathematicians Deadly controversial 6th century BC Turing machines capture any algorithm There are many more Real numbers than there are natural numbers There are as many rational numbers as there are natural numbers controversial Late 1800’s Cantor Gödel incompleteness theorem Gödel numberings 1930’s Some problems cannot be solved by computers Turing machines Formal model of computation Decidable languages and enumerability results

4 The Existence Proof

5 Comparing Sets Two sets A and B have the same size if:

6 Comparing Sets Two sets A and B have the same size if: –There is a function f: A  B that is bijective

7 Comparing Sets Two sets A and B have the same size if: –There is a function f: A  B that is bijective

8 Countable Sets The set of all Natural numbers: –N = {1, 2, …} Set A is countable if it has the same size as N Example: The set of all integers have the same size as N. The function f is bijective: –f(n) = -((n-1)/2) (if n is odd) –f(n) = (n/2) (if n is even)

9 Countable Sets The set of all Natural numbers: –N = {1, 2, …} It is easier to think of countable sets as those that can be enumerated with an enumerated Turing machine Program enumerateAllNaturals() n  1 while (true) { print(n) n  n + 1 } Program enumerateAllIntegers() n  1 while (true) { if odd(n) then print(-((n-1)/2)) else print(n/2) n  n + 1 }

10 The set of All Rational Numbers is Countable Q = {p/q | p, q  N }  {0} Perhaps easier than finding a function f: N  Q that is bijective is to think of a Turing machine that enumerates Q See blackboard for a description of the procedure –Same as described in Example 4.15

11 The Real Numbers R = “the set of all real numbers” We can show that R has the same size as (-  /2,  /2) by using: – f(x) = tan(x) In general: R has the same size as (a,b) for any two real numbers with a < b –You studied this in Calc I

12 The Real Numbers are Not Countable Proof: see blackboard –Same as Theorem 4.17

13 There Exists a Non-decidable l Language Three steps (Corollary 4.18): (1) M = “set of all binary encodings of Turing machines” is countable (2) L = “set of all binary sequences of languages” is not countable (3) Hence, there exists a language l,  L such that no Turing machine can decide it

14 Step 1: M is Countable It is easy to construct a procedure that enumerates (choose one): –All Turing machines –All C++ programs –All Java programs See blackboard for procedure Homework for Monday asks you to reconstruct this procedure Actual mathematical proof uses Godel numberings (not in the book)

15 Step 2: L is not countable Assume  = {0,1} (the proof works with any finite alphabet) Consider  * listed in Lexicographical Order We define the characteristic sequence for a language L We define: –L = { | L is a language in  } See blackboard for preliminaries Homework for Monday asks you to finish the proof

16 Step 3 Because: –M = “set of all Turing machines” is countable –L = “set of all languages” is not countable We can now proof that there exists a language l in L such that no Turing machine can decide it

17

18 Does the following program halts? Source: http://faculty.orangecoastcollege.edu/sgilbert/CS170S09/u05/E.htmlhttp://faculty.orangecoastcollege.edu/sgilbert/CS170S09/u05/E.html

19 Does the following program halts? Source: http://snap.nlc.dcccd.edu/learn/fuller3/chap10/chap10.htmlhttp://snap.nlc.dcccd.edu/learn/fuller3/chap10/chap10.html

20 A Concrete Undecidable Language The halting problem is not decidable Formally, the following set is not decidable: –HALT = { | M is a Turing machine, w   *, M halts on input w} Kleene Barkley RosserChurch Turing Gödel

21 Note Modern program editors detect instances of infinite loops Does this contradict the statement that HALT is undecidable? Editor says: “Warning potential infinite loop here”

22 A Paradox “In Sevilla, Spain lives Pepe a barber who…”

23 Actual Proof First: example of a situation where a write a program M and pass as parameter the binary encoding of –i.e., call M( ) Proof by contradiction: –Assume that HALT is decidable: HALT = { | M is a Turing machine, w   *, M halts on input w} –Let H be a decider for HALT –Rest of the proof in the blackboard: (Theorem 4.11)


Download ppt "Undecidable Languages (Chapter 4.2) Héctor Muñoz-Avila."

Similar presentations


Ads by Google