Chapter 01 · Computation
What can a machine compute?
Before asking whether a machine can think, someone had to define what it means to compute. Alan Turing did it with a tape, a head and a table of rules, and along the way discovered that there are questions no computer will ever be able to answer.
In this chapter
In 1928 David Hilbert posed the Entscheidungsproblem, the “decision problem”: is there a mechanical procedure that, given any mathematical statement, decides whether it can be proved? To answer “no” one first had to pin down what a mechanical procedure is, an idea nobody had defined rigorously. In 1936, aged twenty-four, Alan Turing published On Computable Numbers and gave the definition we still use.
All of artificial intelligence rests on this foundation. A language model is, in the end, a program run by a computer, and what a program can or cannot do was settled in that paper, before any computer existed.
The Turing machine
Turing imagined a person calculating with pencil and paper and stripped away everything inessential. Four things were left:
- an infinite tape divided into cells, each holding a symbol (or blank);
- a head that reads and writes one cell at a time and moves one position left or right;
- an internal state, taken from a finite list: the “working memory” of whoever is computing;
- a table of rules that, for each pair (state, symbol read), says what to write, where to move and which state to go to.
A Turing machine is a tuple with a finite set of states , a finite tape alphabet that includes the blank, an initial state , a halting state and a transition function
It looks far too poor to do anything interesting. Try it in the figure: the first machine adds one to a binary number with just two states and five rules.
Turing argued that any computation a person can carry out by following explicit rules can be carried out by one of these machines. That same year Alonzo Church reached the same frontier by another route, the lambda calculus, and the two definitions were shown to be equivalent.
Everything that is “effectively calculable” is computed by some Turing machine.
It is not a theorem, because “effectively calculable” is an intuitive notion rather than a formal definition. It is a thesis that no counterexample has refuted in ninety years. The lambda calculus, recursive functions, cellular automata, every programming language and neural networks with unlimited precision all compute exactly the same class of functions.
One machine to simulate them all
The paper's second idea carried even more weight. A machine's table of rules is a finite text, so it can be written on the tape of another machine.
There is a machine such that, for every machine and every input ,
where is the description of encoded as tape symbols.
This is the birth of the stored-program computer: a single physical machine whose behaviour is decided by a piece of data, the program. In 1945 John von Neumann described the architecture of the EDVAC around this idea, and almost every later computer follows it. The program being data has another consequence: it can also be produced by another program, from examples. The rest of this site is about that.
The halting problem
The figure's third machine never stops. Watching it run, that is obvious. But is there a general method that, given any machine and its input, decides whether it will eventually halt?
There is no machine that, for every pair , halts and answers
Proof (by diagonalization)
Suppose exists. Build a machine that, on input , runs and does the opposite: if says that halts when reading itself, enters an infinite loop; if says it does not halt, halts.
Now ask what does with its own description. If halts, it is because said it does not. If it does not halt, it is because said it does. Either way is wrong, so such an cannot exist.
The argument recycles the trick Cantor used to show that the real numbers cannot be listed, and Gödel in 1931 to prove that there are unprovable arithmetic truths. The answer to the Entscheidungsproblem is “no”: there are well-posed questions that no algorithm can answer.
Computable is not enough: the cost
Knowing that something can be computed does not say whether it can be computed in time. Complexity theory counts how many steps a machine needs as a function of the input size . Problems in the class are solved in polynomial time, , and those in are the ones whose solution can be checked in polynomial time. Whether is the most famous open question in computer science.
This matters a lot for AI. Many problems we would like to solve exactly are intractable. Even training a three-neuron network to fit a dataset perfectly is NP-complete in the worst case (Blum and Rivest, 1992). Modern AI does not promise optimal solutions: it looks for good enough solutions with approximate, statistical and local-optimization methods. The next chapters are about those methods.
1950: can machines think?
Fourteen years later Turing published “Computing Machinery and Intelligence” in the journal Mind. Instead of defining “thinking”, he proposed the imitation game: if an interrogator conversing in writing cannot tell the machine from a person, we have no grounds to deny it the intelligence we grant to people. But the most visionary part of the paper is its last section, entitled Learning Machines:
Instead of trying to produce a programme to simulate the adult mind, why not rather try to produce one which simulates the child's? If this were then subjected to an appropriate course of education one would obtain the adult brain. — A. M. Turing, “Computing Machinery and Intelligence”, 1950
Seventy years early, this is the program of LLMs: a generic system that acquires its behaviour by learning from data instead of being handed hand-written rules. But for the next thirty years the dominant plan was the opposite one: write knowledge down as rules and let the machine deduce the consequences. That is logic.
References
- A. M. Turing (1936). “On Computable Numbers, with an Application to the Entscheidungsproblem”. Proceedings of the London Mathematical Society, s2-42.
- A. Church (1936). “An Unsolvable Problem of Elementary Number Theory”. American Journal of Mathematics, 58(2).
- J. von Neumann (1945). First Draft of a Report on the EDVAC.
- A. M. Turing (1950). “Computing Machinery and Intelligence”. Mind, 59(236).
- T. Radó (1962). “On Non-Computable Functions”. Bell System Technical Journal, 41(3).
- A. Blum and R. L. Rivest (1992). “Training a 3-Node Neural Network is NP-Complete”. Neural Networks, 5(1).