Lecture 21 Reducibility

24
Lecture 21 Reducibility

description

Lecture 21 Reducibility. Many-one reducibility. For two sets A c Σ * and B c Γ * , A ≤ m B if there exists a Turing-computable function f: Σ * → Γ * such that x ε A iff f(x) ε B . Complete in r. e. - PowerPoint PPT Presentation

Transcript of Lecture 21 Reducibility

Page 1: Lecture 21 Reducibility

Lecture 21 Reducibility

Page 2: Lecture 21 Reducibility

Many-one reducibility

• For two sets A c Σ* and B c Γ*, A ≤m B if there exists a Turing-computable function

f: Σ* → Γ* such that x ε A iff f(x) ε B

Page 3: Lecture 21 Reducibility

Complete in r. e.

• An r. e. set A is complete in r. e. if for every r. e. set B, B ≤m A .

Page 4: Lecture 21 Reducibility

Halting problemTheorem. K = { <x, M> | M accepts x } is complete

in r. e. .Proof. (1) K is a r. e. set. (2) For any r. e. set A, there exists a DTM

MA such that A = L(MA). For every input x of MA, define f(x) = <x, MA>. Then

x ε A iff f(x) ε K .

Page 5: Lecture 21 Reducibility

Remark

• If (1) A is a r. e. set, and (2) K ≤m A, then A is complete in r. e.

Page 6: Lecture 21 Reducibility

Nonempty

• Nonempty = {M | L(M) ≠ Φ } is complete in r. e.

Proof. (1) Nonempty is a r. e. set. Construct a DTM M* as follows: For each M, we may try every input of M,

one by one. If M accepts an input, then M is accepted by M*.

Page 7: Lecture 21 Reducibility

(2) K ≤m Nonempty. Suppose M’ is a DTM accepting every

input. For each input <x, M> of K, we define f(<x, M>) is a code of the TM M* behave as follows:

on an input y, M* carry out the following computation:

Step 1. M* simulates M on input x. If M accepts x, then go to Step 2. Step 2. M* simulates M’ on input y

Page 8: Lecture 21 Reducibility

Therefore,

<x, M> ε K => M accepts x => M* accepts every input y => f(<x, M>) = M* ε Nonempty <x, M> not in K => M doesn’t halt on x => M* doesn’t halt on y => L(M*) = Φ => f(<x, M>) not in Nonempty

Page 9: Lecture 21 Reducibility

r. e. –hard

• A set B is r. e.-hard if for every r. e. set A, A ≤m B Remark• Every complete set is r. e.-hard.• However, not every r. e.-hard set is

complete. • Every r. e.-hard set is not recursive.

Page 10: Lecture 21 Reducibility

All = {M | M accepts all inputs}

• All is r. e. hard.• All is not r. e. • All is not complete.

Page 11: Lecture 21 Reducibility

Empty = {M | L(M) = Φ}

• Empty is not r. e. • We don’t know if Empty is r. e.-hard.

Page 12: Lecture 21 Reducibility

r. e. property

• A subset P of TM codes is called a r. e. property if

M ε P and L(M’) = L(M) imply M’ ε P.

e.g., Nonempty, Empty, All are r. e. properties. Question: Give an example which is a subsets of

TM codes, but not a r. e. property.

Page 13: Lecture 21 Reducibility

Nontrivial

• A r. e. property is trivial if either it is empty or it contains all r. e. set.

Page 14: Lecture 21 Reducibility

Rice Theorem 1

Every nontrivial r. e. property is not recursive.

Page 15: Lecture 21 Reducibility

Proof

• Let P be a nontrivial r. e. property. For contradiction. Suppose P is a recursive set. So is its complement.

• Note that either P or its complement P does not contains the empty set. Without loss of generality, assume that P does not contains the empty set.

Page 16: Lecture 21 Reducibility

• Since P is nontrivial, P contains a nonempty r. e. set A.

• Let Ma be a TM accepting A, i.e., A=L(Ma).

• We want to prove K ≤m P.• For each input <x,M> of K, we define f(<x, M>) to be a code of TM M* which

behaves as follows. For each input y of M*, M* does the

following:

Page 17: Lecture 21 Reducibility

Step 1. M* simulates M on input x of M. If M accepts x, then go to Step 2.

Step 2. M* simulates Ma on y. If Ma accepts y, then M* accepts y.

Therefore, if <x, M> ε K then L(M*) = L(Ma) = A ε P,and if <x, M> not in K, then L(M*) = Φ not in

P

Page 18: Lecture 21 Reducibility

• Since K is not recursive and K ≤m P, we obtain a contradiction.

Recursive = {M | L(M) is recursive} is not recursive.

RE = {M | L(M) is r. e.} is trivial.

Page 19: Lecture 21 Reducibility

Question: • Is K an r. e. property? • Is every r. e. property complete?• Is it true that for any r. e. property, either it

or its complement is complete?

Page 20: Lecture 21 Reducibility

Rice Theorem 2A r. e. property P is r. e. iff the following three

conditions hold:(1) If A ε P and A c B for some r. e. set B, then B ε P. (2) If A is an infinite set in P, then A has a finite

subset in P.(3) The set of finite languages in P is enumerable,

in the sense that there is a TM that generates the (possibly) infinite string code1#code2# …, where codei is a code for the ith finite languages in P.

Page 21: Lecture 21 Reducibility

• The code for the finite language {w1, w2, …, wn} is [w1,w2,…,wn].

• In other words, there exists an r. e. set B that is a subset of codes of finite languages in P such that for every finite language F in P, B contains at least one code of F.

Page 22: Lecture 21 Reducibility

Examples

• All is not r. e. because All does not satisfy condition (2).

• The complement of ALL is not r. e. because it does not satisfy condition (1).

• Empty is not r. e. because it does not satisfy (1)

• Nonempty is r. e. because it satisfies (1), (2) and (3).

Page 23: Lecture 21 Reducibility

• Given TMs M and M’, is it true that L(M)=L(M’)?

A = {<M,M’> | L(M) = L(M’)} is not recursive.

Proof. Empty ≤m A. Let Mo be a fixed TM such that L(Mo) = Φ. Define f(M) =<M, Mo>. Then,

M ε Empty iff <M, Mo> ε A.

Page 24: Lecture 21 Reducibility