# Maxwell's Demon: Why does the entropy of the overall system decrease?

I'm trying to understand the logic behind this famous thought experiment, my confusion is as follows: In the box on the right after the demon has finished his "work" I understand that side A now has low entropy since the demon has only permitted fast moving molecules into B. So the demon has rendered the side A full of $\color{blue}{\text{cold}}$, $\color{blue}{\text{slow}}$ moving molecules, which makes perfect sense and it seems correct to say the entropy of side A has decreased.

A quote I read recently says that

In an adiabatic expansion where the entropy stays constant the space available for the gas increases thus the speed of the molecules must correspondingly fall.

So my understanding of that statement is that the system is more disordered (entropy increases) if the space available for the gas increases, so to compensate the molecules must slow down to have $\bbox[yellow]{\text{less}}$ entropy (as the overall entropy change must be zero). According to the image above, the whole system (A and B on the right box of the previous image) has a reduced entropy.

But here's the problem: Side B is now full of $\color{red}{\text{hot}}$, $\color{red}{\text{fast}}$ moving molecules.

So does this mean that the entropy of side B has increased?

## Edit:

One of the comments below (which has been deleted now) mentions that the entropy of B does increase but the overall entropy of the system (A+B) decreases.

So the question that remains is: Why does the entropy of the system decrease and not increase?

Or; Why is side A more dominant?

• Pretty sure the word is "daemon" – goblin Oct 4 '16 at 5:04
• @goblin: Either spelling is valid, depending where you are. (And, frankly, speaking purely empirically, even in Britain nowadays I only ever see "demon" unless someone is quoting historical sources or trying to be clever!) – Lightness Races in Orbit Oct 4 '16 at 15:19
• @LightnessRacesinOrbit, maybe it's just me, but I tend to think the connotations here are completely different. When I hear "demon" I imagine something with horns; there's a suggestion of malevolence and evil intentions. When I hear "daemon" I basically imagine a fairy; maybe a tricksy fairy, with perhaps a subversive sense of humor, but a fairy nonetheless. That nasty-looking creature with horns in the image... for myself, at least, there's a definite conflict with the images that pop into my mind when I'm pondering Maxwell's daemon. – goblin Oct 5 '16 at 3:56
• @goblin: Speaking personally, I would tend to agree. But I am aware that it's really just my opinion and seemingly a marginal one at that :) – Lightness Races in Orbit Oct 5 '16 at 11:40

So the box is hot on the right and cold on the left. Then one can use this separation of temperature to run a heat engine by allowing the heat to flow from the hot side to the cold side. Another possible action of the demon is that he can observe the molecules and only open the door if a molecule is approaching the trap door from the right. This would result in all the molecules ending up on the left side. Again this setup can be used to run an engine. This time one could place a piston in the partition and allow the gas to flow into the piston chamber thereby pushing a rod and producing useful mechanical work.

So remembering this is a paradox, if the demon "could" do his job, a system that previously could do no work because entropy was even all over, is now able to do work, so by definition entropy has decreased.

But the demon can't do the job, so this is just assuming he could.

Using the expression for the internal energy of an ideal gas, the entropy may be written:

$${{\frac {S}{Nk}}=\ln \left[{\frac {V}{N}}\,\left({\frac {U}{{\hat {c}}_{V}kN}}\right)^{{\hat {c}}_{V}}\,{\frac {1}{\Phi }}\right]}$$

Since this is an expression for entropy in terms of $U$, $V$, and $N$, it is a fundamental equation from which all other properties of the ideal gas may be derived. Note, no explicit $T$ dependence exists, as mentioned in the comments above.

• Excellent answer, using the idea of a heat engine has helped me see this in a different light. I won't be able to accept any answers just yet as I am awaiting an answer from Albert Aspect as promised in the comments. Thank you for your time (+1) :-) – BLAZE Oct 4 '16 at 0:02
• Why do you say that no $T$ dependence exists? The $T$ dependence is contained in the energy $U$. So maybe no explicit $T$ dependence exists... – valerio Oct 4 '16 at 15:26
• @valerio92 thanks very much for pointing that out, I have edited the answer. – user108787 Oct 5 '16 at 0:48

You can think of entropy as measuring the amount of phase space volume that the system could be occupying. (This is the set of all possible sets of positions and momenta for all the particles.)

It's correct that the set of possible momenta are unchanged, so that doesn't affect the entropy. But the set of possible positions is lower, because it becomes correlated with momentum -- the high-momentum particles can only be in half the volume as before. That's why the entropy decreases.

You also specifically asked how the entropy of side $B$ changes. This depends on how the system is set up. If you neglect particle interactions, then side $B$ ends up with only fast particles, while it began with both fast and slow particles. Since the available phase space is lower, the entropy of side $B$ decreases.

However, if you allow particle interactions, the particles in side $B$ will reach thermal equilibrium, and you'll get a distribution of velocities (i.e. some slow, some fast, and some very fast). Then the entropy of side $B$ increases.

The first way is more common in popular presentations since it's a bit cleaner, while the second is more realistic. But in both cases, the total entropy of $A$ and $B$ decreases, which is the key point.

• Nice explanation on why the entropy decreases, I won't be able to accept any answers just yet as I am awaiting an answer from Albert Aspect as promised in the comments above. But thank you very much for your time so all I can do for now is (+1). Regards. – BLAZE Oct 4 '16 at 0:05
• Maybe it's negligible but wouldn't the possible momenta decrease as particles are now not allowed to travel through the passage? – Yogi DMT Oct 4 '16 at 15:30
• In order to have a ghost of a chance of running this such that the particles per second incident on the trapdoor is low enough to even make the attempt, you are looking at non-interacting particles over reasonable timescales. – Joshua Oct 4 '16 at 18:14
• @knzhou Hi, sorry for the late response (been too busy to read all these answers very carefully). Could you please elaborate (or give a link) that explains what is meant by entropy as measuring the amount of phase space volume that the system could be occupying. I have never come across this concept before, and would like to learn some more. Thanks for your answer. – BLAZE Oct 6 '16 at 7:12
• @BLAZE Here's an example. You probably haven't seen it before because most introductory textbooks never cover classical statistical mechanics at all -- they go directly to the quantum case (with its discrete states instead of continuous phase space) because the counting is easier there. – knzhou Oct 6 '16 at 23:08

There are different kinds of entropy here. The thermal entropy due to the molecules moving faster or slower is a red herring and actually isn't important for understanding Maxwell's demon at all. The important entropy here is the mixing entropy that has to do with how well-sorted these different kinds of molecules are.

Personally, I think this version of Maxwell's demon shouldn't be taught in physics classes at all, even though it's the way in which Maxwell originally formulated it. A much more straightforward way of explaining Maxwell's demon is to just talk about different kinds of molecules like Nitrogen vs Oxygen. (An even simpler version is to just call them blue and red balls, although this may lead people to ask how balls tiny enough to be considered "microscopic" can have distinct colors.)

Whether blue and red, Nitrogen and Oxygen, or fast and slow, the important point is just that there are 2 different types of particles. And when they are all mixed together this is a state of high entropy, whereas when they are carefully separated into different chambers this is a state of low entropy.

• Thank you for your answer, I have never heard of "mixing entropy" before. Would you care to elaborate on it a bit please? Also as mentioned below the other answers; I won't be able to accept any answers just yet as I am awaiting an answer from Albert Aspect as promised in the comments below my question. So all I can give is (+1) for now. Best regards. – BLAZE Oct 4 '16 at 0:35
• Mixing entropy, also called entropy of mixing, is entropy due to different things getting mixed together. For example, when you add cream to a cup of coffee the cream starts out in a blob somewhat separate from the rest of the coffee. This has low entropy. But naturally and spontaneously, the cream will start to mix with the coffee spreading out and eventually the entire cup of liquid will be homogenous. This is because a mixed state always has higher entropy than a separated state. The highest entropy state is the one which has the maximum number of ways of rearranging the components. – reductionista Oct 4 '16 at 0:43
• @BLAZE Mixing entropy is equivalent to the 'position component' of the phase space volume, if you want another perspective. – knzhou Oct 4 '16 at 0:49

We can imagine we have two different systems, one next to the other, we do not need to consider changes in volume. The reason being that entropy is extensive: if you have a system of volume V and separate the volume in two by adding a partition, the total entropy will not change. Also, entropy is a function of state, so it does not matter the path it takes to reach one state from another, the change in entropy will be the same regardless of the path you chose. Having said that, let us calculate the change in entropy for a partitioned system that goes from the same temperature in both sides to one that had different temperatures in both sides. For a single system the change would be:

$$\Delta S=mC\ln(T_\textrm{final}/T_\textrm{initial})$$

If we call the initial temperature $T_0$, then the total change in entropy for both systems will be:

$$\Delta S=\Delta S_1+ \Delta S_2= mC\ln\left(\frac{T_0+\Delta T}{T_0}\right)+mC\ln\left(\frac{T_0-\Delta T}{T_0}\right)= mC\ln\left(1-\left(\frac{\Delta T}{T_0}\right)^2\right)\lt 0$$