Occam's Razor Is a Compression Algorithm
Contents
Why the simplest explanation wins, and what "simple" actually means.
In People Are Not Numbers, and Other Excuses I argued that statistics is compression, and that knowledge in general is compression: a map, a law of physics, an average all take something huge and make it small enough to think with. I want to push that idea one step further, into the question of how science chooses between theories.
The usual answer is Occam's razor: when two explanations fit the facts, prefer the simpler one. It is named after William of Ockham, a fourteenth century English friar, although the famous wording "entities must not be multiplied beyond necessity" is not found in his writings and was attached to him later. Whoever phrased it, almost every scientist uses it, and almost nobody can say why it should work.
The bad answer: simplicity is pretty
The common justification is aesthetic. Simple theories are elegant. Nature likes elegance. Physicists talk about beautiful equations as if beauty were evidence.
That is not an argument. Why should the universe care what we find pretty? Plenty of true things are ugly. The orbit of Mercury drifts slightly more than Newton's theory says it should. The standard model of particle physics has around nineteen free parameters that nobody can derive from anything. Biology is a pile of accidents and patches. If simplicity were just taste, the razor would be a prejudice, and we should throw it away.
It isn't taste. There is a precise reason simpler theories win, and it comes straight from compression.
A theory is a compressed file
Think of the data as a long file: every measurement anyone has ever made of falling bodies, planets, tides. Now think of a theory as a program that reproduces that file.
You could "explain" the data by just listing it. That is a theory too, in a trivial sense: it fits every observation perfectly. It is also useless. It is as long as the data itself, it compresses nothing, and it tells you nothing about the next measurement.
Newton's law of gravitation is a short program. A few lines of mathematics plus a handful of initial conditions regenerate the positions of the planets, the path of a cannonball and the timing of the tides. The program is tiny, the data is enormous. That ratio is what we mean when we say a theory explains something.
So the real comparison between two theories is not "which is prettier" but "which gives the shorter total description": the length of the theory plus the length of whatever the theory fails to predict, which you still have to write down as a list of exceptions. Information theorists call this the minimum description length principle, worked out by Jorma Rissanen in the late 1970s, and it rests on Kolmogorov complexity, the length of the shortest program that produces a given string. Ray Solomonoff showed in the 1960s that if you weight every possible explanation by its length, giving shorter programs more weight, you get a prediction method that is provably as good as any computable one in the long run.
That is Occam's razor, stated as mathematics. Not "prefer the pretty theory", but "prefer the theory that compresses the data best".
Why compression predicts
Here is the part that makes it more than bookkeeping. A theory that compresses well also predicts well, and this is not a coincidence.
If a short program reproduces a long file, the file has a pattern, and the program has captured it. Patterns continue. The next planet position, the next tide, will follow the same rule. A long, patchy theory, one that needs a special clause for each observation, has captured nothing; it has memorized. And memorization tells you nothing about the next case.
Every programmer and every statistician knows this failure by name: overfitting. Give a model enough parameters and it will fit any data perfectly, including the noise. Draw a polynomial of degree ninety-nine through a hundred points and it will pass through each one exactly, then swing wildly between them and predict nonsense. The model with three parameters that misses each point by a little will predict the hundred and first point far better. It compressed. The other one copied.
Epicycles
The history of astronomy is the cleanest example.
Ptolemy's system put the Earth at the center and made the planets move on circles riding on circles, epicycles, to account for the way they sometimes seem to move backward across the sky. It worked. For centuries it predicted planetary positions well enough for calendars and navigation. When observations improved and the predictions drifted, astronomers could always fix things by adjusting the circles or adding parameters.
Copernicus put the Sun at the center. His original system, still using perfect circles, was not actually more accurate than Ptolemy's, and it still needed epicycles of its own. What it had was a better compression: the backward motion of the planets stopped being a separate fact to be patched for each planet and became a consequence of one fact, that the Earth also moves. Then Kepler replaced the circles with ellipses, and the whole apparatus collapsed into three short laws. Then Newton derived Kepler's laws from one law of gravitation.
Each step was a shorter program for the same file. That is why it was progress.
Notice also what the patched Ptolemaic system could do: fit anything. With enough epicycles you can approximate any closed path. That flexibility looked like strength. It was the sign that the theory had stopped saying anything.
What "simpler" does not mean
This view clears up several confusions about the razor.
Simpler does not mean fewer words in English. "God did it" is very short to say. As a program it is enormous, because it does not generate the data; to reproduce the actual observations you would have to append every observation as an exception. It compresses nothing. It is the list of data with a label on top.
Simpler does not mean the universe is simple. The razor makes no claim about nature. It is a rule about which description to bet on, given what you have seen. If the world turns out to be complicated, the shortest adequate description will be complicated too, and that is fine. General relativity is harder to write down than Newton's law, and it wins anyway, because Newton's law plus the list of its failures (Mercury's orbit, the bending of light) is longer than Einstein's equations.
Simpler does not mean ignoring data. A short theory that fails to predict half the observations is not short at all once you add the half it got wrong. The cost of the exceptions is part of the bill.
The razor in daily life
The same logic works outside science. Your car won't start on a cold morning. One explanation: the battery is weak. Another: a neighbor, who has a grudge, crept out at night and sabotaged it in a way that left no trace. Both fit the fact. The first is a short program that also explains why it happened last winter and why the headlights looked dim. The second needs a neighbor, a motive, a skill, an opportunity and a convenient absence of evidence, each a separate assumption with nothing else to support it.
Conspiracy theories fail the razor for exactly this reason. Each new inconvenient fact is absorbed by adding another hidden actor or another cover-up. The theory grows with the data instead of compressing it. That is the epicycle pattern again, and it is the clearest sign that a theory has stopped explaining and started memorizing.
Conclusion
Occam's razor is not an aesthetic preference and not an article of faith about a tidy universe. It is what follows once you accept that knowledge is compression. A theory is worth exactly as much as it shortens the description of what we observe, and a theory that shortens it has found a pattern that will hold in the next case.
So when someone asks why science prefers the simpler theory, the answer is not that simple theories are beautiful. It is that a theory which cannot compress the data has not understood it.