GATE Computer ScienceHardGATE CS (PYQ pattern)
A TM (blank B, start q0 on the leftmost cell, halting state qa) has rules: δ(q0,1) = (q0,1,R); δ(q0,0) = (q1,1,R); δ(q1,1) = (q1,1,R); δ(q1,B) = (q2,B,L); δ(q2,1) = (qa,B,R). Started on 111011 (unary 3, a separator 0, unary 2), how many moves does it make before halting?
- A. 6
- B. 10
- C. 5
- D. 8
Correct answer: D. 8
It moves right over 3 ones, turns the 0 into 1, moves over the remaining 2 ones and the blank, steps back and erases the last 1: 8 moves, leaving 11111.
More Theory of Computation questions
- For the TM with rules δ(q0,1) = (q0,1,R); δ(q0,0) = (q1,1,R); δ(q1,1) = (q1,1,R); δ(q1,B) = (q2,B,L); δ(q2,1) = (qa,B,R) (start q0 on the…
- A TM with rules δ(q0,a) = (q1,X,R); δ(q0,Y) = (q3,Y,R); δ(q1,a) = (q1,a,R); δ(q1,Y) = (q1,Y,R); δ(q1,b) = (q2,Y,L); δ(q2,a) = (q2,a,L)…
- A single-tape TM (blank B, start q0 on the leftmost cell, accepting state qa) has rules: δ(q0,0) = (q1,B,R); δ(q0,1) = (q4,B,R); δ(q0,B) =…
- 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) =…
- The grammar S → aSBC | aBC; CB → BC; aB → ab; bB → bb; bC → bc; cC → cc generates { aⁿbⁿcⁿ : n ≥ 1 }. How many derivation steps does EVERY…
- Which of the following productions cannot appear in a context-sensitive (non-contracting) grammar?