Algorithms
What an algorithm is: a finite, well-defined sequence of steps for solving a problem or performing a calculation. Its properties according to Knuth, classic examples, complexity, and its relationship with artificial intelligence.
An algorithm is a finite, well-defined sequence of steps or instructions that solves a problem or performs a calculation. It is neither a program nor a machine: it is the abstract procedure that a person with pencil and paper can carry out just as a computer can. A bread recipe or the long-division method taught in school are, in this sense, algorithms.
The word comes from al-Khwarizmi (Muhammad ibn Musa al-Khwarizmi), a ninth-century Persian mathematician at the House of Wisdom in Baghdad; the medieval Latinization of his name, «Algoritmi», came to denote methods of calculation. The idea is older still: Euclid's algorithm for the greatest common divisor is more than two thousand years old. Primary source.
Properties of an algorithm
In «The Art of Computer Programming», Donald Knuth sets out five properties every algorithm must have. Finiteness: it always terminates after a finite number of steps. Definiteness: each step is specified rigorously and without ambiguity. Input: it takes zero or more initial values drawn from a defined set. Output: it produces one or more results bearing a precise relation to the input. Effectiveness: its operations are basic enough to be carried out exactly and in finite time. A procedure that never ends, or whose steps are ambiguous, is not an algorithm.
Classic examples
Sorting algorithms such as quicksort and mergesort rearrange a list from smallest to largest. Binary search finds an item in a sorted list by halving it at each step. Euclid's algorithm, Knuth's favorite example, computes the greatest common divisor of two numbers through successive subtractions or divisions. All share the same anatomy: defined input, precise steps, output, and a guaranteed end. Primary source.
Complexity
A single problem admits many algorithms, and they do not all cost the same. Complexity measures the resources an algorithm consumes as its input grows: time (the number of operations) and space (memory). It is expressed with Big O notation, an upper bound on that growth. Binary search runs in O(log n), which is very efficient; sorting with quicksort or mergesort is around O(n log n). This measure lets us compare algorithms independently of the particular computer that runs them. Primary source.
Algorithms and AI
Machine-learning algorithms —gradient descent, backpropagation, k-means— are a type of algorithm, not something apart. It is worth distinguishing the algorithm (the training procedure) from the model it produces (the specific set of parameters fitted to some data). Gradient descent adjusts weights to minimize error; backpropagation computes how to do so in a neural network; k-means groups unlabeled data into clusters. Modern AI is, at bottom, a catalogue of algorithms applied to data.
Pieces using this term
- NousCoder-14B: how to read a 7.08-point gain without exaggerating it (2026-07-25)
- Chip Controls Are Not a Switch: How to Read China’s Race for AI Hardware (2026-07-22)
- A new quantum algorithm expands the toolkit for AI and science (2026-07-13)
- Siemens’ Erlangen factory: how to attribute results when AI is only one component (2026-07-13)
- More Than 800 Figures Urge a Halt to Superintelligence (2025-10-22)
- Apple paper measures limits of reasoning models (2025-06-10)
- Apple experiment separates answers from reasoning traces (2025-06-10)
- CES 2024 and AI: Separating Demos From Claims (2024-01-11)
This article was produced with artificial intelligence under human editorial oversight.