Recent Posts


Maxwell's Demon

Out of context, Maxwell’s Demon evokes an image of a hounding remorse circling James Clerk Maxwell for some debauchery committed in his earlier years. Alas, Maxwell’s Demon is totally unrelated to any purported debauchery, as far as I know. Rather than plodding through a description of this ostensible paradox, elaboration from Maxwell himself, accompanied by an awesome graphic, should suffice.

“... if we conceive of a being whose faculties are so sharpened that he can follow every molecule in its course, such a being, whose attributes are as essentially finite as our own, would be able to do what is impossible to us. For we have seen that molecules in a vessel full of air at uniform temperature are moving with velocities by no means uniform, though the mean velocity of any great number of them, arbitrarily selected, is almost exactly uniform. Now let us suppose that such a vessel is divided into two portions, A and B, by a division in which there is a small hole, and that a being, who can see the individual molecules, opens and closes this hole, so as to allow only the swifter molecules to pass from A to B, and only the slower molecules to pass from B to A. He will thus, without expenditure of work, raise the temperature of B and lower that of A, in contradiction to the second law of thermodynamics.” - James Clerk Maxwell, 1871

Image credit:[2]

Breathe a sigh of relief, in light of this quote, we can confidently vindicate Maxwell of any debauchery.

Prior to investigating Maxwell’s demon, let’s consider a system without the intervention of any enterprising demons. To introduce the convention of my animations, the red dots are ‘fast’ particles (absolute velocity between 1 and 2), and the blue dots are ‘slow’ particles (absolute velocity between 0 and 1). Similarly, we consider a vertically divided 4x2 box. Energy values below each box display the normalized kinetic energy of all constituent particles within said box: such that the energies sum to unity (energy is calculated as the sum of the squares of the velocities). I’m additionally displaying the energies as a time-series plot affixed to the simulation box.

First, let’s consider the base case: a permeable partition with 500 particles distributed throughout the system. Figure 1 animates this situation.

Figure 1: Animation of 250 ‘fast’ and 250 ‘slow’ particles with a permeable partition.

Now, of course, we expect the average energy to remain relatively constant. Small deviations from 0.5 are artifacts of simulating discrete particles, in the limit of an infinite number of particles we expect deviations from 0.5 to approach 0. This case is so unfathomably boring that acts as an ideal model for all other systems, essentially, with no external trickery, every system should settle to resemble this one.

To test this hypothesis, let’s consider initially separating the particles on each side of the partition. Figure 2 illustrates a system with the ‘fast’ particles initially on the right, and the ‘slow’ on the left.

Figure 2: ‘Fast’ particles are initially splattered on the right, while ‘slow’ splattered on the left, the partition remains permeable.

We notice the right box begins at a markedly greater energy, however, particle diffusion drives their energies to equilibrate. Notice the oscillations, the quickest particles cross the partition and transfer their energy into the left box, eventually rebounding back into the right box. This process persists diminishingly until everything is adequately distributed, settling into the first case we discussed.

To aptly address Maxwell’s Demon requires a complete discussion of entropy, which I will save for a future post. For now, as an intuitive analog, consider entropy as proportional to the difference of energy between the two boxes. Now consider the previous cases: The first speaks to the unvarying nature of a system set in equilibrium. The second reflects that entropy is always decreasing, which we will tacitly take as a statement of The Second Law of Thermodynamics.

Figure 3 illustrates an incarnation of Maxwell’s thought experiment. The ‘fast’ and ‘slow’ particles are distributed throughout the system and divided with a semi-permeable partition. Concretely, this partition strictly allows ‘fast’ particles passage from the left box to the right, and ‘slow’ particles from the right box to the left.

Figure 3: Randomly distributed particles separated with a semi-permeable membrane: allowing ‘fast’ particle passage to the right, and ‘slow’ particle passage to the left.

We notice a divergence of energy coincident with the systematic separation of particles, ultimately illustrating a steady increase in entropy. This is clearly in direct contradiction with our Second Law, which states that the entropy must always decrease. Turns out Maxwell’s intuition was correct!

Now, upon further scrutiny, the Second Law is of course not actually violated. A resolution mends this predicament by analyzing the information required to ‘open’ the door for each particle passage.

Please refer to [1] and [3] for a precise discussion of Maxwell's thought experiment. Although cursory, I hope I helped illuminate some of the mystery surrounding Maxwell’s Demon.


[1] Maruyama, Koji, et al. “Colloquium: The physics of Maxwell’s demon and information.” Reviews of Modern Physics, vol. 81, no. 1, June 2009, pp. 1–23., doi:10.1103/revmodphys.81.1.

[2] Maxwell's demon. 23 Oct. 2017, Accessed 24 Oct. 2017.

[3]Rex, Andrew. “Maxwell's Demon-A Historical Review.” MDPI, Multidisciplinary Digital Publishing Institute, 23 May 2017,