Beruflich Dokumente
Kultur Dokumente
1
Turing’s thesis:
(1930)
2
Computer Science Law:
A computation is mechanical
if and only if
it can be performed by a Turing Machine
4
Algorithms are Turing Machines
When we say:
There exists an algorithm
We mean:
There exists a Turing Machine
that executes the algorithm
5
Variations
of the
Turing Machine
6
The Standard Model
Infinite Tape
◊ ◊aababbcac a◊◊◊
Control Unit
Deterministic
7
Variations of the Standard Model
8
The variations form different
Turing Machine Classes
We want to prove:
Each Class has the same
power with the Standard Model
9
Same Power of two classes means:
Both classes of Turing machines accept
the same languages
10
Same Power of two classes means:
such that: L( M1 ) = L( M 2 )
And vice-versa
11
Simulation: a technique to prove same power
Second Class
First Class Simulation Machine
Original Machine M2
M1 M1
12
Configurations in the Original Machine
correspond to configurations
in the Simulation Machine
Original Machine: d 0 d1 d n
∗ ∗ ∗
Simulation Machine: d 0′ d1′ d n′
13
Final Configuration
Original Machine: df
Simulation Machine: d ′f
◊ ◊aababbcac a◊◊◊
L,R,S: moves
15
Example: Time 1
◊ ◊aababbcac a◊◊◊
q1
Time 2
◊ ◊b ab abb c ac a◊◊◊
q2
q1 a → b, S q2
16
Theorem: Stay-Option Machines
have the same power with
Standard Turing machines
17
Proof:
18
Proof:
19
Stay-Option Machine
a → b, L
q1 q2
a → b, L
q1 q2
a → b, S
q1 q2
a → b, L x → x, R
q1 q3 q2
◊ ◊ a b a b ◊ track 1
◊ ◊ b a c d ◊ track 2
one symbol
23
◊ ◊ a b a b ◊ track 1
◊ ◊ b a c d ◊ track 2
q1
◊ ◊ a c a b ◊ track 1
◊ ◊ b d c d ◊ track 2
q2
(b, a ) → (c, d ), L
q1 q2
24
Semi-Infinite Tape
# a b a c ◊ ◊ .........
25
Standard Turing machines simulate
Semi-infinite tape machines:
Trivial
26
Semi-infinite tape machines simulate
Standard Turing machines:
Standard machine
......... .........
27
Standard machine
......... ◊ a b c d e ◊ ◊ .........
reference point
28
Theorem: Semi-infinite tape machines
have the same power with
Standard Turing machines
29
The Off-Line Machine
Input File
a b c
read-only
Control Unit
Tape read-write
◊ ◊ g d e ◊ ◊
30
Off-line machines simulate
Standard Turing Machines:
Off-line machine:
2. Continue computation as in
Standard Turing machine
31
Standard machine
◊ a b c ◊ ◊
Off-line machine
Off-line machine
34
Off-line Machine
Input File Tape
a b c d ◊ ◊ e f g ◊
# a b c d Input File
# 0 0 1 0 head position
e f g Tape
0 1 0 head position
35
Reference point
# a b c d Input File
# 0 0 1 0 head position
e f g Tape
0 1 0 head position
37
Multitape Turing Machines
Control unit
Tape 1 Tape 2
◊ a b c ◊ ◊ e f g ◊
Input
38
Tape 1 Time 1 Tape 2
◊ a b c ◊ ◊ e f g ◊
q1 q1
Time 2
◊ a g c ◊ ◊ e d g ◊
q2 q2
(b, f ) → ( g , d ), L, R
q1 q2
39
Multitape machines simulate
Standard Machines:
40
Standard machines simulate
Multitape machines:
Standard machine:
41
Multitape Machine
Tape 1 Tape 2
◊ a b c ◊ ◊ e f g h ◊
a b c Tape 1
#
# 0 1 0 head position
# e f g h Tape 2
# 0 0 1 0 head position
44
Same power doesn’t imply same speed:
n n
Language L = {a b }
Acceptance Time
2
Standard machine n
Two-tape machine n
45
n n
L = {a b }
Standard machine:
2
Go back and forth n times
Two-tape machine:
n
Copy b to tape 2 ( n steps)
n ( n steps)
Leave a on tape 1
Compare tape 1 and tape 2 ( n steps)
46
MultiDimensional Turing Machines
Two-dimensional tape y
◊
◊ c a x
◊ b
◊
48
Standard machines simulate
Multidimensional machines:
Standard machine:
• Use a two track tape
49
Two-dimensional machine
y
◊
◊ c a x
◊ b
◊
Standard Machine q1
a b c symbols
1 # 1 # 2 # −1 # − 1 coordinates
q1 50
Standard machine:
51
Theorem: MultiDimensional Machines
have the same power
with Standard Turing Machines
52
NonDeterministic Turing Machines
a → b, L q2
q1
a → c, R q3
53
a → b, L q2
Time 0
q1
◊ a b c ◊
a → c, R q3 q1
Time 1
Choice 1 Choice 2
◊ b b c ◊ ◊ c b c ◊
q2 q3
54
Input string w is accepted if
this a possible computation
∗
q0 w x q f y
Final state
55
NonDeterministic Machines simulate
Standard (deterministic) Machines:
56
Deterministic machines simulate
NonDeterministic machines:
Deterministic machine:
57
Non-Deterministic Choices
q1
q2 q3
q4 q5
Computation 1
q6 q7
58
Non-Deterministic Choices
q1
q2 q3
q4 q5
q6 q7
Computation 2 59
Simulation
Deterministic machine:
• Stores computations in a
two-dimensional tape
60
NonDeterministic machine
Time 0
a → b, L q2
◊ a b c ◊
q1
q1
a → c, R q3
Deterministic machine
# # # # # #
# a b c # Computation 1
# q1 #
# # # # #
61
NonDeterministic machine
Time 1
◊ b b c ◊ Choice 1
a → b, L q2
q2
q1
◊ c b c ◊ Choice 2
a → c, R q3 q3
Deterministic machine
# # # # # #
# b b c # Computation 1
# q2 #
# c b c #
q3 Computation 2
# #
62
Repeat
• Execute a step in each computation:
63
Theorem: NonDeterministic Machines
have the same power with
Deterministic machines
64
Remark:
The simulation in the Deterministic machine
takes time exponential time compared
to the NonDeterministic machine
65