Main

Turing Machines

The model, the universal machine, and the halting problem.

Last updated 27 June 2026

The model

A Turing machine is a tuple (Q,Γ,δ,q0,F)(Q, \Gamma, \delta, q_0, F): a finite set of states, a tape alphabet, a transition function

δ:Q×ΓQ×Γ×{L,R},\delta : Q \times \Gamma \to Q \times \Gamma \times \{L, R\},

an initial state, and accepting states. Despite its austerity, the model captures — by the Church–Turing thesis — everything we mean by effective computation.

Undecidability

The halting problem asks: given a machine MM and input ww, does MM halt on ww? Turing’s diagonal argument shows no machine decides this. Suppose HH decided halting; build DD that, on input M\langle M \rangle, runs H(M,M)H(M, \langle M \rangle) and does the opposite. Then

D(D) halts    D(D) does not halt,D(\langle D \rangle) \text{ halts} \iff D(\langle D \rangle) \text{ does not halt},

a contradiction. Rice’s theorem generalises: every non-trivial semantic property of programs is undecidable.

An interactive machine

The machine below computes binary increment: state scan walks right to the end of the input, then carry flips trailing 1s to 0s until it can write the carried 1. Try 111 to watch a full carry chain.

State Read Write Move Next
scan 0 or 1 same R scan
scan L carry
carry 1 0 L carry
carry 0 or ␣ 1 halt

The cost model here (one cell, one step) is what makes statements like those in Asymptotic Notation meaningful.

complexitylogic

← Back to Computability