UNIHIVE

Study Hub UNIPORT CSC 396

CSC 396 · Automata theory, Computability and Formal Languages

Turing machines and the Chomsky hierarchy

The Turing machine model, a machine for aⁿbⁿcⁿ, the Church-Turing thesis, and the four levels of grammars and machines.

Our notes

2 min read

The 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.

  1. 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.
  2. Move back left to just after the last X; repeat.
  3. 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)

TypeGrammar rulesLanguagesMachine
3A → aB or A → a (right-linear)regularfinite automaton
2A → αcontext-freepushdown automaton
1α → β, with β at least as long as αcontext-sensitivelinear-bounded automaton
0any α → βrecursively enumerableTuring 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.

All CSC 396 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.