GATE Computer ScienceHardGATE CS (PYQ pattern)
A single-tape TM with blank B starts in q0 on the leftmost cell of the input 10111. Its rules (state, symbol) → (state, write, move) are: δ(q0,0) = (q0,0,R); δ(q0,1) = (q0,1,R); δ(q0,B) = (q1,B,L); δ(q1,1) = (q1,0,L); δ(q1,0) = (qa,1,L); δ(q1,B) = (qa,1,L). It halts in qa. How many moves does it make on this input?
- A. 9
- B. 10
- C. 11
- D. 5
Correct answer: B. 10
It scans right across 5 cells and the blank (6 moves), then adds 1 by turning the three trailing 1s into 0s and the next 0 into 1 (4 moves): 10 moves, leaving 11000.
More Theory of Computation questions
- A TM (blank B, start q0 on the leftmost input cell, halting state qa) has rules δ(q0,0) = (q0,0,R); δ(q0,1) = (q0,1,R); δ(q0,B) =…
- A TM with rules δ(q0,a) = (q1,X,R); δ(q0,Y) = (q4,Y,R); δ(q1,a) = (q1,a,R); δ(q1,Y) = (q1,Y,R); δ(q1,b) = (q2,Y,R); δ(q2,b) = (q2,b,R)…
- A TM over {0, 1} (blank B, start q0 on the leftmost cell, accepts at qa, rejects by having no applicable rule) has rules: δ(q0,X) =…
- For the same TM with rules δ(q0,X) = (q0,X,R); δ(q0,0) = (q1,X,R); δ(q0,1) = (q2,X,R); δ(q0,B) = (qa,B,R); δ(q1,0) = (q1,0,R); δ(q1,X) =…
- L₁ is context-free, L₂ is regular and L₃ is deterministic context-free (all over the same alphabet Σ, complements taken w.r.t. Σ). Which…
- Which of the following statements about deterministic context-free languages (DCFLs) are correct? I. The complement of a DCFL is a DCFL…