courtesy costas busch - rpi1 turing machines. courtesy costas busch - rpi2 the language hierarchy...

Download Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?

Post on 20-Dec-2015

217 views

Category:

Documents

2 download

Embed Size (px)

TRANSCRIPT

  • Slide 1
  • Courtesy Costas Busch - RPI1 Turing Machines
  • Slide 2
  • Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
  • Slide 3
  • Courtesy Costas Busch - RPI3 Regular Languages Context-Free Languages Languages accepted by Turing Machines
  • Slide 4
  • Courtesy Costas Busch - RPI4 A Turing Machine...... Tape Read-Write head Control Unit
  • Slide 5
  • Courtesy Costas Busch - RPI5 The Tape...... Read-Write head No boundaries -- infinite length The head moves Left or Right
  • Slide 6
  • Courtesy Costas Busch - RPI6...... Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right
  • Slide 7
  • Courtesy Costas Busch - RPI7...... Example: Time 0...... Time 1 1. Reads 2. Writes 3. Moves Left
  • Slide 8
  • Courtesy Costas Busch - RPI8...... Time 1...... Time 2 1. Reads 2. Writes 3. Moves Right
  • Slide 9
  • Courtesy Costas Busch - RPI9 The Input String...... Blank symbol head Head starts at the leftmost position of the input string Input string
  • Slide 10
  • Courtesy Costas Busch - RPI10...... Blank symbol head Input string Remark: the input string is never empty
  • Slide 11
  • Courtesy Costas Busch - RPI11 States & Transitions Read Write Move Left Move Right
  • Slide 12
  • Courtesy Costas Busch - RPI12 Example:...... Time 1 current state
  • Slide 13
  • Courtesy Costas Busch - RPI13...... Time 1...... Time 2
  • Slide 14
  • Courtesy Costas Busch - RPI14...... Time 1...... Time 2 Example:
  • Slide 15
  • Courtesy Costas Busch - RPI15...... Time 1...... Time 2 Example:
  • Slide 16
  • Courtesy Costas Busch - RPI16 Determinism Allowed Not Allowed No lambda transitions allowed Turing Machines are deterministic
  • Slide 17
  • Courtesy Costas Busch - RPI17 Partial Transition Function...... Example: No transition for input symbol Allowed:
  • Slide 18
  • Courtesy Costas Busch - RPI18 Halting The machine halts if there are no possible transitions to follow
  • Slide 19
  • Courtesy Costas Busch - RPI19 Example:...... No possible transition HALT!!!
  • Slide 20
  • Courtesy Costas Busch - RPI20 Final States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts
  • Slide 21
  • Courtesy Costas Busch - RPI21 Acceptance Accept Input If machine halts in a final state Reject Input If machine halts in a non-final state or If machine enters an infinite loop
  • Slide 22
  • Courtesy Costas Busch - RPI22 Turing Machine Example A Turing machine that accepts the language:
  • Slide 23
  • Courtesy Costas Busch - RPI23 Time 0
  • Slide 24
  • Courtesy Costas Busch - RPI24 Time 1
  • Slide 25
  • Courtesy Costas Busch - RPI25 Time 2
  • Slide 26
  • Courtesy Costas Busch - RPI26 Time 3
  • Slide 27
  • Courtesy Costas Busch - RPI27 Time 4 Halt & Accept
  • Slide 28
  • Courtesy Costas Busch - RPI28 Rejection Example Time 0
  • Slide 29
  • Courtesy Costas Busch - RPI29 Time 1 No possible Transition Halt & Reject
  • Slide 30
  • Courtesy Costas Busch - RPI30 Infinite Loop Example A Turing machine for language
  • Slide 31
  • Courtesy Costas Busch - RPI31 Time 0
  • Slide 32
  • Courtesy Costas Busch - RPI32 Time 1
  • Slide 33
  • Courtesy Costas Busch - RPI33 Time 2
  • Slide 34
  • Courtesy Costas Busch - RPI34 Time 2 Time 3 Time 4 Time 5 Infinite loop
  • Slide 35
  • Courtesy Costas Busch - RPI35 Because of the infinite loop: The final state cannot be reached The machine never halts The input is not accepted
  • Slide 36
  • Courtesy Costas Busch - RPI36 Another Turing Machine Example Turing machine for the language
  • Slide 37
  • Courtesy Costas Busch - RPI37 Time 0
  • Slide 38
  • Courtesy Costas Busch - RPI38 Time 1
  • Slide 39
  • Courtesy Costas Busch - RPI39 Time 2
  • Slide 40
  • Courtesy Costas Busch - RPI40 Time 3
  • Slide 41
  • Courtesy Costas Busch - RPI41 Time 4
  • Slide 42
  • Courtesy Costas Busch - RPI42 Time 5
  • Slide 43
  • Courtesy Costas Busch - RPI43 Time 6
  • Slide 44
  • Courtesy Costas Busch - RPI44 Time 7
  • Slide 45
  • Courtesy Costas Busch - RPI45 Time 8
  • Slide 46
  • Courtesy Costas Busch - RPI46 Time 9
  • Slide 47
  • Courtesy Costas Busch - RPI47 Time 10
  • Slide 48
  • Courtesy Costas Busch - RPI48 Time 11
  • Slide 49
  • Courtesy Costas Busch - RPI49 Time 12
  • Slide 50
  • Courtesy Costas Busch - RPI50 Halt & Accept Time 13
  • Slide 51
  • Courtesy Costas Busch - RPI51 If we modify the machine for the language we can easily construct a machine for the language Observation:
  • Slide 52
  • Courtesy Costas Busch - RPI52 Formal Definitions for Turing Machines
  • Slide 53
  • Courtesy Costas Busch - RPI53 Transition Function
  • Slide 54
  • Courtesy Costas Busch - RPI54 Transition Function
  • Slide 55
  • Courtesy Costas Busch - RPI55 Turing Machine: States Input alphabet Tape alphabet Transition function Initial state blank Final states
  • Slide 56
  • Courtesy Costas Busch - RPI56 Configuration Instantaneous description:
  • Slide 57
  • Courtesy Costas Busch - RPI57 Time 4Time 5 A Move:
  • Slide 58
  • Courtesy Costas Busch - RPI58 Time 4Time 5 Time 6Time 7
  • Slide 59
  • Courtesy Costas Busch - RPI59 Equivalent notation:
  • Slide 60
  • Courtesy Costas Busch - RPI60 Initial configuration: Input string
  • Slide 61
  • Courtesy Costas Busch - RPI61 The Accepted Language For any Turing Machine Initial stateFinal state
  • Slide 62
  • Courtesy Costas Busch - RPI62 Standard Turing Machine Deterministic Infinite tape in both directions Tape is the input/output file The machine we described is the standard:
  • Slide 63
  • Courtesy Costas Busch - RPI63 Computing Functions with Turing Machines
  • Slide 64
  • Courtesy Costas Busch - RPI64 A function Domain: Result Region: has:
  • Slide 65
  • Courtesy Costas Busch - RPI65 A function may have many parameters: Example: Addition function
  • Slide 66
  • Courtesy Costas Busch - RPI66 Integer Domain Unary: Binary: Decimal: 11111 101 5 We prefer unary representation: easier to manipulate with Turing machines
  • Slide 67
  • Courtesy Costas Busch - RPI67 Definition: A function is computable if there is a Turing Machine such that: Initial configurationFinal configuration Domain final stateinitial state For all
  • Slide 68
  • Courtesy Costas Busch - RPI68 Initial Configuration Final Configuration A function is computable if there is a Turing Machine such that: In other words: Domain For all
  • Slide 69
  • Courtesy Costas Busch - RPI69 Example The function is computable Turing Machine: Input string: unary Output string: unary are integers
  • Slide 70
  • Courtesy Costas Busch - RPI70 Start initial state The 0 is the delimiter that separates the two numbers
  • Slide 71
  • Courtesy Costas Busch - RPI71 Start Finish final state initial state
  • Slide 72
  • Courtesy Costas Busch - RPI72 Finish final state The 0 helps when we use the result for other operations
  • Slide 73
  • Courtesy Costas Busch - RPI73 Turing machine for function
  • Slide 74
  • Courtesy Costas Busch - RPI74 Execution Example: Time 0 Final Result (2)
  • Slide 75
  • Courtesy Costas Busch - RPI75 Time 0
  • Slide 76
  • Courtesy Costas Busch - RPI76 Time 1
  • Slide 77
  • Courtesy Costas Busch - RPI77 Time 2
  • Slide 78
  • Courtesy Costas Busch - RPI78 Time 3
  • Slide 79
  • Courtesy Costas Busch - RPI79 Time 4
  • Slide 80
  • Courtesy Costas Busch - RPI80 Time 5
  • Slide 81
  • Courtesy Costas Busch - RPI81 Time 6
  • Slide 82
  • Courtesy Costas Busch - RPI82 Time 7
  • Slide 83
  • Courtesy Costas Busch - RPI83 Time 8
  • Slide 84
  • Courtesy Costas Busch - RPI84 Time 9
  • Slide 85
  • Courtesy Costas Busch - RP

Recommended

View more >