CSC 392 · Automata Theory, Computability and Formal Languages
Our notes
2 min readThe Turing machine (Turing, 1936)
A finite control with a tape that is infinite in one direction (or both), divided into cells, and a head that can read, write and move left or right.
Formally M = (Q, Σ, Γ, δ, q₀, B, F) with δ: Q × Γ → Q × Γ × {L, R}. B is the blank symbol.
At each step: read the symbol under the head, write a symbol, move one cell, change state. The machine halts when no move is defined; it accepts if it halts in an accepting state.
Example: {aⁿbⁿcⁿ : n ≥ 1}
Idea: repeatedly cross off one a, one b and one c.
- Replace the leftmost a with X; move right to the first b, replace it with Y; move right to the first c, replace it with Z.
- Move back left to just after the last X; repeat.
- When no a is left, check that only Y's and Z's remain; then accept.
Trace aabbcc: after the first round the tape reads XaYbZc; after the second XXYYZZ; nothing is left unmatched: accepted. For aabbc, the second round finds no c: rejected. A PDA cannot do this; a Turing machine can.
Variants
Multi-tape machines, two-way infinite tapes, nondeterministic machines and machines with random access: all recognise exactly the same languages (they may differ in speed). This robustness suggests the model captures computation itself.
The Church-Turing thesis
Anything that can be computed by an effective procedure (an algorithm) can be computed by a Turing machine. It is a thesis, not a theorem (an "algorithm" has no formal definition outside the models), but every model proposed (Church's lambda calculus, 1936, register machines, modern computers) turns out equivalent. A modern computer is a Turing machine with a finite tape.
The universal Turing machine
A single machine U that reads the description of any machine M and its input w and simulates M on w. This is the stored-program computer in theory: programs are data.
The Chomsky hierarchy (1956)
| Type | Grammar rules | Languages | Machine |
|---|---|---|---|
| 3 | A → aB or A → a (right-linear) | regular | finite automaton |
| 2 | A → α | context-free | pushdown automaton |
| 1 | α → β, with β at least as long as α | context-sensitive | linear-bounded automaton |
| 0 | any α → β | recursively enumerable | Turing machine |
Each class is strictly larger than the one above: aⁿbⁿ is type 2 but not 3; aⁿbⁿcⁿ is type 1 but not 2.
Exams usually ask
- Define a Turing machine and describe how it computes.
- Design a Turing machine for a simple language and trace it.
- State the Church-Turing thesis; present the Chomsky hierarchy.
Common mistake
Thinking a more powerful machine is needed for each harder problem. Every reasonable extension of the Turing machine computes the same things; only speed and convenience change.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
No reading links here yet
Our team adds free books, videos and practice for each topic, and opens every link before it goes up.