Thought Experiments · Thermodynamics

Maxwell's Demon

The tiny being that seemed to break the second law of thermodynamics — and revealed that information is physical.

Can you beat the second law of thermodynamics — the iron rule that disorder always increases and heat never flows from cold to hot on its own? In 1867 James Clerk Maxwell imagined a tiny, intelligent being that seemed to do exactly that. The puzzle it created took over a century to fully resolve, and the answer connected physics to information itself.

The setup

Imagine a container of gas divided into two halves by a wall with a tiny trapdoor. The gas is all at one temperature, which means its molecules move at a range of speeds — some fast, some slow, mixed evenly throughout. Now station a tiny, sharp-eyed being at the trapdoor. Maxwell's "demon" watches the approaching molecules. When a fast one heads toward the door from the right, it opens the door to let it into the left side. When a slow one approaches from the left, it lets it through to the right.

Over time, the demon sorts the molecules: fast ones accumulate on the left, slow ones on the right. But fast molecules mean high temperature and slow molecules mean low temperature. The demon has made one side hot and the other cold, starting from a uniform temperature — and it did so seemingly without doing any work.

Why this is alarming

This appears to violate the second law of thermodynamics, one of the most sacred principles in all of physics. The second law says that heat does not spontaneously flow from cold to hot, and that the disorder — the entropy — of an isolated system never decreases. Yet the demon has created a temperature difference from nothing, decreasing entropy and even producing a setup you could use to extract useful work. If real, it would be a perpetual motion machine.

The stakes: the second law underpins why engines can't be perfectly efficient, why time runs in one direction, and why perpetual motion is impossible. A genuine violation would overturn an enormous amount of physics.

The resolution: information has a cost

For decades the demon resisted explanation. The resolution, developed through the twentieth century, came from an unexpected direction: information theory. The key realisation is that the demon must measure each molecule's speed and remember which way to open the door. Information is physical — storing and, crucially, erasing it has a real thermodynamic cost.

As the demon operates, its memory fills up with data about molecules. To keep working, it must eventually erase that memory — and erasing information, as the physicist Rolf Landauer proved, always releases heat and increases entropy. When you account for the entropy generated by the demon's own information processing, the total entropy of the whole system still increases. The second law holds after all. The demon doesn't break the rules; it just hides part of the cost in its own mind.

A deep connection

Maxwell's demon turned out to be far more than a curiosity. Its resolution forged a profound link between thermodynamics and information — revealing that information is not abstract but physical, with an unavoidable energy cost. This insight underlies modern thinking about the limits of computation, the efficiency of computers, and even the physics of black holes. A whimsical imaginary creature opened the door to one of the deepest ideas in science.

Key takeaways

Advertisement

← Back to all guides