Skip to content
ISEGORIABenjamin Haire

ISEGORIA / MATH ENCYCLOPEDIA

Logic and computability: what can be computed

Turing machines, the diagonal argument behind the halting problem, and Gödel numbering.

Before you begin: Set theory and discrete mathematics

Predict, manipulate, then check your reasoning against the example and question. Graphs illustrate the mathematics; they do not replace a proof.

1. Stepping through a Turing machine

A head reads one cell, consults a finite table, writes, moves one cell and changes state. That is all. Choose a machine and scrub through its run; the space-time diagram below stacks every tape, so the whole computation is visible at once.

Worked example. The four-state busy beaver starts on a blank tape, halts after 107 steps and leaves 13 ones, the most any halting four-state, two-symbol machine can leave.

Watch out. Each table here is fixed and finite. What makes the model universal is that one fixed machine can read another machine’s table from its tape and simulate it.

Why can nobody compute the busy beaver function in general?

A program that computed it would bound every halting run and so would decide the halting problem.

Reference: Stanford Encyclopedia of Philosophy · Turing Machines

2. The diagonal argument

Suppose some program H could tell, for every program i and input j, whether i halts on j. Then build D: on input i, D does the opposite of what the table says program i does on i. D differs from every row on the diagonal, so D is not in the table, although the table was meant to list every program. Click cells to change the table: the contradiction survives every choice.

Worked example. If \(D\) were program number \(d\), the entry \(H(d,d)\) would have to equal its own opposite.

Watch out. The table shown is hypothetical: its entries are chosen by you or by a seed, not computed. The argument is about any table, which is the point.

Which assumption does the contradiction refute?

That H exists as a program that always halts with the right answer.

Reference: Stanford Encyclopedia of Philosophy · Computability and Complexity

3. Gödel numbering

Give each symbol a code and turn a formula into one number: the k-th prime raised to the code of the k-th symbol. Unique factorisation means the number can be decoded, so statements about formulas become statements about numbers. Build your own formula from the palette.

Worked example. With the codes shown, \(\ulcorner 0=0\urcorner=2^{6}\cdot3^{5}\cdot5^{6}=243{,}000{,}000\).

Watch out. The particular codes are a convention. What matters is that coding and decoding are mechanical, so provability becomes an arithmetical property.

Why use primes rather than just writing the codes side by side?

The product is a single natural number that arithmetic can talk about, and unique factorisation guarantees it decodes to exactly one sequence.

Reference: Stanford Encyclopedia of Philosophy · Gödel’s Incompleteness Theorems

Continue exploring

Linear algebra: the geometry of transformationsFourier analysis: functions made of wavesDynamical systems: stability and chaosOptimization: the geometry of the best choiceProbability: learning from uncertaintyGroup theory: symmetry as algebraAlgebraic topology: detecting holesNumerical analysis: when computation misleadsNumber theory: patterns in the integersGraph theory: routes, trees, and networksPartial differential equations: fields in motionInformation theory: uncertainty and codesCalculus of variations: paths and principlesClassical mechanics: motion and forcesElectromagnetism: fields and inductionOptics: rays, waves, and colourThermodynamics: energy, work, and entropyQuantum mechanics: amplitudes and spinComplex analysis: maps, residues, and harmonic fieldsFluid dynamics: flow, pressure, and vorticityStatistics and inference: signals in dataSpecial relativity: space, time, and lightDifferential geometry: curvature and shapeStatistical mechanics: microstates and temperatureMeasure theory: size, approximation, and convergenceMarkov chains: transition, stationarity, and absorptionDifferential forms: circulation, curl, and pullbacksGeneral relativity: curvature, clocks, and lightFunctional analysis: norms, projections, and operatorsPlasma physics: screening, orbits, and wavesLie groups and Lie algebras: continuous symmetryHamiltonian mechanics: phase space and its geometryStochastic processes: Brownian motion and noiseSolid-state physics: waves in a crystalControl theory: feedback, poles, and stabilityHyperbolic geometry: where parallels multiplyRigid-body dynamics: spinning, tumbling, precessingElliptic curves: geometry that addsAtomic physics: orbitals and spectraQuaternions: rotation as multiplicationPush-forward and pullback: integrating through a mapKnot theory: telling tangles apartFractal geometry: dimension between the integersQuantum information: entanglement and its limitsCosmology: the expanding universeCellular automata: computation from local rulesComplex systems: order from many simple partsGalois theory: the symmetry of equationsMagnetism and the Ising model: order from alignmentOscillators and escapements: how a watch keeps timeGears and mechanisms: transmitting motion exactlyQuartz resonators: a crystal that keeps timeLoudspeakers: the moving-coil driverFilters and crossovers: splitting sound between driversRoom acoustics: the room is part of the speakerWavelets: zooming in on a signalLaser physics: light that copies itselfRepresentation theory: groups acting as matricesSemiconductor physics: bands, doping, junctions

Back to the math encyclopedia