GATE Computer ScienceVery hardGATE CS (PYQ pattern)

For the palindrome-checking TM with rules δ(q0,0) = (q1,B,R); δ(q0,1) = (q4,B,R); δ(q0,B) = (qa,B,R); δ(q1,0) = (q1,0,R); δ(q1,1) = (q1,1,R); δ(q1,B) = (q2,B,L); δ(q2,0) = (q3,B,L); δ(q2,B) = (qa,B,R); δ(q3,0) = (q3,0,L); δ(q3,1) = (q3,1,L); δ(q3,B) = (q0,B,R); δ(q4,0) = (q4,0,R); δ(q4,1) = (q4,1,R); δ(q4,B) = (q5,B,L); δ(q5,1) = (q3,B,L); δ(q5,B) = (qa,B,R) (start q0 on the leftmost cell), what is the number of moves it takes to accept the input 010010?

  1. A. 21
  2. B. 37
  3. C. 25
  4. D. 28

Correct answer: D. 28

Three rounds of 'erase the left symbol, run right, erase the matching right symbol, run back' cost about 2k moves each for shrinking length k; simulation gives 28 moves in total.

More Theory of Computation questions

Exams that ask this topic