Chapter 13: Maxwell's Demon

Part V: Information & Physics

The Thought Experiment

In 1867, James Clerk Maxwell proposed a thought experiment to challenge the second law of thermodynamics. Imagine a gas-filled box divided in two. A tiny intelligent being — the "demon" — watches individual molecules and operates a frictionless trapdoor between the two halves.

The demon lets fast molecules pass to the right chamber and slow molecules to the left. Over time, the right chamber becomes hotter and the left cooler — without any work being done. Heat appears to flow spontaneously from cold to hot, violating the second law.

For nearly a century, this posed a serious challenge to thermodynamics. The resolution came from an unlikely direction: information theory.

Maxwell's Demon: Visual Schematic

trapdoorCOLDslow moleculesHOTfast molecules😈demonMemory: 0/1 bit

The demon sorts fast (red) and slow (blue) molecules, maintaining a 1-bit memory register about each molecule's position.

The Szilard Engine (1929)

Leo Szilard simplified Maxwell's demon to a single molecule in a box. The engine operates in three steps:

  1. Measurement: The demon measures which half of the box contains the molecule, gaining 1 bit of information.
  2. Work extraction: A piston compresses the empty half isothermally. The molecule's pressure does work \( W = k_B T \ln 2 \) on the piston.
  3. Reset: The partition is removed, ready for the next cycle.

If no entropy is paid, this constitutes a perpetual motion machine of the second kind. Szilard noted the measurement must cost entropy — but it took Landauer and Bennett to pinpoint exactly where.

Resolution: Information Erasure

The key insight came from Rolf Landauer (1961) and was completed by Charles Bennett (1982):

\( \Delta S_{\text{gas}} = -k_B \ln 2 \quad \text{(entropy decrease)} \)

\( \Delta S_{\text{erasure}} = +k_B \ln 2 \quad \text{(Landauer's principle)} \)

\( \Delta S_{\text{total}} = 0 \quad \checkmark \)

The demon's memory stores a bit: "molecule was on the LEFT" or "molecule was on the RIGHT." To operate cyclically, the demon must erase this bit before the next measurement. Landauer's principle says erasing one bit costs at least \(k_B T \ln 2\) of energy, dissipated as heat into the environment.

Bennett showed that the measurement itself can be done reversibly (zero entropy cost). The entire entropy payment happens at erasure. The second law survives because: information has a physical entropy equivalent.

Brillouin's Negentropy Principle

Léon Brillouin (1951) formalized the connection: acquiring one bit of information corresponds to a decrease in entropy of \(k_B \ln 2\). Conversely, erasing information increases entropy by the same amount.

\( I = -\frac{\Delta S}{k_B \ln 2} \quad \text{[bits]} \)

This "negentropy" (negative entropy) interpretation directly links Shannon's information measure to Boltzmann's thermodynamic entropy — a connection that Shannon himself noticed when von Neumann told him to call his measure "entropy."

Python: Szilard Engine Simulation

Simulate 1000 cycles of the single-molecule Szilard engine, tracking entropy accounting and confirming that the second law is always satisfied.

Python
script.py122 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server