Definition
An algorithm is a finite, definite, step-by-step procedure for solving a problem or computing a result. Each step is fully specified, so following the procedure requires no judgement, insight, or creativity — only the mechanical execution of instructions.
The concept predates computing by millennia — Euclid's method for finding the greatest common divisor of two numbers, described around 300 BCE, is a classic algorithm — but programmable computers transformed algorithms from mathematical curiosities into the operational heart of modern civilization. Three properties distinguish a true algorithm from a vague recipe. Finiteness: the procedure must terminate after a finite number of steps. Definiteness: each step must be precisely specified, with no room for interpretive ambiguity. Effectiveness: each step must be something a sufficiently patient human could in principle carry out with pencil and paper. When any of these is absent, what we have is a heuristic, not an algorithm.
The notion extends far beyond software. Any systematic procedure for solving a class of problems — a medical diagnostic protocol, a legal decision procedure, a cooking recipe with exact measurements — shares the algorithmic structure of precise, repeatable steps.
Why it matters
How it works
You can think of an algorithm as a recipe whose every instruction is so explicit that no two faithful cooks could disagree about what it tells them to do. Given the same input, it always halts with the same output, and it gets there in a finite number of moves.
Computability and the Church–Turing thesis
Priest connects this informal idea to the precise model of a Turing machine. The claim that every intuitive algorithm corresponds to some Turing machine is the Church–Turing thesis. It cannot be proved, because "intuitive algorithm" is informal, but it is supported by the fact that every independent attempt to formalise the notion — recursive functions, the lambda calculus, register machines — has picked out the same class of procedures. That equivalence is what lets the theory of computability speak of algorithms in general, and what makes "has an algorithm" a sharp, machine-independent property of a problem.
Correctness and complexity
An algorithm is correct if it produces the right output for every valid input. Proving correctness typically involves establishing an invariant — a property that holds before and after each step — and showing that the invariant, at termination, implies the desired result. This is not merely academic: incorrect algorithms running at scale cause real harm, from financial calculation errors to flawed medical-dosing software.
Beyond correctness, algorithms are analyzed for complexity — how their resource demands (time and memory) grow as input size increases. Big-O notation captures this growth rate. An algorithm that runs in O(n) time scales linearly: doubling the input doubles the work. One that runs in O(n²) scales quadratically: doubling the input quadruples the work. At large scales, the gap between a linear and a quadratic algorithm dwarfs any hardware improvement.
Algorithmic paradigms
Most algorithms can be understood through a small set of design paradigms. Divide and conquer splits a problem into smaller instances, solves each recursively, and combines the results — merge sort is the canonical example. Dynamic programming avoids redundant recomputation by storing sub-problem solutions — Fibonacci computed iteratively rather than recursively. Greedy algorithms make locally optimal choices at each step, hoping to reach a global optimum — useful when they work, and instructively wrong when they don't (the travelling salesman problem resists greedy approaches). Knowing the paradigms turns algorithm design from a craft into a pattern-matching discipline.
Where it goes next
Algorithms are inseparable from data structures — the organizational forms that determine which algorithms are efficient on a given collection of data. They also form the foundation of machine learning, where learning itself is recast as an optimization algorithm running over training data. Number theory and formal systems connect algorithms back to questions of computability: what can in principle be computed, and what provably cannot.