690 likes | 947 Views
Turing Machines. A Turing Machine. Tape. . . Read-Write head. Control Unit. The Tape. No boundaries -- infinite length. . . Read-Write head. The head moves Left or Right. . . Read-Write head. The head at each time step: 1. Reads a symbol 2. Writes a symbol
E N D
A Turing Machine Tape ...... ...... Read-Write head Control Unit
The Tape No boundaries -- infinite length ...... ...... Read-Write head The head moves Left or Right
...... ...... Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right
Example: Time 0 ...... ...... Time 1 ...... ...... 1. Reads 2. Writes 3. Moves Left
Time 1 ...... ...... Time 2 ...... ...... 1. Reads 2. Writes 3. Moves Right
The Input String Input string Blank symbol ...... ...... head Head starts at the leftmost position of the input string
Input string Blank symbol ...... ...... head Remark: the input string is never empty
States & Transitions Write Read Move Left Move Right
Example: Time 1 ...... ...... current state
Time 1 ...... ...... Time 2 ...... ......
Example: Time 1 ...... ...... Time 2 ...... ......
Example: Time 1 ...... ...... Time 2 ...... ......
Determinism Turing Machines are (for now) deterministic Not Allowed Allowed
Partial Transition Function Example: ...... ...... Allowed: No transition for input symbol
Halting The machine haltsif there are no possible transitions to follow
Example: ...... ...... No possible transition HALT!!!
Final (accepting) States Allowed Not Allowed • Final states have no outgoing transitions • In a final state the machine halts
Acceptance If machine halts in a final state Accept Input If machine halts in a non-final state or If machine enters an infinite loop Reject Input
Turing Machine Example A Turing machine that accepts the language:
Time 4 Halt & Accept
Rejection Example Time 0
Time 1 No possible Transition Halt & Reject
Infinite Loop Example A Turing machine for the language that includes all strings an with n>0 or strings that start with b.
Time 2 Time 3 Infinite loop Time 4 Time 5
Because of the infinite loop: • The final state cannot be reached • The machine never halts • The input is not accepted
Standard Turing Machine The machine we described is the standard: • Deterministic • Infinite tape in both directions • Tape is the input/output file
Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Computer Science Law: A computation is mechanical if and only if it can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines
Algorithms are Turing Machines When we say: There exists an algorithm We mean: There exists a Turing Machine that executes the algorithm
The Standard Model Infinite Tape Read-Write Head (Left or Right) Control Unit Deterministic
The variations form different Turing MachineClasses We want to prove: Each Class has the same power with the Standard Model
Same Power of two classes means: Both classes of Turing machines accept the same languages
Same Power of two classes means: For any machine of first class there is a machine of second class such that: And vice-versa
Multitape Turing Machines Control unit Tape 1 Tape 2 Input
Tape 1 Time 1 Tape 2 Time 2
Multitape machines simulate Standard Machines: Use just one tape We can also prove that standard machines simulate Multitape machines.
Same power doesn’t imply same speed: Language Acceptance Time Standard machine Two-tape machine
Standard machine: Go back and forth times Two-tape machine: Copy to tape 2 ( steps) ( steps) Leave on tape 1 Compare tape 1 and tape 2 ( steps)
NonDeterministic Turing Machines Non Deterministic Choice
Time 0 Time 1 Choice 1 Choice 2