Top Banner
Fall 2006 Costas Busch - RPI 1 Turing’s Thesis
67

Turing’s Thesis

Feb 08, 2016

Download

Documents

prema

Turing’s Thesis. Turing’s thesis (1930):. Any computation carried out by mechanical means can be performed by a Turing Machine. Algorithm:. An algorithm for a problem is a Turing Machine which solves the problem. The algorithm describes the steps of the mechanical means. - PowerPoint PPT Presentation
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: Turing’s Thesis

Fall 2006 Costas Busch - RPI 1

Turing’s Thesis

Page 2: Turing’s Thesis

Fall 2006 Costas Busch - RPI 2

Turing’s thesis (1930):

Any computation carried outby mechanical meanscan be performed by a Turing Machine

Page 3: Turing’s Thesis

Fall 2006 Costas Busch - RPI 3

Algorithm:An algorithm for a problem is a Turing Machine which solves the problem

The algorithm describes the steps of the mechanical means

This is easily translated to computation stepsof a Turing machine

Page 4: Turing’s Thesis

Fall 2006 Costas Busch - RPI 4

When we say:There exists an algorithm

We mean: There exists a Turing Machinethat executes the algorithm

Page 5: Turing’s Thesis

Fall 2006 Costas Busch - RPI 5

Variationsof the

Turing Machine

Page 6: Turing’s Thesis

Fall 2006 Costas Busch - RPI 6

Read-Write Head

Control Unit

a a c b a cb b a a

Deterministic

The Standard ModelInfinite Tape

(Left or Right)

Page 7: Turing’s Thesis

Fall 2006 Costas Busch - RPI 7

Variations of the Standard Model

• Stay-Option • Semi-Infinite Tape• Off-Line• Multitape• Multidimensional• Nondeterministic

Turing machines with:

Different Turing Machine Classes

Page 8: Turing’s Thesis

Fall 2006 Costas Busch - RPI 8

We will prove:each new class has the same power with Standard Turing Machine

Same Power of two machine classes:both classes accept the same set of languages

(accept Turing-Recognizable Languages)

Page 9: Turing’s Thesis

Fall 2006 Costas Busch - RPI 9

Same Power of two classes means:for any machine of first class 1M

there is a machine of second class 2M

such that: )()( 21 MLML

and vice-versa

Page 10: Turing’s Thesis

Fall 2006 Costas Busch - RPI 10

A technique to prove same power.Simulation:Simulate the machine of one classwith a machine of the other class

First Class Original Machine

1M 1M2M

Second ClassSimulation Machine

simulates 1M

Page 11: Turing’s Thesis

Fall 2006 Costas Busch - RPI 11

Configurations in the Original Machinehave corresponding configurations in the Simulation Machine

nddd 10Original Machine:

Simulation Machine: nddd

10

1M

2M

1M

2M

Page 12: Turing’s Thesis

Fall 2006 Costas Busch - RPI 12

the Simulation Machineand the Original Machineaccept the same strings

fdOriginal Machine:

Simulation Machine: fd

Accepting Configuration

)()( 21 MLML

Page 13: Turing’s Thesis

Fall 2006 Costas Busch - RPI 13

Turing Machines with Stay-Option

The head can stay in the same position

a a c b a cb b a a

Left, Right, Stay

L,R,S: possible head moves

Page 14: Turing’s Thesis

Fall 2006 Costas Busch - RPI 14

Example:

a a c b a cb b a a

Time 1

b a c b a cb b a aTime 2

1q 2q

1q

2q

Sba ,

Page 15: Turing’s Thesis

Fall 2006 Costas Busch - RPI 15

Stay-Option machineshave the same power with Standard Turing machines

Theorem:

Proof:1. Stay-Option Machines simulate Standard Turing machines

2.Standard Turing machines simulate Stay-Option machines

Page 16: Turing’s Thesis

Fall 2006 Costas Busch - RPI 16

1. Stay-Option Machines simulate Standard Turing machines

Trivial: any standard Turing machine is also a Stay-Option machine

Page 17: Turing’s Thesis

Fall 2006 Costas Busch - RPI 17

2.Standard Turing machines simulate Stay-Option machines

We need to simulate the stay head option with two head moves, one left and one right

Page 18: Turing’s Thesis

Fall 2006 Costas Busch - RPI 18

1q 2qSba ,

1qLba ,

2qRxx ,

Stay-Option Machine

Simulation in Standard Machine

For every possible tape symbol x

Page 19: Turing’s Thesis

Fall 2006 Costas Busch - RPI 19

1q 2qLba ,

1q 2qLba ,

Stay-Option Machine

Simulation in Standard Machine

Similar for Right moves

For other transitions nothing changes

Page 20: Turing’s Thesis

Fall 2006 Costas Busch - RPI 20

example of simulation

a a b a

1q

Stay-Option Machine:

1 b a b a

2q2

1q 2qSba ,

Simulation in Standard Machine: a a b a

1q1

b a b a

2q2

b a b a

3q3

END OF PROOF

Page 21: Turing’s Thesis

Fall 2006 Costas Busch - RPI 21

Multiple Track Tape

bd

abbaac

track 1track 2

One symbol ),( baOne head

A useful trick to perform morecomplicated simulations

One Tape

Page 22: Turing’s Thesis

Fall 2006 Costas Busch - RPI 22

bd

abbaac

track 1track 2

1q 2qLdcab ),,(),(

1q

bd

abcdac

track 1track 2

2q

Page 23: Turing’s Thesis

Fall 2006 Costas Busch - RPI 23

Semi-Infinite Tape

.........a b a c

• When the head moves left from the border, it returns to the same position

The head extends infinitely only to the right

• Initial position is the leftmost cell

Page 24: Turing’s Thesis

Fall 2006 Costas Busch - RPI 24

Semi-Infinite machineshave the same power with Standard Turing machines

Theorem:

Proof:

2. Semi-Infinite Machines simulate Standard Turing machines

1.Standard Turing machines simulate Semi-Infinite machines

Page 25: Turing’s Thesis

Fall 2006 Costas Busch - RPI 25

1. Standard Turing machines simulate Semi-Infinite machines:

a. insert special symbol at left of input string

#

a b a c #

b. Add a self-loop to every state (except states with no outgoing transitions)

R,##

Standard Turing Machine

Page 26: Turing’s Thesis

Fall 2006 Costas Busch - RPI 26

2. Semi-Infinite tape machines simulate Standard Turing machines:

Standard machine

.........Semi-Infinite tape machine

..................

Squeeze infinity of both directions in one direction

Page 27: Turing’s Thesis

Fall 2006 Costas Busch - RPI 27

Standard machine

.........

Semi-Infinite tape machine with two tracks

..................

reference point

##

Right partLeft part

a b c d e

ac bd e

Page 28: Turing’s Thesis

Fall 2006 Costas Busch - RPI 28

1q2q

Rq2Lq1

Lq2 Rq1

Left part Right part

Standard machine

Semi-Infinite tape machine

Page 29: Turing’s Thesis

Fall 2006 Costas Busch - RPI 29

1q 2qRga ,

Standard machine

Lq1Lq2

Lgxax ),,(),(

Rq1Rq2

Rxgxa ),,(),(

Semi-Infinite tape machine

Left part

Right part

For all tape symbolsx

Page 30: Turing’s Thesis

Fall 2006 Costas Busch - RPI 30

Standard machine.................. a b c d e

1q

.........Semi-Infinite tape machine

##

Right partLeft part ac b

d e

Lq1

Time 1

Page 31: Turing’s Thesis

Fall 2006 Costas Busch - RPI 31

Time 2

g b c d e

2q

##

Right partLeft part gc b

d e

Lq2

Standard machine..................

.........Semi-Infinite tape machine

Page 32: Turing’s Thesis

Fall 2006 Costas Busch - RPI 32

Lq1Rq1

R),#,(#)#,(#

Semi-Infinite tape machine

Left part

At the border:

Rq1Lq1

R),#,(#)#,(# Right part

Page 33: Turing’s Thesis

Fall 2006 Costas Busch - RPI 33

.........

Semi-Infinite tape machine

##

Right partLeft part gc b

d e

Lq1

.........##

Right partLeft part gc b

d e

Rq1

Time 1

Time 2

END OF PROOF

Page 34: Turing’s Thesis

Fall 2006 Costas Busch - RPI 34

The Off-Line Machine

Control Unit

Input File

Tape

read-only (once)a b c

d eg read-write

Input string Appears on input file only

(state machine)

Input string

Page 35: Turing’s Thesis

Fall 2006 Costas Busch - RPI 35

Off-Line machineshave the same power with Standard Turing machines

Theorem:

Proof:1. Off-Line machines simulate Standard Turing machines

2.Standard Turing machines simulate Off-Line machines

Page 36: Turing’s Thesis

Fall 2006 Costas Busch - RPI 36

1. Off-line machines simulate Standard Turing Machines

Off-line machine:

1. Copy input file to tape

2. Continue computation as in Standard Turing machine

Page 37: Turing’s Thesis

Fall 2006 Costas Busch - RPI 37

1. Copy input file to tape

Input Filea b c

Tape

a b c Standard machine

Off-line machine

a b c

Page 38: Turing’s Thesis

Fall 2006 Costas Busch - RPI 38

2. Do computations as in Turing machine

Input Filea b c

Tape

a b c

a b c

1q

1q

Standard machine

Off-line machine

Page 39: Turing’s Thesis

Fall 2006 Costas Busch - RPI 39

2. Standard Turing machines simulate Off-Line machines:

Use a Standard machine with a four-track tape to keep track ofthe Off-line input file and tape contents

Page 40: Turing’s Thesis

Fall 2006 Costas Busch - RPI 40

Input Filea b c

TapeOff-line Machine

e f gd

Standard Machine -- Four track tape a b c d

e f g0 0 0

0 0

1

1

Input Filehead positionTapehead position

##

Page 41: Turing’s Thesis

Fall 2006 Costas Busch - RPI 41

a b c d

e f g0 0 0

0 0

1

1

Input Filehead positionTapehead position

##

Repeat for each state transition:1. Return to reference point2. Find current input file symbol3. Find current tape symbol4. Make transition

Reference point (uses special symbol # )

##

END OF PROOF

Page 42: Turing’s Thesis

Fall 2006 Costas Busch - RPI 42

Multi-tape Turing Machines

a b c e f g

Control unit

Tape 1 Tape 2

Input string

Input string appears on Tape 1

(state machine)

Page 43: Turing’s Thesis

Fall 2006 Costas Busch - RPI 43

a b c e f g

1q 1q

a g c e d g

2q 2q

Time 1

Time 2

RLdgfb ,),,(),( 1q 2q

Tape 1 Tape 2

Tape 1 Tape 2

Page 44: Turing’s Thesis

Fall 2006 Costas Busch - RPI 44

Multi-tape machineshave the same power with Standard Turing machines

Theorem:

Proof:1. Multi-tape machines simulate Standard Turing machines

2.Standard Turing machines simulate Multi-tape machines

Page 45: Turing’s Thesis

Fall 2006 Costas Busch - RPI 45

1. Multi-tape machines simulate Standard Turing Machines:

Trivial: Use just one tape

Page 46: Turing’s Thesis

Fall 2006 Costas Busch - RPI 46

2. Standard Turing machines simulate Multi-tape machines:

• Uses a multi-track tape to simulate the multiple tapes

• A tape of the Multi-tape machine corresponds to a pair of tracks

Standard machine:

Page 47: Turing’s Thesis

Fall 2006 Costas Busch - RPI 47

a b c h e f g

Multi-tape MachineTape 1 Tape 2

Standard machine with four track tapea b c

e f g0 0

0 0

1

1

Tape 1head positionTape 2head position

h0

Page 48: Turing’s Thesis

Fall 2006 Costas Busch - RPI 48

Repeat for each state transition:1. Return to reference point2. Find current symbol in Tape 13. Find current symbol in Tape 24. Make transition

a b c

e f g0 0

0 0

1

1

Tape 1head positionTape 2head position

h0

####

Reference point

END OF PROOF

Page 49: Turing’s Thesis

Fall 2006 Costas Busch - RPI 49

( steps)

}{ nnbaL

Standard Turing machine:Go back and forth times )( 2nO

2-tape machine:1. Copy to tape 2 nb2. Compare on tape 1 and tape 2

)(nO

nbna

to match the a’s with the b’s

( steps))(nO

)( 2nO time

)(nO time

Same power doesn’t imply same speed:

Page 50: Turing’s Thesis

Fall 2006 Costas Busch - RPI 50

Multidimensional Turing Machines

x

y

ab

c

2-dimensional tape

HEADPosition: +2, -1

MOVES: L,R,U,DU: up D: down

Page 51: Turing’s Thesis

Fall 2006 Costas Busch - RPI 51

Multidimensional machineshave the same power with Standard Turing machines

Theorem:

Proof:1. Multidimensional machines simulate Standard Turing machines

2.Standard Turing machines simulate Multi-Dimensional machines

Page 52: Turing’s Thesis

Fall 2006 Costas Busch - RPI 52

1. Multidimensional machines simulate Standard Turing machines

Trivial: Use one dimension

Page 53: Turing’s Thesis

Fall 2006 Costas Busch - RPI 53

2. Standard Turing machines simulate Multidimensional machines

Standard machine:• Use a two track tape• Store symbols in track 1• Store coordinates in track 2

Page 54: Turing’s Thesis

Fall 2006 Costas Busch - RPI 54

x

y

ab

c

a1

b#

symbolscoordinates

2-dimensional machine

Standard Machine

1 # 2 # 1c

# 1

1q

1q

Page 55: Turing’s Thesis

Fall 2006 Costas Busch - RPI 55

Repeat for each transition followedin the 2-dimensional machine:

1. Update current symbol2. Compute coordinates of next position3. Go to new position

Standard machine:

END OF PROOF

Page 56: Turing’s Thesis

Fall 2006 Costas Busch - RPI 56

Nondeterministic Turing Machines

Lba ,

Rca ,

1q

2q

3q

Allows Non Deterministic Choices

Choice 1

Choice 2

Page 57: Turing’s Thesis

Fall 2006 Costas Busch - RPI 57

a b c

1q

Lba ,

Rca ,

1q

2q

3q

Time 0

Time 1

b b c

2q

c b c

3q

Choice 1

Choice 2

Page 58: Turing’s Thesis

Fall 2006 Costas Busch - RPI 58

Input string is accepted if there is a computation:

w

yqxwq f0

Initial configuration Final Configuration

Any accept state

There is a computation:

Page 59: Turing’s Thesis

Fall 2006 Costas Busch - RPI 59

Nondeterministic machineshave the same power with Standard Turing machines

Theorem:

Proof:1. Nondeterministic machines simulate Standard Turing machines

2.Standard Turing machines simulate Nondeterministic machines

Page 60: Turing’s Thesis

Fall 2006 Costas Busch - RPI 60

1. Nondeterministic Machines simulate Standard (deterministic) Turing Machines

Trivial: every deterministic machine is also nondeterministic

Page 61: Turing’s Thesis

Fall 2006 Costas Busch - RPI 61

2. Standard (deterministic) Turing machines simulate Nondeterministic machines:

• Stores all possible computations of the non-deterministic machine on the 2-dimensional tape

Deterministic machine:• Uses a 2-dimensional tape (which is equivalent to 1-dimensional tape)

Page 62: Turing’s Thesis

Fall 2006 Costas Busch - RPI 62

All possible computation pathsInitial state

Step 1

Step 2

Step i

Step i+1acceptreject infinitepath

Page 63: Turing’s Thesis

Fall 2006 Costas Busch - RPI 63

The Deterministic Turing machinesimulates all possible computation paths:

•in a breadth-first search fashion

•simultaneously

•step-by-step

Page 64: Turing’s Thesis

Fall 2006 Costas Busch - RPI 64

a b c

1q

Lba ,

Rca ,

1q

2q

3q

Time 0

NonDeterministic machine

Deterministic machine

a b c1q

# # # # ##### # #

##

# #

currentconfiguration

Page 65: Turing’s Thesis

Fall 2006 Costas Busch - RPI 65

Lba ,

Rca ,

1q

2q

3q

b b c2q

# # # # #### #

#

# #

Computation 1

b b c

2qChoice 1

c b c

3q

Choice 2

c b c3q ## Computation 2

NonDeterministic machine

Deterministic machine

Time 1

Page 66: Turing’s Thesis

Fall 2006 Costas Busch - RPI 66

Repeat For each configuration in current step of non-deterministic machine,if there are two or more choices: 1. Replicate configuration 2. Change the state in the replicas

END OF PROOF

Deterministic Turing machine

Until either the input string is accepted or rejected in all configurations

Page 67: Turing’s Thesis

Fall 2006 Costas Busch - RPI 67

The simulation takes in the worst case exponential time compared to the shortest accepting path length of the nondeterministic machine

Remark: