reducibility a reduction is a way of converting one problem into another problem in such a way that...

39
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve the first problem.

Post on 19-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Reducibility A reduction is a way of converting one

problem into another problem in such a way that a solution to the second problem can be used to solve the first problem.

Page 2: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

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

Thm: HALTTM is un-decidable

Page 3: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: By contradiction, assume R is a TM that

decides HALTTM . With R, we construct a TM S to decide ATM:

S= “ On input <M,w>, an encoding of M and w:1. Run TM R on input <M,w>2. If R rejects, REJECT3. If R accepts, simulate M on w until it halts.4. If M has accepted, ACCEPT;

If M has rejected, REJECT. “

Page 4: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) If R decides HALTTM, then S decides ATM.

But ATM is un-decidable, thus HALTTM is un-decidable.

Page 5: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

ETM={<M>| M is a TM and L(M)=∅ }

Thm: ETM is un-decidable.

Page 6: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Define Mw = “ On input x:

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

M does ” Assume that R decides ETM. Construct S that decides ATM as follows:

S = “ On input <M,w>1. Use M and w to construct Mw

2. Run R on <Mw>

3. If R accepts, REJECT; if R rejects, ACCEPT. “

But ATM is un-decidable, thus ETM is un-decidable .

Page 7: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

REGULARTM = {<M>| M is a TM and L(M) is regular }.

Thm:REGULARTM is un-decidable.

Page 8: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Assume R decides REGULARTM . Construct TM S to decide ATM .

S = “ On input <M,w>:1. Construct the following TM Mw

Mw = “ On input x :

1. If x has the form 0n1n ,ACCEPT. 2. If x does not have this form, run

M on input w and ACCEPT

if M accepts w.

2. Run R on input <Mw>

3. If R accepts, ACCEPT; If R rejects, REJECT. “

Page 9: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

EQTM = {<M1, M2>| M1 and M2 are TMs

and L(M1)=L(M2) }

Thm:EQTM is un-decidable.

Page 10: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Let TM R decide EQTM and construct S to decide

ETM as follows:

S = “ On input <M>, where M is a TM:1. Run R on input <M,M1>,

where M1 rejects all inputs.

2. If R accepts, accept; otherwise reject. “

If R decides EQTM , S decides ETM .

Page 11: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Reductions via computation histories

Def:M: Turing Machine

w: an input string

An accepting computation history for M on w is a sequence of configurations, C1, C2, …, Cl , where C1 is the start configuration of M on w, Cl is an accepting configuration of M, and each Ci legally follows from Ci-1 .

Page 12: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Def: Linear Bounded Automaton is a type of TM where in the tape head is not permitted to move off the portion of the tape containing the input.

Page 13: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

ALBA = {<M,w>| M is an LBA that accepts w}

Lemma:Let M be an LBA with q states and g symbols in the tape alphabet. There are exactly qngn distinct configurations of M for a tape of length n.

Page 14: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof:

Head positions : nstates : qtape contents : gn

1 2 3 n-1 n

Page 15: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

ALBA = {<M,w> | M : LBA, M accepts w }

Thm:ALBA is decidable.

Page 16: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Algorithm:

L = “ On input <M,w>, where M is an LBA and w is a string.1. Simulate M on w for qngn steps until it

halts.2. If M has halted, accept if it has

accepted; and reject if it has rejected. If it has not halted, reject. “

Page 17: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

ELBA = {<M>| M is an LBA where L(M)= ∅ }

Thm:ELBA is un-decidable.

Page 18: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Suppose R decides ELBA . Construct S that decides ATM .

S = “ On input <M,w>, where M is a TM and w is a string :1. Construct LBA B from M and w

2. Run R on <B>.3. If R rejects, accept; if R accepts,

reject. “

Recognizes all accepting computation histories for M and w

# # #

B Ci ⊦ Ci+

1

Page 19: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

ALLCFG = {<G>| G is a CFG and L(G)= * }

Thm:ALLCFG is un-decidable.

Page 20: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

A Simple un-decidable problem Post correspondence problem(PCP) Eg: : dominos

match:

Make a list of dominos (repetitions permitted) so that the string we get by reading off the symbols on the top is the same as the string of symbols on the bottom.

,,, cabc

aca

aba

cab

cabc

aba

aca

cab

aba

Page 21: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

An instance of the PCP is a collection P of dominos:a match is a sequence i1, i2, …, il , where

The problem is to determine whether P

has a match. PCP={<P>| P is an instance of the Post

Correspondence Problem with a match.}

,,, 2

2

1

1

k

k

bt

bt

btP

ll iiiiii bbbttt 2121

Page 22: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

MPCP = {<P> | P is an instance of the Post Correspondence Problem with a match that starts with the first domino }

Thm:PCP is un-decidable.

Page 23: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Let TM R decide the PCP and construct S

deciding ATM . Let M = (Q, , , , q0, qaccept, qreject ) .

S constructs an instance of the PCP P that has a match iff M accepts w.

Page 24: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) Part 1:

Put into P’ as the 1st domino .

Part 2:For every a,b∈ and every q,r ∈Q, if (q,a)=(r,b,R), put into P’ .

Part 3:For every a,b,c ∈ and every q,r ∈Q, if (q,a)=(r,b,L), put into P’ .

Part 4:For every a∈ , put into P’ .

][ ## #

210 nwwwq 1

1

bt

MPCP

][ brqa

][ rcbcqa

][ aa

Page 25: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) Eg.

={0,1,2, }. w = 0100Suppose (q0,0)=(q7,2,R), then

Part 2: places into P’ .Part 4: places into P’ .

# q00 1 0 0 #

# q00 1 0 0 # 2q7 1 0 0 #

][][ 0100# #

01

1

qbt

][7

0

20qq

][and],[],[],[

22

11

00

Page 26: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) Part 5:

Put and into P’ .If (q7,1)=(q5,0,R), then is in P’ .

# 2 q7 1 0 0 #

⋯ # 2 q7 1 0 0 # 2 0 q5 0 0 #

If (q5,0)=(q9,2,L), then we have

# 2 0 q5 0 0 #

⋯ # 2 0 q5 0 0 # 2 q9 0 2 0 #

][ ## ][ #

#

][5

7

01qq

][ 0200

9

5

qq ][ 12

01

9

5

qq ][ 22

02

9

5

qq

][ 2 0

9

5

qq

Page 27: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) Part 6:

for every a∈ , Put into P’ . # 2 1 qaccept0 2 # ⋯ # qaccept # #⋯ # 2 1 qaccept0 2 # 2 1 qaccept 2 # ⋯ # qaccept # #

Part 7:Add

# qaccept # #

⋯ # qaccept # #

][ and ][accept

accept

accept

accept

q

aq

q

aq

][ #

##acceptq

Page 28: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

(Proof conti.) Convert P’ to P:

Let u = u1u2…un

Define *u = *u1*u2… *un

u*= u1*u2*…*un*

*u*=*u1*u2*…*un*

P’ : P :

][,],[],[ 2

2

1

1

k

k

bt

bt

bt

][],[,][],[],[],[ *

**

**

**

**

***

3

3

2

2

1

1

1

1

k

k

bt

bt

bt

bt

bt

Must start with the first domino, and ends with an extra * on the top

*

Page 29: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Mapping Reducibility: (many- one reducibility)

Def:f : * * is a computable function

if some TM M, on every input w, halts with just f(w) on its step.

Page 30: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Def:Language A is mapping reducible to B,

written A ≤m B , if there is a computable function f : * * , where for every w,

w ∈ A ⇔ f(w) ∈ B

f is called the reduction of A to B

w

A Bf

f

Page 31: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Thm:If A ≤m B and B is decidable,

then A is decidable.

Page 32: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: Let M be the decider for B,

f be the reduction from A to B.N = “ On input w:

1. Compute f(w)2. Run M on input f(w) and output whatever M outputs.

Page 33: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Cor: If A ≤m B and A is un-decidable, then B is un-decidable.

Thm:If A ≤m B and B is Turing-recognizable, then A is Turing-recognizable.

Cor:If A ≤m B and A is not Turing-recognizable, then B is not Turing-recognizable.

Page 34: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Thm: EQTM is neither Turing-recognizable nor co- Turing-recognizable. __

Pf: We prove by showing ATM ≤m EQTM and

ATM ≤m EQTM. Why?F=“On input <M, w>: 1. Construct M1 and M2.

M1= “On any input: Reject.”

M2= “On any input: Run M on w. If it accepts, accept.” 2. Output <M1, M2>.

Page 35: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

G=“On input <M, w>: 1. Construct M1 and M2.

M1= “On any input: Accept.”

M2= “On any input: Run M on w. If it accepts, accept.” 2. Output <M1, M2>.

G completes the reduction of ATM ≤m EQTM.

Page 36: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Turing Reducibility(mapping reducibility?)

Def:An oracle for a language B is an external device that is capable of reporting whether any string w is a member of B.

Def:An oracle Turing machine is a modified Turing machine that has the additional capability of querying an oracle.

MB : an oracle TM that has an oracle for B.

Page 37: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Eg: ETM : un-decidable. = “ On input <M>, where M is a TM:

1. Construct TM N:N = “ On any input:

1. Run M in parallel on all strings in * .2. If M accepts any of these strings, accept. “

2. Query the oracle to determine whether <N,0>∈ ATM .3. If the oracle answers NO, accept; if YES, reject. “

decides ETM. Thus, ETM is decidable relative to ATM.

TMAT

TMAT

Page 38: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Def: Language A is Turing reducible to language B, written A ≤T B, if A is decidable relative to B.

Thm:If A ≤T B and B is decidable,

then A is decidable.

Page 39: Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve

Proof: If B is decidable, then replace the oracle for B

by an actual procedure(or TM) that decides B .

Thus, we may replace the oracle TM that decides A by an ordinary TM that decides A.