- 2070 Chaitra
TM configuration; TM for palindromes
Short answer
A configuration records state, tape, and head position, like u q a v. The TM for palindromes erases first symbol, moves to last to check equality, erases it, repeats, and accepts if empty or one symbol remains.
Define the term configuration of a Turing machine. Design a Turing machine which accepts the set of all palindromes over the alphabet {0,1}*.
Configuration of a Turing machine
A configuration (instantaneous description) records everything needed to continue a computation: the current state, the tape contents, and the head position. It is written as a triple (q, u, a v) or as the string u q a v, where q is the state, u the tape contents to the left of the head, and a v the contents from the scanned symbol a onward (trailing blanks omitted). One move gives the relation ⊢. The start configuration for input w is q0 w, and w is accepted if q0 w ⊢* (a configuration in an accepting state).
Example: the configuration 10 q2 1 means the tape holds 101 with the head on the last symbol, in state q2.
TM for palindromes over {0,1}
Idea. Erase the first symbol, remember it, go to the last symbol, and check it equals the remembered one; erase it and repeat. If the string becomes empty (even length) or exactly one symbol is left (odd length), accept; otherwise reject.
States: q0 start; q1 / q3 go right remembering 0 / 1; q2 / q4 check the last symbol; q5 return left; qa accept.
| State | Read | Write | Move | Next |
|---|---|---|---|---|
| q0 | ⊔ | same | S | qa |
| q0 | 0 | ⊔ | R | q1 |
| q0 | 1 | ⊔ | R | q3 |
| q1 | 0 / 1 | same | R | q1 |
| q1 | ⊔ | same | L | q2 |
| q3 | 0 / 1 | same | R | q3 |
| q3 | ⊔ | same | L | q4 |
| q2 | 0 | ⊔ | L | q5 |
| q4 | 1 | ⊔ | L | q5 |
| q5 | 0 / 1 | same | L | q5 |
| q5 | ⊔ | same | R | q0 |
| q2 | ⊔ | same | S | qa |
| q4 | ⊔ | same | S | qa |
The only difference from the wwᴿ machine is the two rules q2/q4 on ⊔, which accept when the middle symbol of an odd palindrome is left alone.
Examples
- 010: q0 erases 0 and goes right; the last symbol 0 matches and is erased; q0 now reads 1, erases it, finds nothing to the right, and q4 reads ⊔, so it accepts.
- 0110: two rounds of matching 0-0 and 1-1, then q0 reads ⊔ and accepts.
- 01: the last symbol is 1 but 0 was remembered; no move exists, so it halts without accepting.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- PDA for palindromes over {a,b} · Theory of Computation, chapter 3
- Multitape TM as copying machine · Theory of Computation, chapter 4
- TM for aⁿcbⁿ (single tape, deterministic) · Theory of Computation, chapter 4
- Define multitape Turing machine · Theory of Computation, chapter 4
- What is a Turing machine; its operation · Theory of Computation, chapter 4
- How a universal Turing machine works · Theory of Computation, chapter 5
- Taper turning: set-over and compound angle · Workshop Technology, chapter 6
- AI, Turing test, CSP examples · Artificial Intelligence, chapter 1
- Six-speed machine tool gearbox design · Machine Design II, chapter 5
- Initial line design for 200 MW over 120 km · Transmission and Distribution System Design, chapter 2