CSCI 2670 Introduction to Theory of Computing

10
CSCI 2670 Introduction to Theory of Computing November 1, 2005

description

CSCI 2670 Introduction to Theory of Computing. November 1, 2005. Agenda. Last week Test & undecidability Today Review one undecidability proof Rice’s Theorem Reductions (Section 5.3). Announcements. Announcements. Homework due next Tuesday (11/8) - PowerPoint PPT Presentation

Transcript of CSCI 2670 Introduction to Theory of Computing

Page 1: CSCI 2670 Introduction to Theory of Computing

CSCI 2670Introduction to Theory of

Computing

November 1, 2005

Page 2: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Agenda

• Last week– Test & undecidability

• Today– Review one undecidability proof– Rice’s Theorem– Reductions (Section 5.3)

Page 3: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Announcements

• Homework due next Tuesday (11/8)– 5.7, 5.12 (do not use Rice’s Theorem),

5.20, 5.22, 5.30 b• Old text 5.7• Get handout for 5.12, 5.20, 5.22 and 5.30

b

Announcements

Page 4: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

An undecidable languageLet 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 5: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Proof (cont.)

Consider the following TMS = “On input <M,w>

1. Construct the following TM M2

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

accept”

2. Run R on M2 (accepts iff L(M2) is a RL)

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

S decides ATM if R decides REGULARTM

Page 6: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Insight

• The TM M2 is specially designed to be regular if and only if M accepts w

• Then call TM that decides REGULARTM on M2

Page 7: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Rice’s theorem

• Determining whether a TM satisfies any non-trivial property is undecidable

– A property is non-trivial if:1. It depends only on the language of M,

and 2. Some, but not all, Turing machines have

the property

– Examples: Is L(M) regular? A CFG? Finite?

Page 8: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Proof of Rice’s theorem

• Assume there is some decidable non-trivial property P for Turing machines– Assume TM’s that accept do not

satisfy P• If they do, just consider P

Page 9: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

Proof of Rice’s theorem

• Let TM B decide P– On input <M>, B accepts iff TM M has

property P

• Let MP be a TM that satisfies P– Since P is non-trivial, there is some MP

satisfying P

• Use B and MP to decide ATM

– Create a new TM S that decides ATM using B and MP

Page 10: CSCI 2670 Introduction to Theory of Computing

November 1, 2005

ATM decider using MP

S = “On input <M,w>1. Create the following TM N

N = “On input x1. Run M on w until it accepts2. If M accepts w, run MP on x3. If MP accepts x, accept; if MP rejects x,

reject”

2. Run B on <N(<M,w>)>If B accepts, accept; if B rejects, reject”

L(N) = L(MP) if M accepts w; otherwise L(N) = S decides ATM if B decides TM’s satisfying P

Therefore, B cannot exist