Formal Models of Computation: Turing Machines and Lambda Calculus

Graduate Depth 68 in the knowledge graph I know this Set as goal
computation turing-machines lambda-calculus church-turing

Core Idea

Turing machines and the lambda calculus are formal models that formalize the intuitive notion of 'algorithm' and 'computable function'. The Church-Turing thesis asserts that these models, despite superficial differences, capture exactly the same class of computable functions—those computable by any reasonable mechanical process.

How It's Best Learned

Study Turing machines and lambda calculus in parallel; show explicit translations between them. Implement a simple Turing machine simulator to build intuition.

Common Misconceptions

Explainer

Your prerequisite on the Church-Turing thesis established the central claim: any function computable by a "reasonable mechanical process" is computable by a Turing machine. But what exactly is a Turing machine? And why should a completely different formalism — the lambda calculus — compute the same class of functions? Understanding both models concretely, and then seeing why they coincide, is the core payoff of this topic.

A Turing machine is an idealized device with three components: an infinite tape of cells (each holding a symbol from a finite alphabet), a read/write head that can move left or right one cell at a time, and a finite set of states with a transition table. At each step, the machine reads the current cell, consults its transition table to determine the next state, the symbol to write, and which direction to move the head. The machine halts when it enters a designated accepting or rejecting state. This is spare, mechanical, and concrete — you can simulate it on paper. The entire computational history of the machine is visible in the tape, the head position, and the current state. From your set-theoretic background, note that a Turing machine is formally just a tuple (Q, Σ, δ, q₀, F) where Q is a finite set of states, Σ is an alphabet, δ: Q × Σ → Q × Σ × {L,R} is the transition function, q₀ is the initial state, and F ⊆ Q is the accepting states.

The lambda calculus reaches the same computational universe from a completely different angle. Instead of states and tapes, everything is a function. There are only three constructs: variables (x), abstractions (λx.e, defining a function), and applications (e₁ e₂, applying a function to an argument). Computation proceeds by β-reduction: (λx.e) v reduces to e[v/x], substituting v for x in the body. Even numbers and booleans must be encoded as functions (Church encodings), which initially feels absurd but turns out to be entirely workable. The Church encoding of the number 2 is λf.λx.f(f(x)) — the function that applies f twice to x. All arithmetic, conditionals, and even recursion can be built from these three primitives alone.

What makes their equivalence surprising is that the two models look nothing alike. Turing machines are imperative: they modify state step by step. Lambda calculus is functional: it rewrites expressions by substitution. Yet every lambda calculus term can be simulated by a Turing machine (mechanically rewrite the term according to reduction rules), and every Turing machine can be encoded in the lambda calculus (represent the tape, head, and state as a data structure and iterate). The equivalence is not a coincidence — it reflects the Church-Turing thesis, which you already know is a philosophical claim rather than a theorem. No one has yet found a naturally arising computational model that computes more functions than either.

An important caution follows from the common misconception: equivalent computability does not mean equivalent complexity. A problem solvable in 10 steps on a Turing machine may require exponentially many beta-reductions in the lambda calculus, and vice versa. The class of computable functions — those with a halting computation — is the same for both models. But when you ask how efficiently a function can be computed, the choice of model matters enormously, and different Turing machine variants (deterministic, nondeterministic, multi-tape) define complexity classes that may differ. The models are equivalent in power, not in speed.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsPiecewise FunctionsStep FunctionsComposition of FunctionsInverse FunctionsRadical Functions and GraphsRational ExponentsExponential Functions and GraphsLogarithms IntroductionBig-O Notation and Asymptotic AnalysisBreadth-First Search (BFS)Shortest Paths in Unweighted GraphsDijkstra's Shortest Path AlgorithmAlgorithm Analysis and Big-O NotationTuring MachinesThe Church-Turing ThesisFormal Models of Computation: Turing Machines and Lambda Calculus

Longest path: 69 steps · 351 total prerequisite topics

Prerequisites (4)

Leads To (0)

No topics depend on this one yet.