4.DESIGNING OF TURING Machine

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

DESIGNING OF TURING MACHINE

IN
THEORY OF COMPUTATION
B.TECH IV SEMESTER

Nisha Vasudeva
Assistant Professor
Department of Computer Science Engineering & Information Technology
Arya College of Engineering & I.T.
DESIGN OF TURING MACHINES
 We now give the basic guidelines for designing a Turing
machine.
(i) The fundamental objective in scanning a symbol by the RJW
head is to 'know’ what to do in the future. The machine must
remember the past symbols scanned. The Turing machine can
remember this by going to the next unique state.
(ii) The number of states must be minimized. This can be
achieved by changing the states only when there is a change in
the written symbol or when there is a change in the movement of
the R/W head. We shall explain the design by a simple example.
Arya College of Engg. & I.T 2
EXAMPLE: L = {0N1N | N≥1}
 Strategy: w = 000111

B B 0 0 0 1 1 1 B B … B B X X 0 Y Y 1 B B …
… …

… B B X 0 0 1 1 1 B B … B B X X X Y Y 1 B B …
… …
… B B X 0 0 Y 1 1 B B … B B X X X Y Y Y B B …

… B B X X 0 Y 1 1 B B …
B B X X X Y Y Y B B …

Accept 3
Arya College of Engg. & I.T
TM FOR {0N1N | N≥1}
Y / Y,R 1. Mark next unread 0 with X and
0 / 0,R move right
2. Move to the right all the way to
0 / X,R the first unread 1, and mark it
q0 q1 with Y
3. Move back (to the left) all the
Y / Y,R 1 / Y,L way to the last marked X, and
then move one position to the
X / X,R right
q2
q3 4. If the next position is 0, then
Y / Y,R goto step 1.
Y / Y,L Else move all the way to the right
B / B,R to ensure there are no excess 1s.
0 / 0,L If not move right to the next
q4
blank symbol and stop & accept.

Arya College of Engg. & I.T 4


*state diagram representation preferred

TM FOR {0N1N | N≥1}


Next Tape Symbol

Curr. 0 1 X Y B
State
q0 (q1,X,R) - - (q3,Y,R) -

q1 (q1,0,R) (q2,Y,L) - (q1,Y,R) -

q2 (q2,0,L) - (q0,X,R) (q2,Y,L) -

q3 - - - (q3,Y,R) (q4,B,R)

*q4 - -- - - -

Table representation of the state diagram


5
Arya College of Engg. & I.T
DESIGN A TURING MACHINE TO RECOGNIZE ALL STRINGS CONSISTING OF AN
EVEN NUMBER OF 1'S.

6
Arya College of Engg. & I.T
EXAMPLE

7
Arya College of Engg. & I.T
 We observe that the main task is to remove the
symbol b. This can be done in the following
manner:
(a) The separating symbol b is found and replaced
by 1
(b) The rightmost 1 is found and replaced by a
blank b.
(c) The R/W head returns to the starting position.

8
Arya College of Engg. & I.T
9
Arya College of Engg. & I.T
THANK YOU

Arya College of Engg. & I.T 10

You might also like