reducibility

46
1 Reducibility

Upload: cady

Post on 06-Jan-2016

13 views

Category:

Documents


1 download

DESCRIPTION

Reducibility. Problem is reduced to problem. If we can solve problem then we can solve problem. Problem is reduced to problem. If is decidable then is decidable. If is undecidable then is undecidable. the halting problem. Example:. is reduced to. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Reducibility

1

Reducibility

Page 2: Reducibility

2

Problem is reduced to problemA B

If we can solve problem thenwe can solve problem

BA

B

A

Page 3: Reducibility

3

If is undecidable then is undecidable

If is decidable then is decidableB A

A B

Problem is reduced to problemA B

Page 4: Reducibility

4

Example: the halting problem

is reduced to

the state-entry problem

Page 5: Reducibility

5

The state-entry problem

Inputs: M•Turing Machine

•State q

Question: Does M

•Stringw

enter state q

on input ?w

Page 6: Reducibility

6

Theorem:

The state-entry problem is undecidable

Proof: Reduce the halting problem to

the state-entry problem

Page 7: Reducibility

7

Suppose we have an algorithm (Turing Machine)

that solves the state-entry problem

We will construct an algorithmthat solves the halting problem

Page 8: Reducibility

8

Algorithm for state-entry problem

M

w

q

YES

NO

entersM q

doesn’t enterM q

Assume we have the state-entry algorithm:

Page 9: Reducibility

9

Algorithm for Halting problem

M

w

YES

NO

halts onM w

doesn’t halt onM w

We want to design the halting algorithm:

Page 10: Reducibility

10

Modify input machine :M

•Add new state q

•From any halting state add transitions to q

M q

halting statesSinglehalt state

M

Page 11: Reducibility

11

M halts

M halts on state q

if and only if

Page 12: Reducibility

12

machine and string

Algorithm for halting problem:

Inputs: M w

1. Construct machine with state M q

2. Run algorithm for state-entry problem with inputs: M wq, ,

Page 13: Reducibility

13

Generate

M M

w

M qw

State-entry

algorithm

Halting problem algorithm

YES

NO

YES

NO

Page 14: Reducibility

14

Since the halting problem is undecidable,it must be that the state-entry problemis also undecidable

END OF PROOF

We reduced the halting problemto the state-entry problem

Page 15: Reducibility

15

Another example:

the halting problem

is reduced to

the blank-tape halting problem

Page 16: Reducibility

16

The blank-tape halting problem

Input: MTuring Machine

Question: Does M halt when started with

a blank tape?

Page 17: Reducibility

17

Theorem:

Proof:Reduce the halting problem to the

blank-tape halting problem

The blank-tape halting problem is undecidable

Page 18: Reducibility

18

Suppose we have an algorithmfor the blank-tape halting problem

We will construct an algorithmfor the halting problem

Page 19: Reducibility

19

Algorithm for blank-tape halting problem

M

YES

NO

halts onblanks tape

M

doesn’t halton blank tape

M

Assume we have the blank-tape halting algorithm:

Page 20: Reducibility

20

Algorithm for halting problem

M

w

YES

NO

halts onM w

doesn’t halt onM w

We want to design the halting algorithm:

Page 21: Reducibility

21

wMConstruct a new machine

• On blank tape writes w

• Then continues execution like M

wM

Mthen write w

step 1 step2

if blank tape executewith input w

Page 22: Reducibility

22

M halts on input string

wM halts when started with blank tape

if and only if

w

Page 23: Reducibility

23

Algorithm for halting problem:

1. Construct wM

2. Run algorithm for blank-tape halting problem with input

, ,

wM

machine and stringInputs: M w

Page 24: Reducibility

24

Generate

wMM

w

blank-tape halting algorithm

Halting problem algorithm

YES

NOwM

YES

NO

Page 25: Reducibility

25

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

END OF PROOF

We reduced the halting problemto the blank-tape halting problem

Page 26: Reducibility

26

Does machine halt on input ?

Summary of Undecidable Problems

Halting Problem:

M w

Membership problem:

Is a string member of a

recursively enumerable language ? Lw

Does machine accept string ?M w

In other words:

Page 27: Reducibility

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: Reducibility

28

Uncomputable Functions

Page 29: Reducibility

29

Uncomputable Functions

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

Domain Valuesregion

f

Page 30: Reducibility

30

An uncomputable function:

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

n

Page 31: Reducibility

31

Theorem:Function is uncomputable)(nf

Proof:

Then the blank-tape halting problem is decidable

Assume for contradiction that is computable)(nf

Page 32: Reducibility

32

Algorithm 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: Reducibility

33

Therefore, the blank-tape haltingproblem is decidable

However, the blank-tape haltingproblem is undecidable

Contradiction!!!

Page 34: Reducibility

34

Therefore, function in uncomputable)(nf

END OF PROOF

Page 35: Reducibility

35

Rice’s Theorem

Page 36: Reducibility

36

Non-trivial properties of recursively enumerable languages:

any property possessed by some (not all)recursively enumerable languages

Definition:

Page 37: Reducibility

37

Some non-trivial properties of recursively enumerable languages:

• is emptyL

L• is finite

L• contains two different strings of the same length

Page 38: Reducibility

38

Rice’s Theorem:

Any non-trivial property of a recursively enumerable languageis undecidable

Page 39: Reducibility

39

We will prove some non-trivial propertieswithout using Rice’s theorem

Page 40: Reducibility

40

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 41: Reducibility

41

Algorithm for empty languageproblem

M

YES

NO

Assume we have the empty language algorithm:

Let be the machine that accepts M L

)(ML

)(ML

empty

not empty

LML )(

Page 42: Reducibility

42

Algorithm for membershipproblem

M

w

YES

NO

acceptsM w

rejectsM w

We will design the membership algorithm:

Page 43: Reducibility

43

First construct machine : wM

When enters a final state, compare original input string with w

M

Accept if original input is the same with w

Page 44: Reducibility

44

Lw

)( wML is not empty

if and only if

}{)( wML w

Page 45: Reducibility

45

Algorithm for membership problem:

Inputs: machine and string M w

1. Construct wM

2. Determine if is empty )( wML

YES: then )(MLw

NO: then )(MLw

Page 46: Reducibility

46

construct

wM

Check if)( wML

is empty

YES

NO

M

w

NO

YES

Membership algorithm

wM

END OF PROOF