Professional Documents
Culture Documents
Turing Machines
Objectives
Turing Machine
o Simple
o Computing
7-TUPLE
A Turing machine is a 7-tuple (Q, , , , q0, qaccept, qreject),
Q is a set of states
is a set of symbols (the alphabet)
is a set of symbols that can be written in tape,
q0 Q is the initial state
qaccept is the accepting state
qreject is the rejecting state, qrejectqaccept
GRAPHICAL REPRESENTATION OF TM
START
NaseerAhmed: Handout 23 -2- Theory of Automata and Formal Languages
STATE ‘S
HALT
EDGES
EXAMPLES:
Consider the following TM
(a,a,R) (b,b,R)
(b,b,R) (a,a,L)
2 3 4
(b,a,R)
1 1 1 1 0 1 ∆
0 1 1 1 0 1 ∆
0 0 1 1 0 1 ∆
0 0 0 1 0 1 ∆
0 0 0 0 0 1 ∆
0 0 0 0 1 1 ∆
So the successor’s output on 111101 was 000011 which is the reverse binary representation
of 48.
Sample Execution
Similarly, the successor of 127 should be 128:
If read 1, write 0, go right, repeat.
If read 0, write 1, HALT!
If read ∆ •, write 1, HALT!
1 1 1 1 1 1 1 ∆
0 1 1 1 1 1 1 ∆
NaseerAhmed: Handout 23 -4- Theory of Automata and Formal Languages
0 0 1 1 1 1 1 ∆
0 0 0 1 1 1 1
0 0 0 0 1 1 1 ∆
0 0 0 0 0 1 1 ∆
0 0 0 0 0 0 1 ∆
0 0 0 0 0 0 0 ∆
0 0 0 0 0 0 0 1
TM for Complement(inverse)
TM for (a+b)b(a+b)*
TM of Palindrome
NaseerAhmed: Handout 23 -6- Theory of Automata and Formal Languages
1, L
1. Increment Machine :
0 0, R
1 1, R 1 0, L
$ 1, R
$ $, R , L 0 1, R
Decrement Machine:
NaseerAhmed: Handout 23 -7- Theory of Automata and Formal Languages
0 0, R
1 1, R 0 1, L
$ $, R , L 1 0, R