undecidable languages (chapter 4.2)

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

Upload: greta

Post on 24-Feb-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Undecidable Languages (Chapter 4.2). H éctor Muñoz-Avila. 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Undecidable Languages (Chapter  4.2)

Undecidable Languages

(Chapter 4.2)

Héctor Muñoz-Avila

Page 2: Undecidable Languages (Chapter  4.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 proofWe show that the halting is not decidable

Page 3: Undecidable Languages (Chapter  4.2)

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’sCantor

• 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

Page 4: Undecidable Languages (Chapter  4.2)

The Existence Proof

Page 5: Undecidable Languages (Chapter  4.2)

Comparing Sets

• Two sets A and B have the same size if:

Page 6: Undecidable Languages (Chapter  4.2)

Comparing Sets

• Two sets A and B have the same size if:– There is a function f: A B that is bijective

Page 7: Undecidable Languages (Chapter  4.2)

Comparing Sets

• Two sets A and B have the same size if:– There is a function f: A B that is bijective

Page 8: Undecidable Languages (Chapter  4.2)

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)

Page 9: Undecidable Languages (Chapter  4.2)

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 }

Page 10: Undecidable Languages (Chapter  4.2)

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

Page 11: Undecidable Languages (Chapter  4.2)

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

Page 12: Undecidable Languages (Chapter  4.2)

The Real Numbers are Not Countable

• Proof: see blackboard– Same as Theorem 4.17

Page 13: Undecidable Languages (Chapter  4.2)

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> L such that no Turing machine can decide it

Page 14: Undecidable Languages (Chapter  4.2)

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)

Page 15: Undecidable Languages (Chapter  4.2)

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 <L> for a

language L• We define:

– L = {<L>| L is a language in }• See blackboard for preliminaries• Homework for Monday asks you to finish the proof

Page 16: Undecidable Languages (Chapter  4.2)

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

Page 17: Undecidable Languages (Chapter  4.2)
Page 20: Undecidable Languages (Chapter  4.2)

A Concrete Undecidable Language

• The halting problem is not decidable

• Formally, the following set is not decidable:– HALT = {<M,w> | M is a Turing machine, w *, M halts on input

w}

KleeneBarkley RosserChurchTuringGödel

Page 21: Undecidable Languages (Chapter  4.2)

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”

Page 22: Undecidable Languages (Chapter  4.2)

A Paradox

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

Page 23: Undecidable Languages (Chapter  4.2)

Actual Proof• First: example of a situation where a write a program M

and pass as parameter the binary encoding of <M>– i.e., call M(<M>)

• Proof by contradiction: – Assume that HALT is decidable:

• HALT = {<M,w> | 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)