6
Semi-infinite tape machines simulateStandard Turing machines
Turing machine
.........
Semi-infinite tape machine
..................
7
Turing machine
.........
Semi-infinite tape with two tracks
..................
reference point
#
#
Right part
Left part
a b c d e
ac bd e
9
1q 2qRga ,
Turing machine
Lq1Lq2
Lgxax ),,(),(
Rq1Rq2
Rxgxa ),,(),(
Semi-infinite tape machine
Left part
Right part
For all symbols x
10
Turing machine
.................. a b c d e
1q
.........
Semi-infinite tape
#
#
Right part
Left part ac bd e
Lq1
Time 1
11
Time 2Turing machine
.................. g b c d e
2q
.........
Semi-infinite tape
#
#
Right part
Left part gc bd e
Lq2
12
Lq1Rq1
R),#,(#)#,(#
Semi-infinite tape machine
Left part
At the border:
Rq1Lq1
R),#,(#)#,(# Right part
13
.........
Semi-infinite tape
#
#
Right part
Left part gc bd e
Lq1
.........#
#
Right part
Left part gc bd e
Rq1
Time 1
Time 2
16
Off-line Machines simulate Turing Machines
Off-line machine:
1. Copy input file to tape
2. Continue computation as in Standard Turing machine
182. Do computations as in Turing machine
Input Filea b c
Tape
a b c Turing Machine
Off-line Machine
a b c
1q
1q
19
Turing Machines simulate Off-line machines
Use a Standard machine with four track tapeto keep track ofthe Off-line input file and tape contents
20
Input Filea b c
Tape
Off-line Machine
e f gd
Four track tape -- Standard Machine
a b c d
e f g0 0 0
0 0
1
1
input file
head position
tapehead position
##
21
a b c d
e f g0 0 0
0 0
1
1
input file
head position
tapehead position
##
Repeat for each state transition:
Return to reference pointFind current input file symbolFind current tape symbolmake transition
Reference point
26
Standard machines simulate Multitape machines
Use a multi-track tape
A tape of the Multiple tape machinecorresponds to a pair of tracks
Standard machine:
27
a b c h e f g
Multitape MachineTape 1 Tape 2
Four track tape -- Standard Machine
a b c
e f g0 0
0 0
1
1
Tape 1
head position
Tape 2head position
h0
28
Repeat for each state transition:
Return to reference pointFind current symbol on Tape 1Find current symbol on Tape 2make transition
a b c
e f g0 0
0 0
1
1
Tape 1
head position
Tape 2head position
h0
####
Reference point
30
Same power doesn’t mean same speed:
Language }{ nnbaL
Acceptance Time
Standard machine
Two-tape machine
2n
n
31
}{ nnbaL
Standard machine:
Go back and forth times 2n
Two-tape machine:
Copy to tape 2 nb
Leave to tape 1 na
Compare tape 1 and tape 2
n( steps)
n( steps)
n( steps)
32
MultiDimensional Turing Machines
x
y
ab
c
Two-dimensional tape
HEADPosition: +2, -1
MOVES: L,R,U,D
U: up D: down
34
Standard machinessimulateMultidimensional machines
Standard machine:
Use a two track tape
Store symbols in track 1Store coordinates in track 2
36
Repeat for each transition
Update current symbolCompute coordinates of next positionGo to new position
Simulation:
40
Input is accepted if this a possible computation
w
yqxwq f
0
Initial configuration Final Configuration
Final state
41
NonDeterministic Machinessimulate Standard (deterministic) Machines
Every deterministic machine is also a nondeterministic machine
42
Deterministic machinessimulateNonDeterministic machines
Keeps track of all possible computations
Deterministic machine:
45
Keeps track of all possible computations
Deterministic machine:
Simulation
Stores computations in atwo-dimensional tape
46
a b c
1q
Lba ,
Rca ,
1q
2q
3q
TIME 0 NonDeterministic
Deterministic
a b c1q
# # # # ##### # #
##
# #
Computation 1
47
Lba ,
Rca ,
1q
2q
3q
TIME 1 NonDeterministic
Deterministic
b b c1q
# # # # #### #
#
# #
Computation 1
b b c
2q
Choice 1
c b c
3q
Choice 2
c b c3q ## Computation 2
48
Repeat Execute a step in each computation:
If there is a choice in current computation: replicate configuration change the state in the replica
50
Remark:
The simulation in the deterministic Machine takes time exponential time compared to NonDeterministic machines
Top Related