announcements homework – hw8 due tues 5/29 11am – hw5 grades are out monday is memorial day; no...

26
Announcements • Homework – HW8 due Tues 5/29 11am – HW5 grades are out • Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks, or something • TA Evaluations at the end of class! • There’s a lot of stuff in today’s lecture

Upload: paulina-willis

Post on 29-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

Announcements• Homework– HW8 due Tues 5/29 11am– HW5 grades are out

• Monday is Memorial Day; no office hours, etc.– Go see a parade, or some fireworks, or something

• TA Evaluations at the end of class!

• There’s a lot of stuff in today’s lecture

Page 2: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

2

CSE 105Theory of

Computability

Dr. Alexander TsiatasSpring 2012

Page 3: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

3

REVIEWPreparing for DIAGONALIZATION proof!!

Page 4: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

4

Sizes of infinite sets: countably infinite

• The natural numbers {0, 1, 2, 3, 4, …} are countably infinite.

• Any set that’s the same size as the natural numbers is countably infinite.

• 2 sets are the same size if there’s a correspondence between them.

• Informal, but equivalent: a set is countably infinite if you can list them systematically like the natural numbers.– The list will eventually contain ALL elements

Page 5: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

5

Sizes of infinite sets: strings

• For any alphabet (here, {0, 1}), the set of all strings is countably infinite:

• ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111, 0000, ….

Page 6: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

6

Sizes of infinite sets: Turing machines

• The set of all Turing machines is countably infinite:– You can just encode TM’s as strings.

Page 7: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

7

Sizes of infinite sets: Languages

• Remember: a language is a set of strings.• Can we make a list of ALL languages?• Let’s try

Page 8: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

8

Sizes of infinite sets: Languagess1=ε s2=0 s3=1 s4=0 s5=01 s6=10 s7=11 s8=000 …

L1L2L3L4L5L6L7L8…

Claim: no matter the order you list languages, there is ALWAYS one that’s not on the list.

BAD = {si | si is NOT in Li}

Page 9: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

9

So what?!?!

• No matter how you try to list languages, there’s always a BAD language not on the list.

• The set of languages is NOT countably infinite! The set of TM’s IS countably infinite!– |Languages| > |TM’s|

• Pigeonhole principle: there are languages that are NOT accepted by any TM.

Page 10: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

10

ATM = {<M,w> | M is a TM, M accepts w}

ATM is:

a) A language b) An operation c) A set of stringsd) A Turing Machinee) None or more than one of the above

Page 11: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

11

THE TM ACCEPTANCE PROBLEMATM

Page 12: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

12

ATM = {<M,w> | M is a TM, M accepts w}

ATM is Recognizable

a) TRUEb) FALSEc) Other

Page 13: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

13

ATM IS UNDECIDABLE

At last the proof you’ve all been waiting for!

Page 14: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

14

The Game Plan:

• Recall: ATM = {<M,w> | M is a TM, M accepts w}

• Thm: ATM is undecidable • Proof by Contradiction: • Assume (towards contradiction) that ATM is decidable, so there

exists some TM MATM decides ATM.

• Want to show: A TM D that uses MATM as a subroutine, allowing D to do something impossible/contradictory.

• D(w): //w is a string– What D is or what it does is totally up to us—but we will have to be

very clever to come up with something that will cause an impossibility/contradiction.

• Then, because we will have reached a contradiction, we will conclude that the assumption is false, and ATM is not decidable.

Page 15: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

15

Let’s look at MATM:

• Assume (towards contradiction) that ATM is decidable, so there exists some TM MATM decides ATM.

• Let TM G be a recognizer s.t. L(G) = {w | |w| is even}

• What will happen if we run MATM(<G,111>)?a) MATM accepts

b) MATM rejects

c) MATM loops

d) Not enough informatione) Other ATM = {<M,w> | M is a TM, M accepts w}

Page 16: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

16

Proof:• Thm: ATM = {<M,w> | M is a TM, M accepts w} is undecidable

• Assume (towards contradiction) that ATM is decidable, so there exists some TM MATM that decides ATM.

• Construct a TM D as follows:– D(<M>): //input is a string description of a TM

• MATM(<M,<M>>) //MATM is a decider, so no infinite looping—it will tell us if <M> is in L(M) or not, even if M loops on <M>

• If MATM accepts, we reject

• If MATM rejects, we accept // we do the opposite of MATM

• Now, it will take one more step to show how D can do something impossible

Page 17: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

17

Pause to Examine TM DD(<M>): //input is a string description of a TM

– MATM(<M,<M>>) //MATM is a decider, so no infinite looping—it will tell us if

<M> is in L(M) or not, even if M loops on <M>

– If MATM accepts, we reject

– If MATM rejects, we accept // we do the opposite of MATM

• Let Mx be a TM, where L(Mx) = {}. What happens when we input Mx to D like this: D(<Mx>)? a) D acceptsb) D rejectsc) D loopsd) Not enough informatione) Other

ATM = {<M,w> | M is a TM, M accepts w}

Page 18: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

18

Pause to Examine TM DD(<M>): //input is a string description of a TM

– MATM(<M,<M>>) //MATM is a decider, so no infinite looping—it will tell us if <M> is in

L(M) or not, even if M loops on <M>

– If MATM accepts, we reject

– If MATM rejects, we accept // we do the opposite of MATM

ML(w):– Go into an infinite loop

• What happens when we input ML to D like this: D(<ML>)? a) D acceptsb) D rejectsc) D loopsd) Not enough informatione) Other

ATM = {<M,w> | M is a TM, M accepts w}

Page 19: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

19

Pause to Examine TM DD(<M>): //input is a string description of a TM

– MATM(<M,<M>>) //MATM is a decider, so no infinite looping—it will tell us if

<M> is in L(M) or not, even if M loops on <M>

– If MATM accepts, we reject

– If MATM rejects, we accept // we do the opposite of MATM

• Let Mv be a TM where L(Mv) = Σ*.What happens when we input Mv to D like this: D(<Mv>)? a) D acceptsb) D rejectsc) D loopsd) Not enough informatione) Other ATM = {<M,w> | M is a TM, M accepts w}

Page 20: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

20

Pause to Examine TM DD(<M>): //input is a string description of a TM

– MATM(<M,<M>>) //MATM is a decider, so no infinite looping—it will tell us if <M> is in L(M) or not, even if M loops on <M>

– If MATM accepts, we reject

– If MATM rejects, we accept // we do the opposite of MATM

• What happens when we input D to D like this: D(<D>)? a) D acceptsb) D rejectsc) D loopsd) Not enough informatione) Other

ATM = {<M,w> | M is a TM, M accepts w}

Page 21: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

21

Proof:• Thm: ATM = {<M,w> | M is a TM, M accepts w} is undecidable

• Assume (towards contradiction) that ATM is decidable, so some TM MATM decides ATM.

• Construct a TM D as follows:– D(<M>): //input is a string description of a TM

• MATM(<M,<M>>)– MATM is a decider, so it will either accept or reject (no infinite looping)

• If MATM accepts, we reject

• If MATM rejects, we accept // we do the opposite of MATM

• Run D(<D>). Observe that D(<D>) should accept when D(<D>) rejects, and D(<D>) should reject when D(<D>) accepts, a contradiction. Therefore the assumption is false, and ATM is undecidable.

Page 22: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

22

THE HALTING PROBLEMHALTTM

Proving it is undecidable

Page 23: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

23

The Halting Problem

• HALTTM = {<M,w> | M is a TM and M halts on input w}– Doesn’t say if M accepts or rejects w, just that it

halts

• Imagine we have a hypothetical TM Mhalt that decides HALTTM.– Could we use Mhalt to build a decider for ATM?

– (recall: ATM = {<M,w> | M is a TM and M accepts w})

Page 24: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

24

Thm. HALTTM is undecidable.

• Proof by contradiction.• Assume that HALTTM is decidable, and some TM Mhalt

decides it.• Construct a TM MATM that decides ATM:

• But is ATM is undecidable, a contradiction. So the assumption is false and HALTTM is undecidable.

Page 25: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

25

We just did a reduction!

• We will do a LOT more of this next week!

Page 26: Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,

26

TA Evaluations!!!!!111

• Class number: CSE 105• TA’s name: Srdjan Krstic OR Wenbo Zhao– Evaluate whoever you had the MOST contact with– Only evaluate ONE of the TA’s– If you didn’t have much TA contact: leave it blank

• When finished: bring to front and you can go