You are on page 1of 67

Turings Thesis

Turings 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 This is easily translated to computation steps of a Turing machine

When we say: There exists an algorithm

We mean: There exists a Turing Machine that executes the algorithm

Variations of the Turing Machine

The %tandard Model


&nfinite Tape

aababbcac a
Read Write !ead "ontrol #nit $eterministic '(eft or Right)

Variations of the %tandard Model


Turing machines with: * %tay +ption * %emi &nfinite Tape * +ff (ine * Multitape * Multidimensional * ,ondeterministic $ifferent Turing Machine Classes

%ame -ower of two machine classes: both classes accept the same set of languages We will prove: each new class has the same power with %tandard Turing Machine 'accept Turing Recogni.able (anguages)

%ame -ower of two classes means: for any machine

M1

of first class of second class

there is a machine such that:

M2

L( M1 ) = L( M 2 )
and vice versa

Simulation: A techni/ue to prove same power0 %imulate the machine of one class with a machine of the other class %econd "lass %imulation Machine

1irst "lass +riginal Machine

M2 M1
simulates

M1

M1

"onfigurations in the +riginal Machine have corresponding configurations in the %imulation Machine M 2

M1

+riginal Machine:

d0

M1 d1 d n

%imulation Machine:

d1 dn d0 M2

Accepting "onfiguration +riginal Machine:

df

%imulation Machine:

d f

the %imulation Machine and the +riginal Machine accept the same strings

L( M1 ) = L( M 2 )

Turing Machines with %tay +ption

The head can stay in the same position

aababbcac a
(eft2 Right2 %tay (2R2%: possible head moves

3xample:

Time 4

aababbcac a q1
Time 5

b ab abb c ac a q2 q1 a b, S q2

Theorem: %tay +ption machines have the same power with %tandard Turing machines Proof: 40 %tay +ption Machines simulate %tandard Turing machines 50 %tandard Turing machines simulate %tay +ption machines

40 %tay +ption Machines simulate %tandard Turing machines

Trivial: any standard Turing machine is also a %tay +ption machine

50 %tandard Turing machines simulate %tay +ption machines

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

%tay +ption Machine

q1

a b, S

q2

%imulation in %tandard Machine

q1

a b, L

x x, R

q2

1or every possible tape symbol

1or other transitions nothing changes %tay +ption Machine

q1

a b, L

q2

%imulation in %tandard Machine

q1

a b, L

q2

%imilar for Right moves

example of simulation

q1 a b, S q2

%tay +ption Machine: 4

aaba q1 baba q2

baba q2 baba
q3

%imulation in %tandard Machine: 4

aaba q1

3,$ +1 -R++1

Multiple Trac7 Tape


A useful tric7 to perform more complicated simulations +ne Tape

a b a b b a c d
+ne head +ne symbol ( a, b)

trac7 4 trac7 5

a b a b b a c d q1 a c a b b d c d q2 q1
(b, a ) (c, d ), L

trac7 4 trac7 5

trac7 4 trac7 5

q2

%emi &nfinite Tape


The head extends infinitely only to the right

a b a c

000000000

* &nitial position is the leftmost cell * When the head moves left from the border2 it returns to the same position

Theorem:

%emi &nfinite machines have the same power with %tandard Turing machines

Proof: 40 %tandard Turing machines simulate %emi &nfinite machines 50 %emi &nfinite Machines simulate %tandard Turing machines

40 %tandard Turing machines simulate %emi &nfinite machines:


# a b a c

%tandard Turing Machine


a0 insert special symbol at left of input string b0 Add a self loop to every state
'except states with no outgoing transitions)

#
# # , R

50 %emi &nfinite tape machines simulate %tandard Turing machines: 000000000 %tandard machine 000000000

%emi &nfinite tape machine 000000000 %/uee.e infinity of both directions in one direction

000000000

%tandard machine

a b c d e
reference point

000000000

%emi &nfinite tape machine with two trac7s Right part # d e (eft part

# c b a

000000000

%tandard machine

q1

q2

%emi &nfinite tape machine (eft part


L q1 L q2

Right part
R q1 R q2

%tandard machine

q1

a g, R

q2

%emi &nfinite tape machine Right part (eft part


R q1 L q1

(a, x) ( g , x), R ( x, a ) ( x, g ), L

R q2 L q2

1or all tape symbols

Time 4 000000000

%tandard machine

a b c d e q1
%emi &nfinite tape machine

000000000

Right part # d e (eft part

# c b a
L q1

000000000

Time 5 000000000

%tandard machine

g b c d e q2
%emi &nfinite tape machine

000000000

Right part # d e (eft part

g c b #
L q2

000000000

At the border:

%emi &nfinite tape machine Right part


R q1

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

L q1

(eft part

L q1

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

R q1

%emi &nfinite tape machine Right part # d e (eft part


L q1

# c b g
Time 5

Time 4

000000000

Right part # d e (eft part


R q1

# c b g

000000000

3,$ +1 -R++1

The +ff (ine Machine


&nput 1ile read only 'once)

a b c
&nput string "ontrol #nit
'state machine)

&nput string Appears on input file only

g d e

Tape

read write

Theorem: +ff (ine machines have the same power with %tandard Turing machines Proof: 40 +ff (ine machines simulate %tandard Turing machines 50 %tandard Turing machines simulate +ff (ine machines

40 +ff line machines simulate %tandard Turing Machines +ff line machine: 40 "opy input file to tape 50 "ontinue computation as in %tandard Turing machine

%tandard machine

a b c

+ff line machine

a b c

&nput 1ile

a b c

Tape

40 "opy input file to tape

a b c q1

%tandard machine

+ff line machine

a b c

&nput 1ile

a b c
q1

Tape

50 $o computations as in Turing machine

50 %tandard Turing machines simulate +ff (ine machines:

#se a %tandard machine with a four trac7 tape to 7eep trac7 of the +ff line input file and tape contents

+ff line Machine

a b c d

&nput 1ile

e f g
1our trac7 tape &nput 1ile head position Tape head position

Tape

%tandard Machine

# a b # 0 0 e f 0 1

c d 1 0 g 0

Reference point

'uses special symbol 9 )

# # # #

a 0 e 0

b 0 f 1

c d 1 0 g 0

&nput 1ile head position Tape head position

Repeat for each state transition: 40 Return to reference point 50 1ind current input file symbol 60 1ind current tape symbol 80 Ma7e transition
3,$ +1 -R++1

Multi tape Turing Machines


"ontrol unit
'state machine)

Tape 4

a b c
&nput string

g f e

Tape 5

&nput string appears on Tape 4

Tape 4

Time 4

a b c q1
Tape 4

g f e q1

Tape 5

a g c q2 q1

Time 5

g e d q2

Tape 5

(b, f ) ( g , d ), L, R

q2

Theorem: Multi tape machines have the same power with %tandard Turing machines Proof: 40 Multi tape machines simulate %tandard Turing machines 50 %tandard Turing machines simulate Multi tape machines

40 Multi tape machines simulate %tandard Turing Machines:

Trivial: #se :ust one tape

50 %tandard Turing machines simulate Multi tape machines: %tandard machine: * #ses a multi trac7 tape to simulate the multiple tapes * A tape of the Multi tape machine corresponds to a pair of trac7s

a b c

Multi tape Machine Tape 4 Tape 5

g f e h

%tandard machine with four trac7 tape

a 0 e 0

b 1 f 0

c 0 g h 1 0

Tape 4 head position Tape 5 head position

Reference point

# # # #

a 0 e 0

b 1 f 0

c 0 g h 1 0

Tape 4 head position Tape 5 head position

Repeat for each state transition: 40 Return to reference point 50 1ind current symbol in Tape 4 60 1ind current symbol in Tape 5 80 Ma7e transition

3,$ +1 -R++1

%ame power doesnt imply same speed: n n

L= a b }

%tandard Turing machine: O ( n ) time


2 O ( n ) times ;o bac7 and forth to match the as with the bs

5 tape machine: O ( n) time n 40 "opy b to tape 5 'O(n) steps) 50 "ompare a on tape 4 n and b tape 5 'O(n) steps)

Multidimensional Turing Machines


5 dimensional tape

y c a b

M+V3%: (2R2#2$ #: up $: down

!3A$ -osition: <52 4

Theorem: Multidimensional machines have the same power with %tandard Turing machines Proof: 40 Multidimensional machines simulate %tandard Turing machines 50 %tandard Turing machines simulate Multi $imensional machines

40 Multidimensional machines simulate %tandard Turing machines

Trivial: #se one dimension

50 %tandard Turing machines simulate Multidimensional machines

%tandard machine: * #se a two trac7 tape * %tore symbols in trac7 4 * %tore coordinates in trac7 5

5 dimensional machine

c a b
%tandard Machine

q1
symbols coordinates

c a b 1 # 1 # 2 # 1 # 1 q1

%tandard machine: Repeat for each transition followed in the 5 dimensional machine: 40 #pdate current symbol 50 "ompute coordinates of next position 60 ;o to new position

3,$ +1 -R++1

,ondeterministic Turing Machines a b, L q1 a c, R


q3 "hoice 5

q2

"hoice 4

Allows ,on $eterministic "hoices

Time =

a b c q1 a b, L q1 a c, R
q3

Time 4

q2

b b c q2 c b c
q3
"hoice 5

"hoice 4

&nput string w is accepted if there is a computation:

q0 w x q f y

&nitial configuration

1inal "onfiguration

Any accept state There is a computation:

Theorem: ,ondeterministic machines have the same power with %tandard Turing machines Proof: 40 ,ondeterministic machines simulate %tandard Turing machines 50 %tandard Turing machines simulate ,ondeterministic machines

40 ,ondeterministic Machines simulate %tandard 'deterministic) Turing Machines

Trivial: every deterministic machine is also nondeterministic

50 %tandard 'deterministic) Turing machines simulate ,ondeterministic machines:

$eterministic machine: * #ses a 5 dimensional tape


'which is e/uivalent to 4 dimensional tape)

* %tores all possible computations of the non deterministic machine on the 5 dimensional tape

All possible computation paths &nitial state %tep 4 %tep 5

%tep i re:ect accept


infinite path

%tep i<4

The $eterministic Turing machine simulates all possible computation paths: *simultaneously *step by step *in a breadth first search fashion

,on$eterministic machine

a b, L q1 a c, R # # # #

q2

Time =

a b c q1

q3
$eterministic machine

# # # a b c q1 # # #

# # # # #

current configuration

,on$eterministic machine Time 4

a b, L q1 a c, R

q2

b b c

"hoice 4 "hoice 5

q2 c b c
q3

q3

$eterministic machine

# # # # # # # b b c # # q2 # # c b c # q3 # #

"omputation 4 "omputation 5

$eterministic Turing machine Repeat 1or each configuration in current step of non deterministic machine2 if there are two or more choices: 40 Replicate configuration 50 "hange the state in the replicas #ntil either the input string is accepted or re:ected in all configurations
3,$ +1 -R++1

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

You might also like