😈 Maxwell's Demon

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 5 July 2026

Frequently asked questions

What is Maxwell's demon?Maxwell's demon is a thought experiment in which a tiny intelligent being operates a trapdoor between two gas chambers, letting fast molecules into one side and slow molecules into the other. This sorts the gas into hot and cold halves without doing apparent work, seemingly creating a temperature difference from nothing and violating the second law of thermodynamics.

Does the demon really violate the second law?No. The apparent violation is resolved once you account for the demon itself. To decide which molecules to pass, the demon must measure and remember information. Its memory is a physical system whose entropy must be counted. When the full system — gas plus demon's memory — is considered, total entropy never decreases.

What is Landauer's principle?Landauer's principle states that erasing one bit of information in a system at temperature T dissipates at least kT·ln(2) joules of heat to the environment, increasing entropy by at least k·ln(2). Erasing information is the irreversible, entropy-producing step that rescues the second law.

How does erasing memory save the second law?

The demon's memory has finite capacity. To keep sorting, it must eventually erase old measurement bits. Bennett showed that measurement can be done reversibly, but erasure cannot: each erased bit dumps kT·ln(2) of heat. This entropy increase always equals or exceeds the entropy the demon removed from the gas.

What does the entropy budget show in this simulation?

The simulation tracks three quantities: the gas entropy (which falls as the gas is sorted), the demon's memory entropy (which rises as bits are recorded and erased), and the net total. The net total — gas plus memory — never decreases, demonstrating the second law holds for the complete system.

Why do fast and slow molecules separate?

The demon opens the trapdoor only when a fast molecule approaches from the left or a slow molecule approaches from the right. Over time this funnels high-speed (hot) molecules to the right chamber and low-speed (cold) molecules to the left chamber, building a temperature gradient.

What is the connection between information and entropy?

Information is physical. The Szilard engine and Landauer's principle show that one bit of information is worth kT·ln(2) of free energy. Knowing which side a molecule is on lets you extract work, but acquiring and later erasing that knowledge costs at least as much entropy as you gained.

What is kT·ln(2) and why does it appear?

kT·ln(2) is the minimum energy cost of erasing one bit at temperature T, where k is Boltzmann's constant. The ln(2) factor comes from collapsing two possible memory states into one, halving the phase-space volume, which corresponds to an entropy drop of k·ln(2) in the memory that must be paid as heat.

Has Maxwell's demon been built in a lab?

Yes, in a limited sense. Researchers have built information-to-energy conversion devices using single electrons, colloidal particles and tiny systems that extract work by exploiting measured fluctuations. All of them confirm Landauer's bound: the energy gained never exceeds the cost of measurement and erasure.

How do I use this simulation?

Toggle the demon on to start sorting molecules and watch the temperature gradient and gas entropy change. Adjust the molecule count, speed threshold and memory size with the sliders. Watch the entropy budget bars: gas entropy drops, memory entropy climbs, and the net total stays flat or rises, never falling below zero.