Computation and Turing Machines · v2.0.5
2026-09-20 23:10:27
No formal language theory is assumed: no automata, no grammars, no language classes.
The three pull against each other.
The model is derived, not invented.
Four requirements, met by three components.

Tape, head, and finite control.
| Requirement | Component |
|---|---|
| storage for symbols | tape |
| reading and writing one cell | tape head |
| what to do next | transition function |
| Operation | Explanation |
|---|---|
| Write | (Optionally) writes a new symbol at the current tape position |
| Move | (Optionally) moves either left or right |
| Think | (Optionally) changes to a new state |
Everything in the rest of this unit is built from those three.
\[M = (Q, \Sigma, \Gamma, \delta, q_0, H)\]
\[\delta : (Q - H) \times \Gamma \to Q \times (\Gamma \cup \{\leftarrow, \rightarrow\})\]
The domain
The codomain
Marks the machine writes to remember what it has already dealt with. Every machine below uses them.
One further condition on \(\delta\), rather than part of its type:
A configuration records the current state, the head position, and the tape contents.
\[(q_4,\; \triangleright\;b\;\underline{\color{red}{b}}\;b\;\square)\]
The underlined red cell is the one the head is on.
A computation is a sequence of successive configurations, related by \(\vdash_M\):
\[C_0 \vdash_M C_1 \vdash_M C_2 \vdash_M C_3 \vdash_M C_4 \vdash_M C_5\]
| Time | State | Tape |
|---|---|---|
| 0 | \(q_0\) | \(\underline{\color{red}{\triangleright}}\;b\;b\;b\;\square\;\cdots\) |
| 1 | \(q_1\) | \(\triangleright\;\underline{\color{red}{b}}\;b\;b\;\square\;\cdots\) |
| 2 | \(q_4\) | \(\triangleright\;b\;\underline{\color{red}{b}}\;b\;\square\;\cdots\) |
| 3 | \(q_4\) | \(\triangleright\;b\;b\;\underline{\color{red}{b}}\;\square\;\cdots\) |
| 4 | \(q_4\) | \(\triangleright\;b\;b\;b\;\underline{\color{red}{\square}}\;\cdots\) |
| 5 | \(q_{\text{rej}}\) | \(\triangleright\;b\;b\;b\;\underline{\color{red}{\square}}\;\cdots\) |
The head does not move on the final step: \(\delta\) is undefined there, which is the rejection.
Tracing one configuration per line is how a machine’s actual behaviour becomes visible.
A machine may reach \(q_{\text{acc}}\) before the head has visited the whole input.
| \(\triangleright\) | \(a\) | \(\square\) | |
|---|---|---|---|
| \(q_0\) | \((q_0, \rightarrow)\) | \((q_1, \square)\) | \((q_h, \square)\) |
| \(q_1\) | — | \((q_0, a)\) | \((q_0, \rightarrow)\) |
Two states suffice: \(q_0\) writes a blank, \(q_1\) steps right, and back again.
Copy a string from \(L = \Sigma^*\), where \(\Sigma = \{a, b\}\).
\[\Gamma = \Sigma \cup \{\triangleright, \square, \#, 1, 2\}\]

| Time | State | Tape |
|---|---|---|
| 10 | \(q_3\) | \(\triangleright\;\underline{\color{red}{b}}\;b\;a\;\#\;\square\;\cdots\) |
| 11 | \(q_5\) | \(\triangleright\;\underline{\color{red}{2}}\;b\;a\;\#\;\square\;\cdots\) |
| 16 | \(q_6\) | \(\triangleright\;2\;b\;a\;\#\;\underline{\color{red}{b}}\;\cdots\) |
| 21 | \(q_7\) | \(\triangleright\;\underline{\color{red}{b}}\;b\;a\;\#\;b\;\cdots\) |
| 22 | \(q_3\) | \(\triangleright\;b\;\underline{\color{red}{b}}\;a\;\#\;b\;\cdots\) |
Mark, carry across, restore, advance. The whole run takes 47 steps.
Every multi-pass machine has this shape.
\[L = \{\text{strings containing } ab \text{ or ending with } ba\}\]

On \(aabbbbb\), the machine reaches \(q_3\) after reading \(aab\) and accepts on the next step.
\[L = \{a^n b^n c^n \mid n \geq 1\}\]
The counting has to happen on the tape.

\[\Gamma = \Sigma \cup \{\triangleright, \square, x, y, z\}\]
The same technique as the copying machine, applied to a harder problem.
A Universal Turing Machine \(U\) simulates the execution of any machine \(M\) on any input \(w\).
\[U(\langle M, w \rangle)\]
A Turing machine is a finite object: finitely many states, a finite alphabet, a finite transition table.
Universality is bought with the unbounded rewritable tape; not every model has it.
Compiler self-hosting and bootstrapping.
\(U\) simulates. It does not decide.
Algorithms and the Limits of Computation — the next unit in this module.