Transcript
Page 1: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 1

Reducibility

Page 2: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 2

Problem is reduced to problemA B

If we can solve problem thenwe can solve problem

BA

B

A

Page 3: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 3

If is undecidable then is undecidable

If is decidable then is decidableB A

A B

Problem is reduced to problemA B

Page 4: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 4

Example: the halting problem

is reduced to

the state-entry problem

Page 5: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 5

The state-entry problem

Inputs: M•Turing Machine

•State q

Question: Does M

•Stringw

enter state q

on input ?w

Page 6: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 6

Theorem:

The state-entry problem is undecidable

Proof: Reduce the halting problem to

the state-entry problem

Page 7: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 7

state-entryproblem decider

M

w

q

YES

NO

entersM q

doesn’t enterM q

Suppose we have a Deciderfor the state-entry algorithm:

Page 8: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 8

Halting problemdecider

M

w

YES

NO

halts onM w

doesn’t halt onM w

We want to build a deciderfor the halting problem:

Page 9: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 9

M qw

State-entryproblemdecider

Halting problem decider

YES

NO

YES

NO

M

w

We want to reduce the halting problem tothe state-entry problem:

Page 10: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 10

M qw

Halting problem decider

YES

NO

YES

NO

M

w

ConvertInputs ?

We need to convert one problem instanceto the other problem instance

State-entryproblemdecider

Page 11: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 11

Convert to :M

•Add new state q

•From any halting state of add transitions to q

M q

halting statesSinglehalt state

M

M

M

Page 12: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 12

M halts on input

M halts on state on input q

if and only if

w

w

Page 13: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 13

Generate

M M

w

M qw

Halting problem decider

YES

NO

YES

NO

State-entryproblemdecider

Page 14: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 14

Since the halting problem is undecidable,the state-entry problem is undecidable

END OF PROOF

We reduced the halting problemto the state-entry problem

Page 15: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 15

Another example:

the halting problem

is reduced to

the blank-tape halting problem

Page 16: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 16

The blank-tape halting problem

Input: MTuring Machine

Question: Does M halt when started with

a blank tape?

Page 17: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 17

Theorem:

Proof:Reduce the halting problem to the

blank-tape halting problem

The blank-tape halting problem is undecidable

Page 18: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 18

blank-tape halting problemdecider

M

YES

NO

halts onblank tape

M

doesn’t halton blank tape

M

Suppose we have a decider for the blank-tape halting problem:

Page 19: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 19

halting problemdecider

M

w

YES

NO

halts onM w

doesn’t halt onM w

We want to build a deciderfor the halting problem:

Page 20: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 20

M

w

Blank-tapehalting problemdecider

Halting problem decider

YES

NOwM

YES

NO

We want to reduce the halting problem tothe blank-tape halting problem:

Page 21: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 21

M

w

Blank-tapehalting problemdecider

Halting problem decider

YES

NOwM

YES

NO

We need to convert one problem instanceto the other problem instance

ConvertInputs ?

Page 22: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 22

wMConstruct a new machine

• When started on blank tape, writesw

• Then continues execution like M

wM

Mthen write w

step 1 step2

if blank tape executewith input w

Page 23: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 23

M halts on input string

wM halts when started with blank tape

if and only if

w

Page 24: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 24

Generate

wMM

w

blank-tapehalting problemdecider

Halting problem decider

YES

NOwM

YES

NO

Page 25: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 25

Since the halting problem is undecidable,the blank-tape halting problem is undecidable

END OF PROOF

We reduced the halting problemto the blank-tape halting problem

Page 26: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 26

Does machine halt on input ?

Summary of Undecidable Problems

Halting Problem:

M w

Membership problem:

Does machine accept string ?M w

Page 27: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 27

Does machine enter state on input ?

Does machine halt when startingon blank tape?

Blank-tape halting problem:

M

State-entry Problem:

Mw

q

Page 28: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 28

Uncomputable Functions

Page 29: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 29

Uncomputable Functions

A function is uncomputable if it cannotbe computed for all of its domain

Domain Valuesregion

f

Page 30: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 30

An uncomputable function:

)(nfmaximum number of moves untilany Turing machine with stateshalts when started with the blank tape

n

Page 31: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 31

Theorem:Function is uncomputable)(nf

Proof:

Then the blank-tape halting problem is decidable

Assume for contradiction that is computable)(nf

Page 32: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 32

Decider for blank-tape halting problem:

Input: machineM

1. Count states of : M m

2. Compute )(mf

3. Simulate for steps starting with empty tape

M )(mf

If halts then return YES otherwise return NO

M

Page 33: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 33

Therefore, the blank-tape haltingproblem is decidable

However, the blank-tape haltingproblem is undecidable

Contradiction!!!

Page 34: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 34

Therefore, function in uncomputable)(nf

END OF PROOF

Page 35: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 35

Undecidable Problems for

Recursively Enumerable Languages

Page 36: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 36

• is empty?L

L• is finite?

L• contains two different strings of the same length?

Take a recursively enumerable language L

Decision problems:

All these problems are undecidable

Page 37: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 37

Theorem:

For any recursively enumerable language Lit is undecidable to determine whether is empty L

Proof:

We will reduce the membership problemto this problem

Page 38: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 38

empty languageproblemdecider

M

YES

NO

Suppose we have a decider for theempty language problem:

Let be the TM withM

)(ML

)(ML

empty

not empty

LML )(

Page 39: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 39

membershipproblemdecider

M

w

YES

NO

acceptsM w

rejectsM w

We will build the decider for the membership problem:

Page 40: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 40

YES

NO

M

w

NO

YES

Membership problem decider

wM empty languageproblemdecider

We want to reduce the membership problem tothe empty language problem:

Page 41: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 41

YES

NO

M

w

NO

YES

Membership problem decider

wM empty languageproblemdecider

We need to convert one problem instanceto the other problem instance

Convertinputs ?

Page 42: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 42

Construct machine : wM

When enters a final state, compare with w

M

Accept only if ws

wM executes the same as with M

On arbitrary input strings

s

Page 43: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 43

Lw

)( wML is not empty

if and only if

}{)( wML w

Page 44: Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem

Fall 2004 COMP 335 44

construct

wM

YES

NO

M

w

NO

YES

Membership problem decider

wM

END OF PROOF

empty languageproblemdecider


Top Related