Top Banner
Prof. Busch - LSU 1 Reductions
84

Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 1

Reductions

Page 2: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 2

Problem is reduced to problemX Y

If we can solve problem then we can solve problemX

Y

Page 3: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 3

Language is reduced tolanguage

There is a computable function (reduction) such that:f

BwfAw )(

A

B

Definition: A B

w )(wf

Page 4: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 4

Computable function : f

which for any string computes )(wfwThere is a deterministic Turing machineM

Recall:

Page 5: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 5

If: a: Language is reduced to b: Language is decidableThen: is decidable

Theorem:

Proof:

A BB

A

Basic idea:Build the decider for using the decider for

A

B

Page 6: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 6

Decider for B

Decider for A

compute

)(wf

)(wfw

accept

reject

accept

reject

(halt)

(halt)(halt)

(halt)

Inputstring

BwfAw )(

END OF PROOF

Reduction YES YES

NO NO

Page 7: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 7

Example:

}languages same the accept that

DFAs are and :,{ 2121 MMMMEQUALDFA

} language empty the

accepts that DFA a is :{

MMEMPTYDFA

is reduced to:

Page 8: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 8

Turing Machinefor reduction

DFADFA EMPTYMEQUALMM 21,

f21,MM M

MMf

21,

DFA

We only need to construct:

Page 9: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 9

21,MM M

MMf

21,

Let be the language of DFA Let be the language of DFA

1L

2L1M

2M

)()()( 2121 LLLLML

construct DFA by combining and so that:

M

DFA

1M 2M

Turing Machinefor reduction f

Page 10: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 10

)(21 MLLL

)()()( 2121 LLLLML

DFADFA EMPTYMEQUALMM 21,

Page 11: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 11

Decider

Decider for

compute M

Inputstring

DFAEQUAL

21,MM 21,MMf DFAEMPTY

YESYES

NONO

Reduction

Page 12: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 12

If: a: Language is reduced to b: Language is undecidableThen: is undecidable

Theorem (version 1):

A B

BA

(this is the negation of the previous theorem)

Proof:

Using the decider for build the decider forA

BSuppose is decidable B

Contradiction!

Page 13: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 13

Decider for B

Decider for A

compute

)(wf

)(wfw

accept

reject

accept

reject

(halt)

(halt)(halt)

(halt)

Inputstring

BwfAw )(

Reduction

END OF PROOF

If is decidable then we can build:B

CONTRADICTION!

YES YES

NO NO

Page 14: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 14

Observation:

In order to prove that some language is undecidablewe only need to reduce a known undecidable language to

B

BA

Page 15: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 15

State-entry problem

Input: M•Turing Machine•State q

Question: Does M

•Stringw

enter state qwhile processing input string ?w

Corresponding language:

} string input on state enters

that machine Turing a is :,,{

wq

MqwMSTATE TM

Page 16: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 16

Theorem:

(state-entry problem is unsolvable)

Proof: Reduce (halting problem) to (state-entry problem)

TMSTATE is undecidable

TMHALT

TMSTATE

Page 17: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 17

Decider for

YES

NO

wM,

state-entry problem decider

TMSTATEDeciderCompute

Reduction

wMf ,

wqM ,,ˆ

TMHALT

YES

NO

Given the reduction,if is decidable,then is decidable

TMSTATE

TMHALT

A contradiction!sinceis undecidable

Halting Problem Decider

TMHALT

Page 18: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 18

wM,Compute

Reduction

wMf ,wqM ,,ˆ

We only need to build the reduction:

TMHALTwM , TMSTATEqwM ,,ˆ

wMf ,

So that:

Page 19: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 19

Mqhalting

states

specialhalt state

Rxx ,

Construct from :M̂ M

A transition for every unused tape symbol of x

iq

iq

Page 20: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 20

M̂ halts on state qM halts

Mqhalting

states

specialhalt state

iq

Page 21: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 21

M̂ halts on state on inputq

M halts on input w

w

Therefore:

Equivalently:

END OF PROOF

TMHALTwM , TMSTATEqwM ,,ˆ

Page 22: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 22

Blank-tape halting problem

Input: MTuring Machine

Question: Does M halt when started with

a blank tape?

Corresponding language:

}tape blank on started when halts

that machin aTuring is :{ eMMBLANKTM

Page 23: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 23

Theorem:

(blank-tape halting problem is unsolvable)

Proof: Reduce (halting problem) to (blank-tape problem)

TMBLANK is undecidable

TMHALT

TMBLANK

Page 24: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 24

Decider for

YES

NO

wM,

blank-tape problem decider

DeciderCompute

Reduction

wMf ,

TMHALT

YES

NO

Given the reduction,If is decidable,then is decidableTMHALT

A contradiction!sinceis undecidable

Halting Problem Decider

TMHALT

TMBLANK

TMBLANK

Page 25: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 25

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMHALTwM , TMBLANKM ˆ

wMf ,

So that:

Page 26: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 26

no

yes

Write on tape w

Tape is blank?

Run

with input

Construct from :M̂ wM,

If halts then halt

M

w

M

Accept and halt

Page 27: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 27

M̂ halts when started on blank tape

M halts on input

no

yesM

Write on tape w

Tape is blank?

Run

with inputw

w

Accept and halt

Page 28: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 28

END OF PROOF

M̂ halts when started on blank tape

M halts on inputw

TMHALTwM , TMBLANKM ˆ

Equivalently:

Page 29: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 29

If: a: Language is reduced to b: Language is undecidableThen: is undecidable

Theorem (version 2):

A B

BA

Proof:

Using the decider for build the decider for A

B

Suppose is decidable B

Contradiction!

Then is decidableB

Page 30: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 30

Suppose is decidableB

Decider for B

s

accept

reject

(halt)

(halt)

Page 31: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 31

Suppose is decidableB

Decider for B

s

accept

reject

(halt)

(halt)

Then is decidableB(we have proven this in previous class)

reject

accept(halt)

(halt)

Decider for BNO YES

YES NO

Page 32: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 32

Decider for B

Decider for A

compute

)(wf

)(wfw

accept

reject

accept

reject

(halt)

(halt)(halt)

(halt)

Inputstring

BwfAw )(

Reduction

If is decidable then we can build:B

CONTRADICTION!

YES YES

NO NO

Page 33: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 33

Decider for B

Decider for A

compute

)(wf

)(wfw

accept

reject accept

reject

(halt)

(halt)(halt)

(halt)

Inputstring

BwfAw )(

Reduction

END OF PROOFCONTRADICTION!

Alternatively:

NO YES

YES NO

Page 34: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 34

Observation:

In order to prove that some language is undecidablewe only need to reduce some known undecidable languagetoor to B

(theorem version 1)

(theorem version 2)

B

AB

Page 35: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 35

Undecidable Problems for Turing Recognizable languages

• is empty?L

L• is regular?

L• has size 2?

Let be a Turing-acceptable language L

All these are undecidable problems

Page 36: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 36

• is empty?L

L• is regular?

L• has size 2?

Let be a Turing-acceptable language L

Page 37: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 37

Empty language problem

Input: MTuring Machine

Question: Is )(ML empty?

Corresponding language:

} language empty the accepts

that machine aTuring is :{

MMEMPTYTM

?)( ML

Page 38: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 38

Theorem:

(empty-language problem is unsolvable)

is undecidable

Proof: Reduce (membership problem) to

(empty language problem)

TMA

TMEMPTY

TMEMPTY

Page 39: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 39

Decider for

YES

NO

wM,

empty problem decider

DeciderCompute

Reduction

wMf ,

M̂YES

NO

Given the reduction,if is decidable,then is decidable

membership problem decider

TMA

TMATMEMPTY

TMEMPTY

A contradiction!sinceis undecidable

TMA

Page 40: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 40

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMATwM , TMEMPTYM ˆ

wMf ,

So that:

Page 41: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 41

•Write on tape, and•Simulate on input

wM w M w

sTape of M̂

input string

accepts ?

Louisiana?s

Construct from :M̂ wM,

yes

Turing Machine

Accepts

yes

Page 42: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 42

The only possible accepted string

Louisiana

Prof. Busch - LSU 42

s

Prof. Busch - LSU 42

•Write on tape, and•Simulate on input

wM w M waccepts

?

Louisiana?s

yes

Turing MachineM̂

Accepts

yes

Page 43: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 43

accepts }Louisiana{)ˆ(MLM w

does notaccept

M w )ˆ(ML

Prof. Busch - LSU 43Prof. Busch - LSU 43Prof. Busch - LSU 43

•Write on tape, and•Simulate on input

wM w M waccepts

?

Louisiana?s

yes

Turing MachineM̂

Accepts

yes

Page 44: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 44

Therefore:

acceptsM w )ˆ(ML

Equivalently:

TMATwM , TMEMPTYM ˆ

END OF PROOF

Page 45: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 45

• is empty?L

L• is regular?

L• has size 2?

Let be a Turing-acceptable language L

Page 46: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 46

Regular language problem

Input: MTuring Machine

Question: Is )(ML a regular language?

Corresponding language:

language} regular a accepts

that machine aTuring is :{ MMREGULARTM

Page 47: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 47

Theorem:

(regular language problem is unsolvable)

is undecidable

Proof: Reduce (membership problem) to (regular language problem)

TMA

TMREGULAR

TMREGULAR

Page 48: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 48

Decider for

YES

NO

wM,

regular problem decider

DeciderCompute

Reduction

wMf ,

M̂YES

NO

Given the reduction,If is decidable,then is decidable

membership problem decider

TMA

TMA

TMREGULAR

A contradiction!sinceis undecidable

TMATMREGULAR

Page 49: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 49

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMATwM , TMREGULARM ˆ

wMf ,

So that:

Page 50: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 50

sTape of M̂

input string

Construct from :M̂ wM,

Prof. Busch - LSU 50Prof. Busch - LSU 50Prof. Busch - LSU 50Prof. Busch - LSU 50

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

?kkbas

yes yes

Turing MachineM̂)0 some (for k

Page 51: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 51

accepts }0:{)ˆ( nbaML nnM w

does notaccept

M w )ˆ(ML

not regular

regular

Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51Prof. Busch - LSU 51

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

?kkbas

yes yes

Turing Machine)0 some (for k

Page 52: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 52

Therefore:

acceptsM w )ˆ(ML

Equivalently:

TMATwM , TMREGULARM ˆ

END OF PROOF

is not regular

Page 53: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 53

• is empty?L

L• is regular?

L• has size 2?

Let be a Turing-acceptable language L

Page 54: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 54

Does have size 2 (two strings)?

Size2 language problem

Input: MTuring Machine

Question: )(ML

Corresponding language:

strings} two exactly accepts

that machine aTuring is :{2 MMSIZE TM

?2|)(| ML

Page 55: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 55

Theorem:

(size2 language problem is unsolvable)

is undecidable

Proof: Reduce (membership problem) to (size 2 language problem)

TMA

TMSIZE 2

TMSIZE 2

Page 56: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 56

Decider for

YES

NO

wM,

size2 problem decider

DeciderCompute

Reduction

wMf ,

M̂YES

NO

Given the reduction,If is decidable,then is decidable

membership problem decider

TMA

TMA

A contradiction!sinceis undecidable

TMA

TMSIZE 2

TMSIZE 2

Page 57: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 57

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMATwM , TMSIZEM 2ˆ

wMf ,

So that:

Page 58: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 58

sTape of M̂

input string

Construct from :M̂ wM,

Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58Prof. Busch - LSU 58

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

?}Rouge,Baton{s

yes yes

Turing MachineM̂

Page 59: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 59

accepts }Rouge,Baton{)ˆ( MLM w

does notaccept

M w )ˆ(ML

2 strings

0 strings

Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59Prof. Busch - LSU 59

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

?}Rouge,Baton{s

yes yes

Turing Machine

Page 60: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 60

Therefore:

acceptsM w )ˆ(ML

Equivalently:

TMATwM , TMSIZEM 2ˆ

END OF PROOF

has size 2

Page 61: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 61

RICE’s Theorem

• is empty?L

L• is regular?

L• has size 2?

Undecidable problems:

This can be generalized to all non-trivialproperties of Turing-acceptable languages

Page 62: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 62

Non-trivial property:

A property possessed by some Turing-acceptable languages but not all

: is empty?LExample:

L

}Louisiana{L

YES

NO

}Rouge,Baton{LNO

P

1P

Page 63: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 63

: is regular?

More examples of non-trivial properties:

L

}0:{ nbaL nn

YES

NO

L2P

}0:{ naL nYES

: has size 2?L3PLNO

YES

NO }Louisiana{L}Rouge,Baton{L

Page 64: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 64

Trivial property:

A property possessed by ALL Turing-acceptable languages

P

: has size at least 0?LExamples: 4PTrue for all languages

: is accepted by some Turing machine?

L5P

True for allTuring-acceptable languages

Page 65: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 65

We can describe a property as the setof languages that possess the property

P

: is empty?LExample:

1LYES

NO

NO

P

}{ 1LP

If language has property then PL PL

}Louisiana{2 L

}Rouge,Baton{3 L

Page 66: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 66

: has size 1?LP

}{a

},{ a

NO

NO

YES

Example: Suppose alphabet is }{a

}{aa},{ aa

}{aaa}{},{ aaa

}},{},{},{},{},{{ aaaaaaaaaaP

},,{ aaaNO },,{ aaaaaaaaa

Page 67: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 67

Non-trivial property problem

Does have the non-trivial property ?

Input: MTuring Machine

Question: )(ML

Corresponding language:

})( is, that , property

trivial-non the has )( that such

machine aTuring is :{

PMLP

ML

MMPROPERTYTM

?)( PML P

Page 68: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 68

Rice’s Theorem: TMPROPERTY is undecidable

(the non-trivial property problem is unsolvable)

Proof: Reduce (membership problem)

to

TMA

TMPROPERTY TMPROPERTYor

Page 69: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 69

We examine two cases:

Case 1:

Case 2:

P

P

Examples: : is empty?)(MLP

: is regular?)(MLP

: has size 2?)(MLPExample:

Page 70: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 70

Let be the Turing machine thataccepts

Case 1: P

Since is non-trivial, there is a Turing-acceptable languagesuch that:

PX

PX

XM

X

Page 71: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 71

Reduce (membership problem) to

TMA

TMPROPERTY

Page 72: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 72

Decider for

YES

NO

wM,

Non-trivial property problem decider

DeciderCompute

Reduction

wMf ,

M̂YES

NO

Given the reduction,if is decidable,then is decidable

membership problem decider

TMA

TMA

A contradiction!sinceis undecidable

TMA

TMPROPERTY

TMPROPERTY

Page 73: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 73

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMATwM , TMPROPERTYM ˆ

wMf ,

So that:

Page 74: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 74

sTape of M̂

input string

Construct from :M̂ wM,

?Xs

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

yes yes

Turing MachineM̂

Page 75: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 75

For this we can run machine ,that accepts language , with input string

XMX

s

?Xs

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

yes yes

Turing MachineM̂

Page 76: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 76

accepts XML )ˆ(M w

does notaccept

M w )ˆ(ML

P

P

Prof. Busch - LSU 76

?Xs

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

yes yes

Turing MachineM̂

Page 77: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 77

Therefore:

acceptsM w PML )ˆ(

Equivalently:

TMATwM , TMPROPERTYM ˆ

Page 78: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 78

Let be the Turing machine thataccepts

Case 2: P

Since is non-trivial, there is a Turing-acceptable languagesuch that:

PX

PX

XM

X

Page 79: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 79

Reduce (membership problem) to

TMA

TMPROPERTY

Page 80: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 80

Decider for

YES

NO

wM,

Non-trivial property problem decider

DeciderCompute

Reduction

wMf ,

M̂YES

NO

Given the reduction,if is decidable,then is decidable

membership problem decider

TMA

TMA

A contradiction!sinceis undecidable

TMA

TMPROPERTY

TMPROPERTY

Page 81: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 81

wM,Compute

Reduction

wMf ,M̂

We only need to build the reduction:

TMATwM , TMPROPERTYM ˆ

wMf ,

So that:

Page 82: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 82

sTape of M̂

input string

Construct from :M̂ wM,

?Xs

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

yes yes

Turing MachineM̂

Page 83: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 83

accepts XML )ˆ(M w

does notaccept

M w )ˆ(ML

P

PM̂

?Xs

•Write on tape, and•Simulate on input

wM w M w

Accepts

accepts ?

yes yes

Turing Machine

Page 84: Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.

Prof. Busch - LSU 84

Therefore:

acceptsM w PML )ˆ(

Equivalently:

TMATwM , TMPROPERTYM ˆ

END OF PROOF