Question: Let Sigma = { a , b } . What does the following TM do ? q 0 a b R q 0 q

Let \Sigma ={a,b}. What does the following TM do?
q0 a b R q0
q0 b a R q0
q0__ L q1
q1 a b L q1
q1 b a L q1
q1__ S halt-accept
Choice 1 of 4:It enters an infinite loop. Choice 2 of 4:It checks whether the string consists of alternating 'a's and 'b's. Choice 3 of 4:It moves right to the end of the string, switching a's to b's and b's to a's. It then moves to the start of the string switching them back, and then it accepts. Choice 4 of 4:It moves right to the end of the string and then moves to the start of the string, all the while not changing the string on the tape, and then it accepts.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!