Each class is a short animated explainer with narration and illustrations, plus quick checks and a mastery quiz. Your progress saves automatically as you complete classes.
▶ Watch class 1 free — no sign-upEvery class is 13 cards · narrated film + illustration · 3 quick checks · an interactive · a 5-question mastery quiz. Nothing hidden — this is the complete text of What Do We Mean By 'Algorithm'?.
Is it possible to write a computer program that can determine, for any other program and any input, whether that second program will eventually stop running or continue forever? This isn't a trick question. It’s one of the most fundamental questions in computer science, and the answer, proven by Alan Turing in 1936, is no. Such a program cannot exist. This result isn't about technological limitations—it's not that we don't have fast enough computers. It's a fundamental, mathematical limit on what is computable, period. Before we can even begin to talk about 'good' algorithms or 'fast' algorithms, we have to grapple with this idea: that there are well-defined problems that no algorithm, no matter how clever, can ever solve. To understand why, we first need a rock-solid definition of what an 'algorithm' even is. That is our task for today.
Why isn't a dictionary definition good enough?
Without a precise, language-agnostic model of computation, we cannot prove universal truths about what is and is not possible to compute.
A simple, abstract machine that defines the limits of computation.
An algorithm is any computational process that can be simulated by a Turing Machine—an abstract device with an infinite tape, a read/write head, and a finite set of rules.
The idea of an algorithm is ancient, but its formalization is modern.
The intuitive concept of an algorithm dates back to antiquity (Euclid, al-Khwarizmi), but the drive for a formal definition came from the foundational crisis in mathematics in the early 20th century.
How does this abstract machine actually 'think'?
A Turing Machine operates via a simple, deterministic loop: based on its current state and the symbol on the tape, its transition function dictates what to write, where to move, and which state to enter next.
Representing a machine with mathematical precision.
A Turing Machine is formally defined as a septuple M = (Q, Σ, Γ, δ, q₀, B, F), which precisely specifies its states, alphabets, and transition rules.
What are the necessary conditions for a procedure to be an algorithm?
As defined by Donald Knuth, any true algorithm must satisfy five key criteria: Finiteness, Definiteness, Input, Output, and Effectiveness.
Let's build a machine that performs a simple task: n+1.
A step-by-step trace of a Turing Machine that increments a number represented in unary by scanning to the end of the input and writing one more '1'.
A formal definition allows us to prove what is impossible.
Our formal model reveals two kinds of limits: problems that are fundamentally unsolvable (uncomputable, e.g., the Halting Problem) and those that are solvable but require infeasible resources (intractable).
How is an algorithm different from other kinds of procedures?
An algorithm guarantees a correct result. A heuristic is a practical but imperfect shortcut. A recipe is an informal procedure for humans that lacks mathematical definiteness.
Avoid these common misunderstandings about algorithms.
Common errors include confusing the abstract algorithm with a concrete program, assuming all problems are computable, and conflating the concepts of correctness and efficiency.
Where to read the primary sources and definitive guides.
To deepen your understanding, consult Turing's original 1936 paper, Sipser's 'Introduction to the Theory of Computation', and Knuth's 'The Art of Computer Programming'.
Design a machine to solve a simple language recognition problem.
This week's exercise: design and formally specify a Turing Machine that decides the language L = {aⁿbⁿ | n ≥ 0}.
An algorithm is not just a recipe; it is a precise computational procedure, formally equivalent to a Turing Machine, that is finite, definite, effective, and transforms input to output.