csci 2670 introduction to theory of computing

18
CSCI 2670 Introduction to Theory of Computing October 26, 2005

Upload: charissa-douglas

Post on 02-Jan-2016

20 views

Category:

Documents


0 download

DESCRIPTION

CSCI 2670 Introduction to Theory of Computing. October 26, 2005. Agenda. Yesterday Test Today Begin Chapter 5 Pages 187 – 192 Old text pages 171 – 176). Announcement. In Chapter 5 we will skip from page 192 to page 206 Old text skip from 176 to 183 Homework due next Wednesday (11/3) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CSCI 2670 Introduction to Theory of Computing

CSCI 2670Introduction to Theory of

Computing

October 26, 2005

Page 2: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Agenda

• Yesterday– Test

• Today– Begin Chapter 5

• Pages 187 – 192• Old text pages 171 – 176)

Page 3: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Announcement

• In Chapter 5 we will skip from page 192 to page 206– Old text skip from 176 to 183

• Homework due next Wednesday (11/3)– Show the following languages are not

decidable• T = {<M> | M is a TM with L(M)R = L(M)}

– i.e., wRL(M) whenever wL(M) (prob. 5.9)

• G = {<M> | M is a TM s.t. L(M) is context-free}

• F = {<M> | M is a TM with |L(M)| = 5}

Page 4: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Classes of languages

• We have shown some language falls within each of the following classes– Regular– Context-free– Decidable– Turing recognizable

– Co-Turing recognizable (ATM)

• Today we will show some languages are undecidable

Page 5: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Undecidable languages

Turing recognizable

Co-Turing recognizableDecidable

Page 6: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Undecidable languages

• We can prove a problem is undecidable by contradiction– Assume the problem is decidable– Show that this implies something

impossible

Page 7: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

The halting problem HALTTM

• HALTTM = {<M,w> | M is a TM and M halts on input w}

Theorem: HALTTM is undecidable

Proof: (by contradiction)

• Show that if HALTTM is decidable then ATM is also decidable

Page 8: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proof (cont.)

• Assume R decides HALTTM

• Let S be the following TMS = “on input <M,w>

1. Run R on <M,w>2. If R rejects, reject3. If R accepts, simulate M on w until it

halts4. If M accepts, accept; if M rejects,

reject”

Page 9: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proof (cont.)

• If HALTTM is decidable then S decides ATM

• Since ATM is not decidable, HALTTM cannot be decidable

Page 10: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proving language L is undecidable

• Assume L is decidable– Let N be a TM that decides L

• Show that a known undecidable language L’ will be decidable if it can use N to make decisions– This is called reducing problem L’ to

problem L• Conclude N cannot exist

– I.e., the language L is not decidable

Trick: Figuring out which undecidable language to use

Page 11: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Undecidability of ETM

• ETM = {<M> | M is a TM and L(M) = }Theorem: ETM is undecidable

Proof: Assume ETM is decidable with decider TM R. Use R to decide ATM.

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

How can we use R (which takes <M> as input) to determine if M accepts w?

Make new TM, M1, with L(M1) = iff M accepts w

Page 12: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proof (cont.)

New TM: Reject everything other than w, do whatever M does on input w.

M1 = “On input x

1. If x ≠ w, reject2. If x = w, run M on input w

Accept if M accepts”

L(M1) ≠ if and only if M accepts w

Page 13: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Use R and M1 to decide ATM

Consider the following TM

S = “On input <M,w>1. Construct M1 that rejects all but w and

simulates M on w2. Run R on <M1> 3. If R accepts, reject; if R rejects, accept”

S decides ATM – a contradiction

Therefore, ETM is not decidable

Page 14: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Recap

• Assume R decides ETM

• Create Turing machine M1 such that L(M1) ≠ iff M accepts w

• Create Turing machine S that decides ATM by running R on input M1

• Conclude R cannot exist– ETM cannot be decidable

Page 15: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Another undecidable language

Let REGULARTM = {<M> | M is a TM and L(M) is a regular language}Theorem: REGULARTM is undecidable

Proof: Assume R decides REGULARTM and use R to decide ATM (reduce the ATM problem to the REGULARTM problem).As before, make a new TM, M2, that accepts a regular language iff M accepts w.

Page 16: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proof (cont.)

M2 = “On input x1. If x = 0n1n for some n, accept2. Otherwise, run M on w. If M accepts w,

accept”

• If M accepts w, then L(M2) = Σ*– A regular language

• Otherwise, L(M2) = 0n1n

– Not a regular language

Page 17: CSCI 2670 Introduction to Theory of Computing

October 26, 2005

Proof (cont.)

Assuming R decides REGULARTM consider the following TM

S = “On input <M,w>1. Construct M2 s.t. L(M2) is regular iff M

accepts w2. Run R on M2

3. If R accepts, accept; if R rejects, reject”

S decides ATM iff R decides REGULARTM

Page 18: CSCI 2670 Introduction to Theory of Computing