0

Can anyone tell me whether my answer is right or not for this example of Turing Machine??

Q. Construct Turing Machine for L={ anbncn / n>=1 }

Ans: Transition function for string aabbcc

^(q1,a)=(X,q2,R)
^(q2,a)=(a,q2,R)
^(q2,b)=(Y,q3,R)
^(q3,b)=(b,q3,R)
^(q3,c)=(Z,q4,L)
^(q4,b)=(b,q4,L)
^(q4,Y)=(Y,q4,L)
^(q4,a)=(a,q4,L)
^(q4,X)=(X,q1,R)
^(q1,a)=(X,q2,R)
^(q2,Y)=(Y,q2,R)
^(q2,b)=(Y,q3,R)
^(q3,Z)=(Z,q3,R)
^(q3,c)=(Z,q4,L)
^(q4,Z)=(Z,q4,L)
^(q4,Y)=(Y,q4,L)
^(q4,Y)=(Y,q4,L)
^(q4,X)=(X,q1,R)
^(q1,Y)=(Y,q2,R)
^(q2,Y)=(Y,q2,R)
^(q2,Z)=(Z,q2,R)
^(q2,Z)=(Z,q2,R)
^(q2,B)=(B,q5,N)

Can anyone tell me whether its correct or not?? Or should I have to make changes in it??

1 Answers1

0

It seems correct The idea is: Turn the first a to X, then go right to find the first b, turn it to Y, go right to find the first c, turn it to Z, get back to the first a again. The process goes on until the first letter under the head is Y instead of a. It means that all a's have been matched with b's and c's. The head then needs to go right, passes Y's and Z's till it reaches a blank.

Hassan Abbasi
  • 272
  • 1
  • 3