![Page 1: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/1.jpg)
1
Introduction toTuring Machines
0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 010
![Page 2: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/2.jpg)
Alan Turing -- 1912 – 1954 • Mathematician, a computer scientis
• Influantial • Development of computer sciences• provided an influential formalisation
• of the concept of the algorithm • and computation with the• Turing Machine • Turing Test contribute to the debate of AI
• Can machines think?
• One of the 100 more imp. People in 20th century• 21st on BBC nation wide poll of the 100 Greatest britons• http://www.turing.org.uk/turing/• http://en.wikipedia.org/wiki/Alan_Turing/
2
![Page 3: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/3.jpg)
3
The Turing Machine
0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 0 0 0101
A TM consists of an infinite length tape, on which input is provided as a finite sequence of symbols.
A head reads the input tape. The TM starts at start state s0. On reading an input symbol it optionally replaces it with another symbol, changes its internal state and moves one cell to the right or left.
![Page 4: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/4.jpg)
4
The Turing Machine
A TM is defined as: TM = <S, T, s0, , H> where,
S is a set of TM states T is a set of tape symbols s0 is the start state H S is a set of halting states : S x T S x T x {L,R}
is the transition function
![Page 5: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/5.jpg)
5
A Turing Machine
............Tape
Read-Write head
Control Unit
![Page 6: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/6.jpg)
6
The Tape
............
Read-Write head
No boundaries -- infinite length
The head moves Left or Right
![Page 7: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/7.jpg)
7
............
Read-Write head
The head at each time step:
1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right
![Page 8: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/8.jpg)
8
............
Example:Time 0
Time 1
1. Reads
2. Writes
a a cb
a
3. Moves Left
............ a b cd
d
![Page 9: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/9.jpg)
9
............Time 1
a c
............Time 2
a c
1. Reads
2. Writes
3. Moves Right
b
s
s
b
f
f
![Page 10: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/10.jpg)
10
The Input String
............
Blank symbol
head
a b ca
•Head starts at the leftmost position of the input string.•The input string is never empty
Input string
# # # # #
![Page 11: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/11.jpg)
11
States & Transitions
1q 2qLba ,
Read Write Move Left
1q 2qRba ,
Move Right
![Page 12: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/12.jpg)
12
............ a b cTime 1
1q 2q
............ a b cTime 2
1q
2q
Example:
current state
a
d
Rda ,
![Page 13: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/13.jpg)
13
............ a b cTime 1
1q 2qLba ,
............ a b cTime 2
1q
2q
Example:
a
b
![Page 14: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/14.jpg)
14
............ a b caTime 1
1q 2q
............ ga b cbTime 2
1q
2q
Example:
Lg,
# # # #
# # #
![Page 15: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/15.jpg)
15
Determinism
1q
2qRba ,
Allowed Not Allowed
3qLdb ,
1q
2qRba ,
3qLda ,
No lambda transitions allowed
Turing Machines are deterministic
![Page 16: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/16.jpg)
16
Partial Transition Function
1q
2qRba ,
3qLdb ,
Example:
No transitionfor input symbol c
Allowed:
# #
1q
............ a b ca # # #
![Page 17: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/17.jpg)
17
Halting
The machine halts if there areno possible transitions to follow
# #
1q
............ a b c # # #
1q
2qRba ,
3qLdb ,
c
No possible transition
HALT!!!
![Page 18: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/18.jpg)
18
Final States
1q 2q Allowed
1q 2q Not Allowed
• Final states have no outgoing transitions• In a final state the machine halts
![Page 19: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/19.jpg)
19
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
![Page 20: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/20.jpg)
20
Turing Machine Example
A Turing machine that accepts the language:
*aa
0q
Raa ,
L,1q
![Page 21: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/21.jpg)
21
aaTime 0
0q
a
0q
Raa ,
L,1q
![Page 22: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/22.jpg)
22
aaTime 1
0q
a
0q
Raa ,
L,1q
![Page 23: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/23.jpg)
23
aaTime 2
0q
a
0q
Raa ,
L,1q
![Page 24: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/24.jpg)
24
aaTime 3
0q
a
0q
Raa ,
L,1q
![Page 25: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/25.jpg)
25
aaTime 4
1q
a
0q
Raa ,
L,1q
Halt & Accept
![Page 26: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/26.jpg)
26
Rejection Example
0q
Raa ,
L,1q
baTime 0
0q
a
![Page 27: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/27.jpg)
27
0q
Raa ,
L,1q
baTime 1
0q
a
No possible Transition
Halt & Reject
![Page 28: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/28.jpg)
28
Infinite Loop Example
0q
Raa ,
L,1q
Lbb ,
A Turing machine for language *)(* babaa
![Page 29: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/29.jpg)
29
baTime 0
0q
a
0q
Raa ,
L,1q
Lbb ,
![Page 30: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/30.jpg)
30
baTime 1
0q
a
0q
Raa ,
L,1q
Lbb ,
![Page 31: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/31.jpg)
31
baTime 2
0q
a
0q
Raa ,
L,1q
Lbb ,
![Page 32: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/32.jpg)
32
baTime 2
0q
a
baTime 3
0q
a
baTime 4
0q
a
baTime 5
0q
a
Infinite
loop
![Page 33: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/33.jpg)
33
Because of the infinite loop:
•The final state cannot be reached
•The machine never halts
•The input is not accepted
![Page 34: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/34.jpg)
34
Another Turing Machine Example
Turing machine for the language }{ nnba
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
![Page 35: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/35.jpg)
35
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
ba
0q
a bTime 0
![Page 36: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/36.jpg)
36
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
bx
1q
a b Time 1
![Page 37: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/37.jpg)
37
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
bx
1q
a b Time 2
![Page 38: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/38.jpg)
38
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
2q
a b Time 3
![Page 39: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/39.jpg)
39
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
2q
a b Time 4
![Page 40: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/40.jpg)
40
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
0q
a b Time 5
![Page 41: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/41.jpg)
41
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
1q
x b Time 6
![Page 42: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/42.jpg)
42
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
1q
x b Time 7
![Page 43: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/43.jpg)
43
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx x y
2q
Time 8
![Page 44: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/44.jpg)
44
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx x y
2q
Time 9
![Page 45: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/45.jpg)
45
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
0q
x y Time 10
![Page 46: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/46.jpg)
46
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
3q
x y Time 11
![Page 47: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/47.jpg)
47
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
3q
x y Time 12
![Page 48: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/48.jpg)
48
0q 1q 2q3qRxa ,
Raa ,Ryy ,
Lyb ,
Laa ,Lyy ,
Rxx ,
Ryy ,
Ryy ,4q
L,
yx
4q
x y
Halt & Accept
Time 13
![Page 49: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/49.jpg)
49
If we modify the machine for the language }{ nnba
we can easily construct a machine for the language }{ nnn cba
Observation:
![Page 50: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/50.jpg)
50
Formal Definitionsfor
Turing Machines
![Page 51: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/51.jpg)
51
Transition Function
1q 2qRba ,
),,(),( 21 Rbqaq
![Page 52: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/52.jpg)
52
1q 2qLdc ,
),,(),( 21 Ldqcq
Transition Function
![Page 53: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/53.jpg)
53
Turing Machine:
),,,,,,( 0 FqQM
States
Inputalphabet
Tapealphabet
Transitionfunction
Initialstate
blank
Finalstates
![Page 54: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/54.jpg)
54
Configuration
ba
1q
a
Instantaneous description:
c
baqca 1
![Page 55: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/55.jpg)
55
yx
2q
a b
Time 4
yx
0q
a b
Time 5
A Move: aybqxxaybq 02
![Page 56: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/56.jpg)
56
yx
2q
a b
Time 4
yx
0q
a b
Time 5
bqxxyybqxxaybqxxaybq 1102
yx
1q
x b
Time 6
yx
1q
x b
Time 7
![Page 57: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/57.jpg)
57
bqxxyybqxxaybqxxaybq 1102
bqxxyxaybq 12
Equivalent notation:
![Page 58: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/58.jpg)
58
Initial configuration: wq0
ba
0q
a b
w
Input string
![Page 59: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/59.jpg)
59
The Accepted Language
For any Turing Machine M
}:{)( 210 xqxwqwML f
Initial state Final state
![Page 60: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/60.jpg)
60
Standard Turing Machine
• Deterministic
• Infinite tape in both directions
•Tape is the input/output file
The machine we described is the standard:
![Page 61: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/61.jpg)
61
Computing Functionswith
Turing Machines
![Page 62: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/62.jpg)
62
A function )(wf
Domain: Result Region:
has:
D
Dw
S
Swf )()(wf
![Page 63: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/63.jpg)
63
A function may have many parameters:
yxyxf ),(
Example: Addition function
![Page 64: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/64.jpg)
64
Integer Domain
Unary:
Binary:
Decimal:
11111
101
5
We prefer unary representation:
easier to manipulate with Turing machines
![Page 65: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/65.jpg)
65
Definition:
A function is computable ifthere is a Turing Machine such that:
fM
Initial configuration Final configuration
Dw Domain
0q
w
fq
)(wf
final stateinitial state
For all
![Page 66: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/66.jpg)
66
)(0 wfqwq f
Initial Configuration
FinalConfiguration
A function is computable ifthere is a Turing Machine such that:
fM
In other words:
Dw DomainFor all
![Page 67: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/67.jpg)
67
Example
The function yxyxf ),( is computable
Turing Machine:
Input string: yx0 unary
Output string: 0xy unary
yx, are integers
![Page 68: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/68.jpg)
68
0
0q
1 1 1 1
x y
1 Start
initial state
The 0 is the delimiter that separates the two numbers
![Page 69: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/69.jpg)
69
0
0q
1 1 1 1
x y
1
0
fq
1 1
yx
11
Start
Finish
final state
initial state
![Page 70: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/70.jpg)
70
0
fq
1 1
yx
11Finish
final state
The 0 helps when we usethe result for other operations
![Page 71: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/71.jpg)
71
0q
Turing machine for function
1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
yxyxf ),(
![Page 72: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/72.jpg)
72
Execution Example:
11x
11y 0
0q
1 1 1 1
Time 0
x y
Final Result
0
4q
1 1 1 1
yx
(2)
(2)
![Page 73: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/73.jpg)
73
0
0q
1 1Time 0
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
1 1
![Page 74: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/74.jpg)
74
0q
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
01 11 1Time 1
![Page 75: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/75.jpg)
75
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
0
0q
1 1 1 1Time 2
![Page 76: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/76.jpg)
76
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
1q
1 11 11Time 3
![Page 77: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/77.jpg)
77
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
1q
1 1 1 11Time 4
![Page 78: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/78.jpg)
78
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
1q
1 11 11Time 5
![Page 79: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/79.jpg)
79
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
2q
1 1 1 11Time 6
![Page 80: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/80.jpg)
80
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
3q
1 11 01Time 7
![Page 81: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/81.jpg)
81
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
3q
1 1 1 01Time 8
![Page 82: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/82.jpg)
82
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
3q
1 11 01Time 9
![Page 83: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/83.jpg)
83
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
3q
1 1 1 01Time 10
![Page 84: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/84.jpg)
84
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
3q
1 11 01Time 11
![Page 85: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/85.jpg)
85
0q 1q 2q 3qL, L,01
L,11
R,
R,10
R,11
4q
R,11
4q
1 1 1 01
HALT & accept
Time 12
![Page 86: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/86.jpg)
86
Another Example
The function xxf 2)( is computable
Turing Machine:
Input string: x unary
Output string: xx unary
x is integer
![Page 87: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/87.jpg)
87
0q
1 1
x
1
1
fq
1 1
x2
11
Start
Finish
final state
initial state
![Page 88: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/88.jpg)
88
Turing Machine Pseudocode for xxf 2)(
• Replace every 1 with $
• Repeat:
• Find rightmost $, replace it with 1
• Go to right end, insert 1
Until no more $ remain
![Page 89: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/89.jpg)
89
0q 1q 2q
3q
R,1$
L,1
L,
R$,1 L,11 R,11
R,
Turing Machine for xxf 2)(
![Page 90: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/90.jpg)
90
0q 1q 2q
3q
R,1$
L,1
L,
R$,1 L,11 R,11
R,
Example
0q
1 1
3q
1 11 1
Start Finish
![Page 91: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/91.jpg)
91
Simple TM Examples
Turing Machine U+1:
Given a string of 1s on a tape (followed by an infinite number of 0s), add one more 1 at the end of the string.
#111100000000……. #1111100000000……….
![Page 92: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/92.jpg)
92
Simple TM Examples
TM: U+1(s0, 1) |-- (s0, 1, R) (s0, 0) |-- (h, 1, STOP)
#s0111100000….. #1s011100000….. #11s01100000….. #111s0100000….. #1111s000000….. #11111h0000….. STOP
![Page 93: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/93.jpg)
93
Another Example
The function ),( yxf
is computable0
1 yx
yx
if
if
![Page 94: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/94.jpg)
94
Turing Machine for
Input: yx0
Output: 1 0or
),( yxf0
1 yx
yx
if
if
![Page 95: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/95.jpg)
95
Turing Machine Pseudocode:
Match a 1 from with a 1 from x y
• Repeat
Until all of or is matchedx y
• If a 1 from is not matched erase tape, write 1 else erase tape, write 0
x)( yx
)( yx
![Page 96: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/96.jpg)
96
Combining Turing Machines
![Page 97: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/97.jpg)
97
Block Diagram
TuringMachine
input output
![Page 98: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/98.jpg)
98
Example:
),( yxf0
yx yx
yx
if
if
Comparer
Adder
Eraser
yx,
yx,
yx
yx
yx
0
![Page 99: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/99.jpg)
99
Turing’s Thesis
Any mathematical problem solving that can be described by a mechanical procedure (algorithm) can be modeled by a Turing machine.
All computers today perform only mechanical problem solving. They are no more expressive than a Turing machine.
![Page 100: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/100.jpg)
100
Turing’s ThesisTuring’s thesis is not a “theorem” there is no
“proof” for the thesis.The theorem may be refuted by showing at
least one task that is performed by a digital computer which cannot be performed by a Turing machine.
Many contentions have been made to this end. However, till date there have not been any conclusive evidence to refute Turing’s thesis.
![Page 101: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/101.jpg)
101
ConclusionsTMs are at a level that is much below the
assembly language of any typical microprocessor.
So in the practical world, TMs are more useful in what they cannot do rather than in what they can.
![Page 102: 1 Introduction to Turing Machines 011011111101101100010](https://reader036.vdocuments.us/reader036/viewer/2022081417/5515c83455034693758b49a5/html5/thumbnails/102.jpg)
Lab2Write some simpleTuring machine
programs
QUESTIONS?
102