GATE Computer ScienceHardGATE CS
A single-tape Turing machine has blank B and starts in q0 on the leftmost cell of a binary numeral (MSB at the left). Rules: δ(q0,0) = (q0,0,R); δ(q0,1) = (q0,1,R); δ(q0,B) = (q1,B,L); δ(q1,1) = (q1,0,L); δ(q1,0) = (qa,1,R); δ(q1,B) = (qa,1,R). qa is the halting state. How many moves does the machine make on the input 10011111 before halting?
- A. 15
- B. 16
- C. 13
- D. 14
Correct answer: A. 15
The head moves right over 8 symbols (8 moves), turns at the blank (1 move), flips the five trailing 1s to 0 (5 moves) and finally writes 1 over the 0 (1 move): 8 + 1 + 5 + 1 = 15. The machine is a binary incrementer; the result is 10100000.
More Theory of Computation questions
- For a Turing machine M (given by its encoding ⟨M⟩) consider these sets: I. { ⟨M⟩ : M has at least 481 states } II. { ⟨M⟩ : L(M) contains…
- Which of the following languages are deterministic context-free? I. { aⁱbʲcᵏ : i = j or j = k } II. { aⁱbʲcᵏ : i = j, k ≥ 0 } III. { w c…
- Let L = { aⁿ : n ≥ 5 and (n is divisible by 4 or n is divisible by 6) }. How many states does the minimal complete DFA for L have?
- Which one of the following languages over the one-letter alphabet {a} is NOT context-free?
- How many strings of length 12 over {a, b} contain exactly three occurrences of aa as a substring (overlapping occurrences counted…
- L₁ is accepted by a minimal complete DFA with 4 states and L₂ by a minimal complete DFA with 3 states. What is the largest number of…