Download presentation
Presentation is loading. Please wait.
1
Courtesy Costas Busch - RPI1 Turing Machines
2
Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
3
Courtesy Costas Busch - RPI3 Regular Languages Context-Free Languages Languages accepted by Turing Machines
4
Courtesy Costas Busch - RPI4 A Turing Machine...... Tape Read-Write head Control Unit
5
Courtesy Costas Busch - RPI5 The Tape...... Read-Write head No boundaries -- infinite length The head moves Left or Right
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
7
Courtesy Costas Busch - RPI7...... Example: Time 0...... Time 1 1. Reads 2. Writes 3. Moves Left
8
Courtesy Costas Busch - RPI8...... Time 1...... Time 2 1. Reads 2. Writes 3. Moves Right
9
Courtesy Costas Busch - RPI9 The Input String...... Blank symbol head Head starts at the leftmost position of the input string Input string
10
Courtesy Costas Busch - RPI10...... Blank symbol head Input string Remark: the input string is never empty
11
Courtesy Costas Busch - RPI11 States & Transitions Read Write Move Left Move Right
12
Courtesy Costas Busch - RPI12 Example:...... Time 1 current state
13
Courtesy Costas Busch - RPI13...... Time 1...... Time 2
14
Courtesy Costas Busch - RPI14...... Time 1...... Time 2 Example:
15
Courtesy Costas Busch - RPI15...... Time 1...... Time 2 Example:
16
Courtesy Costas Busch - RPI16 Determinism Allowed Not Allowed No lambda transitions allowed Turing Machines are deterministic
17
Courtesy Costas Busch - RPI17 Partial Transition Function...... Example: No transition for input symbol Allowed:
18
Courtesy Costas Busch - RPI18 Halting The machine halts if there are no possible transitions to follow
19
Courtesy Costas Busch - RPI19 Example:...... No possible transition HALT!!!
20
Courtesy Costas Busch - RPI20 Final States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts
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
22
Courtesy Costas Busch - RPI22 Turing Machine Example A Turing machine that accepts the language:
23
Courtesy Costas Busch - RPI23 Time 0
24
Courtesy Costas Busch - RPI24 Time 1
25
Courtesy Costas Busch - RPI25 Time 2
26
Courtesy Costas Busch - RPI26 Time 3
27
Courtesy Costas Busch - RPI27 Time 4 Halt & Accept
28
Courtesy Costas Busch - RPI28 Rejection Example Time 0
29
Courtesy Costas Busch - RPI29 Time 1 No possible Transition Halt & Reject
30
Courtesy Costas Busch - RPI30 Infinite Loop Example A Turing machine for language
31
Courtesy Costas Busch - RPI31 Time 0
32
Courtesy Costas Busch - RPI32 Time 1
33
Courtesy Costas Busch - RPI33 Time 2
34
Courtesy Costas Busch - RPI34 Time 2 Time 3 Time 4 Time 5 Infinite loop
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
36
Courtesy Costas Busch - RPI36 Another Turing Machine Example Turing machine for the language
37
Courtesy Costas Busch - RPI37 Time 0
38
Courtesy Costas Busch - RPI38 Time 1
39
Courtesy Costas Busch - RPI39 Time 2
40
Courtesy Costas Busch - RPI40 Time 3
41
Courtesy Costas Busch - RPI41 Time 4
42
Courtesy Costas Busch - RPI42 Time 5
43
Courtesy Costas Busch - RPI43 Time 6
44
Courtesy Costas Busch - RPI44 Time 7
45
Courtesy Costas Busch - RPI45 Time 8
46
Courtesy Costas Busch - RPI46 Time 9
47
Courtesy Costas Busch - RPI47 Time 10
48
Courtesy Costas Busch - RPI48 Time 11
49
Courtesy Costas Busch - RPI49 Time 12
50
Courtesy Costas Busch - RPI50 Halt & Accept Time 13
51
Courtesy Costas Busch - RPI51 If we modify the machine for the language we can easily construct a machine for the language Observation:
52
Courtesy Costas Busch - RPI52 Formal Definitions for Turing Machines
53
Courtesy Costas Busch - RPI53 Transition Function
54
Courtesy Costas Busch - RPI54 Transition Function
55
Courtesy Costas Busch - RPI55 Turing Machine: States Input alphabet Tape alphabet Transition function Initial state blank Final states
56
Courtesy Costas Busch - RPI56 Configuration Instantaneous description:
57
Courtesy Costas Busch - RPI57 Time 4Time 5 A Move:
58
Courtesy Costas Busch - RPI58 Time 4Time 5 Time 6Time 7
59
Courtesy Costas Busch - RPI59 Equivalent notation:
60
Courtesy Costas Busch - RPI60 Initial configuration: Input string
61
Courtesy Costas Busch - RPI61 The Accepted Language For any Turing Machine Initial stateFinal state
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:
63
Courtesy Costas Busch - RPI63 Computing Functions with Turing Machines
64
Courtesy Costas Busch - RPI64 A function Domain: Result Region: has:
65
Courtesy Costas Busch - RPI65 A function may have many parameters: Example: Addition function
66
Courtesy Costas Busch - RPI66 Integer Domain Unary: Binary: Decimal: 11111 101 5 We prefer unary representation: easier to manipulate with Turing machines
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
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
69
Courtesy Costas Busch - RPI69 Example The function is computable Turing Machine: Input string: unary Output string: unary are integers
70
Courtesy Costas Busch - RPI70 Start initial state The 0 is the delimiter that separates the two numbers
71
Courtesy Costas Busch - RPI71 Start Finish final state initial state
72
Courtesy Costas Busch - RPI72 Finish final state The 0 helps when we use the result for other operations
73
Courtesy Costas Busch - RPI73 Turing machine for function
74
Courtesy Costas Busch - RPI74 Execution Example: Time 0 Final Result (2)
75
Courtesy Costas Busch - RPI75 Time 0
76
Courtesy Costas Busch - RPI76 Time 1
77
Courtesy Costas Busch - RPI77 Time 2
78
Courtesy Costas Busch - RPI78 Time 3
79
Courtesy Costas Busch - RPI79 Time 4
80
Courtesy Costas Busch - RPI80 Time 5
81
Courtesy Costas Busch - RPI81 Time 6
82
Courtesy Costas Busch - RPI82 Time 7
83
Courtesy Costas Busch - RPI83 Time 8
84
Courtesy Costas Busch - RPI84 Time 9
85
Courtesy Costas Busch - RPI85 Time 10
86
Courtesy Costas Busch - RPI86 Time 11
87
Courtesy Costas Busch - RPI87 HALT & accept Time 12
88
Courtesy Costas Busch - RPI88 Another Example The function is computable Turing Machine: Input string: unary Output string:unary is integer
89
Courtesy Costas Busch - RPI89 Start Finish final state initial state
90
Courtesy Costas Busch - RPI90 Turing Machine Pseudocode for Replace every 1 with $ Repeat: Find rightmost $, replace it with 1 Go to right end, insert 1 Until no more $ remain
91
Courtesy Costas Busch - RPI91 Turing Machine for
92
Courtesy Costas Busch - RPI92 Example Start Finish
93
Courtesy Costas Busch - RPI93 Another Example The function is computable if
94
Courtesy Costas Busch - RPI94 Turing Machine for Input: Output: or if
95
Courtesy Costas Busch - RPI95 Turing Machine Pseudocode: Match a 1 from with a 1 from Repeat Until all of or is matched If a 1 from is not matched erase tape, write 1 else erase tape, write 0
96
Courtesy Costas Busch - RPI96 Combining Turing Machines
97
Courtesy Costas Busch - RPI97 Block Diagram Turing Machine inputoutput
98
Courtesy Costas Busch - RPI98 Example: if Comparer Adder Eraser
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.