GATE Computer ScienceVery hardGATE CS (PYQ pattern)
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); δ(q2,Z) = (q2,Z,R); δ(q2,c) = (q3,Z,L); δ(q3,a) = (q3,a,L); δ(q3,b) = (q3,b,L); δ(q3,Y) = (q3,Y,L); δ(q3,Z) = (q3,Z,L); δ(q3,X) = (q0,X,R); δ(q4,Y) = (q4,Y,R); δ(q4,Z) = (q4,Z,R); δ(q4,B) = (qa,B,R) starts in q0 on the leftmost cell of the input (blank = B) and accepts by reaching qa. How many moves does it make before accepting the input aabbcc?
- A. 19
- B. 26
- C. 23
- D. 12
Correct answer: C. 23
Each round marks one a, one b and one c (X, Y, Z) and returns to the left; two full rounds plus the final verification sweep take 23 moves by direct simulation.
More Theory of Computation questions
- 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…
- Which of the following statements about context-free languages are correct? I. The intersection of a CFL with a DCFL is always a CFL. II…
- Which of the following languages over {a, b, c} is NOT context-free?