Transcript AUBER F13
http://www.mrtc.mdh.se/~gdc/work/TuringCentenary.pdf http://www.mrtc.mdh.se/~gdc/work/TuringMachine.pdf IDT Open Seminar
ALAN TURING AND HIS LEGACY
100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University March 8 th 2012 1
Chomsky Language Hyerarchy Turing Machines
a n b n c n
Push-down Automata
a n b n ww R
Finite Automata
a
*
a
*
b
*
ww
2
TURING MACHINES “Turing’s "Machines". These machines are
humans who calculate .”
(Wittgenstein) “A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine .” (Turing) 3
Tape ......
Turing Machine Read-Write head Control Unit ......
4
......
The Tape No boundaries -- infinite length ......
Read-Write head The head moves Left or Right 5
......
Read-Write head The head at each time step: 1.
Reads a symbol 2.
Writes a symbol 3.
Moves Left or Right ......
6
The Input String Input string Blank symbol ......
# #
a b a c
# # #
......
head Head starts at the leftmost position of the input string 7
Determinism
q
1 Turing Machines are deterministic Allowed
a
b
,
R q
2 Not Allowed
a
b
,
R q
2
b
d
,
L q
3
q
1
a
d
,
L q
3 No lambda transitions allowed in TM!
8
Determinism Note the difference between state indeterminism when not even possible future states are known in advance.
and choice indeterminism when possible future states are known, but we do not know which state will be taken. 9
Halting The machine halts if there are no possible transitions to follow 10
Example ......
# #
a b a c
# # #
q
1
a
b
,
R q
1
b
d
,
L q
2
q
3 ......
No possible transition HALT!
11
q
1
q
1 Final States
q
2
q
2 Allowed Not Allowed • Final states have no outgoing transitions • In a final state the machine halts 12
Accept Input Acceptance If machine halts in a final state Reject Input If machine halts in a non-final state or If machine enters an infinite loop 13
Formal Definitions for Turing Machines
14
Transition Function
q
1
a
b
,
R q
2 (
q
1 ,
a
) (
q
2 ,
b
,
R
) 15
Transition Function
q
1
c
d
,
L q
2 (
q
1 ,
c
) (
q
2 ,
d
,
L
) 16
Turing Machine Input alphabet Tape alphabet States
M
(
Q
, , , ,
q
0 , # ,
F
) Transition function Initial state blank Final states 17
The Accepted Language
L
For any Turing Machine (
M
) {
w
:
q
0
w M
x
1
q f x
2 } Initial state Final state 18
Standard Turing Machine The machine we described is the standard: • Deterministic • Infinite tape in both directions •Tape is the input/output file 19
Computing Functions with Turing Machines
20
q
0
w
q f f
(
w
) Initial Configuration Final Configuration For all
w
D
Domain 21
Example (Addition) The function
f
(
x
,
y
)
x
y
is computable
x
,
y
are integers Turing Machine: Input string:
x
0
y
unary Output string:
xy
0 unary 22
Start Finish
x y
#
1 1 1 0 1 1
#
q
0 initial state
x
y
#
1 1
q f
final state 1 1 0
#
23
Turing machine for function
f
(
x
,
y
)
x
y
1 1 ,
R
1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 24
Execution Example:
x
11
y
11 (2) (2)
#
1
x
Time 0
y
1 0 1 1
#
q
0
#
Final Result
x
y
1 1 1 1 0
#
q
4 25
f
(
x
,
y
)
x
y
Time 0 1 1 ,
R
#
1 1 0 1 1
#
q
0 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 26
f
(
x
,
y
)
x
y
Time 1 1 1 ,
R
#
1 1 0 1 1
#
q
0 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 27
Time 2 1 1 ,
R
#
1 1 0 1 1
#
q
0 1 1 ,
R f
(
x
,
y
)
x
y
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 28
f
(
x
,
y
)
x
y
Time 3 1 1 ,
R
#
1 1 1 1 1
#
q
1 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 29
f
(
x
,
y
)
x
y
Time 4 1 1 ,
R
#
1 1 1 1 1
#
q
1 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 30
f
(
x
,
y
)
x
y
Time 5 1 1 ,
R
#
1 1 1 1 1
#
q
1 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 31
f
(
x
,
y
)
x
y
Time 6 1 1 ,
R
#
1 1 1 1 1
#
q
2 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 32
f
(
x
,
y
)
x
y
Time 7 1 1 ,
R
#
1 1 1 1 0
#
q
3 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 33
f
(
x
,
y
)
x
y
Time 8 1 1 ,
R
#
1 1 1 1 0
#
q
3 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 34
f
(
x
,
y
)
x
y
Time 9 1 1 ,
R
#
1 1 1 1 0
#
q
3 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3
q
4 # # ,
R
35
f
(
x
,
y
)
x
y
Time 10 1 1 ,
R
#
1 1 1 1 0
#
q
3 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 36
f
(
x
,
y
)
x
y
Time 11 1 1 ,
R
#
1 1 1 1 0
#
q
3 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L q
2 1 0 ,
L q
3 # # ,
R q
4 37
f
(
x
,
y
)
x
y
Time 12 1 1 ,
R
#
1 1 1 1 0
#
q
4 1 1 ,
R
1 1 ,
L q
0 0 1 ,
R q
1 # # ,
L
HALT & accept
q
2 1 0 ,
L q
3 # # ,
R q
4 38
Universal
Turing Machine
39
A limitation of Turing Machines: Turing Machines are “hardwired” they execute only one program 40
Solution: Universal Turing Machine Characteristics: • Reprogrammable machine • Simulates any other Turing Machine 41
Universal Turing Machine simulates any other Turing Machine
M
Input to Universal Turing Machine: • Description of transitions of
M
• Initial tape contents of
M
42
Three tapes Universal Turing Machine Tape 1 Description of
M
Tape 2 Tape Contents of
M
Tape 3 State of
M
43
Tape 1 Description of
M
We describe Turing machine
M
as a string of symbols: 44
Symbols: Alphabet Encoding
a b c
Encoding: 1 11
d
111 1111 45
States:
q
1 State Encoding
q
2
q
3 Encoding: 1 11 111
q
4 1111 Move: Encoding: Head Move Encoding
L R
1 11 46
Transition: Transition Encoding (
q
1 ,
a
) (
q
2 ,
b
,
L
) Encoding: 1 0 1 0 11 0 11 0 1 separator 47
Machine Encoding Transitions: (
q
1 ,
a
) (
q
2 ,
b
,
L
) Encoding: (
q
2 ,
b
) (
q
3 ,
c
,
R
) 1 0 1 0 11 0 11 0 1 00 11 0 1 10 111 0 111 0 11 separator 48
Tape 1 contents of Universal Turing Machine: encoding of the simulated machine as a binary string of 0’s and 1’s
M
49
As Turing Machine is described with a binary string of 0’s and 1’s the set of Turing machines forms a language: Each string of the language is the binary encoding of a Turing Machine.
50
Language of Turing Machines L = { 010100101, (Turing Machine 1) 00100100101111, 111010011110010101, …… } (Turing Machine 2) …… 51
CHURCH TURING THESIS
Question: Do Turing machines have the same power with a digital computer?
Intuitive answer: Yes There was no formal proof of Church-Turing thesis until 2008!
52
Dershowitz, N. and Gurevich, Y. A Natural Axiomatization of Computability and Proof of Church's Thesis,
Bulletin of Symbolic Logic
, v. 14, No. 3, pp. 299-350 (2008) This formal proof of Church-Turing thesis relies on an axiomatization of computation that excludes
randomness, parallelism and quantum computing
and thus corresponds to the idea of computing that Church and Turing had.
53
Turing’s thesis Any computation carried out by algorithmic means can be performed by a Turing Machine. (1930) http://www.engr.uconn.edu/~dqg/papers/myth.pdf The Origins of the Turing Thesis Myth Goldin & Wegner 54