Entropy and multiplicity
The puzzle: nothing forbids the corner¶
Open a valve between a chamber full of gas and an identical chamber that has been pumped out, and the gas rushes through until both halves hold the same density. Wait as long as you like and it never rushes back. Release a drop of perfume in a still room and the scent spreads through the whole space; it never spontaneously regathers into the bottle.
Here is what makes this strange. Every collision between two gas molecules obeys Newton’s laws, and Newton’s laws do not care which way time runs — reverse every velocity in a movie of colliding billiard balls, and you get another perfectly valid movie of colliding billiard balls. Microscopically, there is nothing that forbids the gas molecules from happening to collide their way back into one corner. No law of mechanics singles out “spread out” as special.
The answer this module builds has nothing to do with forces becoming one-directional. It has to do with how many ways each outcome can happen. “Spread out” is not special because it is mechanically favoured — it is special because there are astronomically more arrangements of the molecules that look spread out than arrangements that look gathered in a corner. Once you can count those arrangements, the puzzle dissolves into arithmetic.
Predict before you calculate¶
Commit to an answer for each of these before running anything.
You flip 4 coins. How many of the possible outcomes have exactly 2 heads? Now flip 100 coins: is the fraction of outcomes with exactly 50 heads larger or smaller than the fraction with exactly 2 heads out of 4?
gas particles start entirely in the left half of a partitioned box. The partition is removed. For , would you be surprised to see all 10 particles back in the left half within a minute of watching? For ?
Two crystals of the same element look identical under a microscope: same lattice, same density, same colour. One is made entirely of a single isotope. The other is a 50/50 mixture of two isotopes of the same element, arranged randomly on the same lattice sites. Which crystal has the higher entropy — or are they the same?
An ice cube melts in a glass of warm water. Does the ice cube’s own entropy go up or down as it melts? Does the water’s entropy go up or down? Does the total?
Explore the model¶
The system here is deliberately the simplest one that shows the phenomenon: distinguishable objects, each independently in one of two states. Read it as particles in the left or right half of a box, coins showing heads or tails, or spins pointing up or down — the counting is identical in every case.
Here is the phenomenon that resolves the opening puzzle. On the left, two hundred objects start entirely in one box and hop back and forth, one at a time, between it and an empty second box; watch how quickly the occupancy settles near the even split and then stays there. On the right, the multiplicity distribution itself, shown as grows — the same shape every time, only narrower.
Left: the two boxes’ populations as objects hop between them one at a time. Right: the occupancy trace of the first box, drifting from the extreme starting point to the even split and staying there — not because anything forbids it from wandering back, but because so few of the accessible microstates put it there.
The relative multiplicity against the fractional occupancy ,
for growing . The curve is generated directly by thermolab.multiplicity. As grows the
region of appreciable multiplicity collapses onto the even split.
Run the laboratory now, then come back. Three things are worth doing before you read on:
Start the two-box simulation from an extreme occupancy and watch how long it takes to reach the even split, for versus .
Plot for a small (say ) and check by hand what fraction of the total arrangements sit at the peak, .
Watch the multiplicity distribution narrow as you increase , and note that it narrows around the same central value, , every time.
Derive the result¶
System and boundary. distinguishable objects, each independently in one of two states, isolated as a whole.
Independent variable. ; the macrostate is labelled by , the number of objects in the first state.
Given the postulate, the probability of observing a particular macrostate is just the fraction of all microstates that belong to it:
since is the total number of microstates (each of the objects independently in either state) and counts how many of them have exactly objects in the first state.
Counting the multiplicity¶
Choosing which of the objects are in the first state is a combinations problem:
For , direct counting gives , , and , exactly as it must. The macrostate alone accounts for of all microstates, while (every object in the first state) accounts for . Already at the even split is roughly 250 times more likely than the fully ordered extreme — and this ratio only grows with .
Why the even split dominates, and by how much¶
is maximised at (for even ) because moving away from the even split in either direction always removes more ways of achieving the macrostate than it adds — the binomial coefficients fall off symmetrically from the centre. Near the peak, expanding to second order in turns the discrete distribution into a Gaussian:
The relative width of that peak — its standard deviation divided by its centre — is
This is the same law that governed the pressure fluctuations in module 04, arising here from the sharpest possible source: pure combinatorics. It is exact algebra given the Gaussian width above, and it says that the fraction of microstates lying within a fixed relative distance of the even split shrinks as the system grows — which is precisely why an isolated gas is never observed gathering in a corner. Nothing forbids it mechanically; there are simply too few ways for it to happen once is large.
Boltzmann entropy¶
That example is worth sitting with. “Entropy is disorder” is a useful cartoon for some cases — a shuffled deck genuinely has higher multiplicity than a sorted one — but the cartoon breaks whenever the appearance of a macrostate and its multiplicity come apart, and isotope mixing is exactly such a case: the crystal looks equally tidy either way.
Stirling’s approximation and the thermodynamic limit¶
Direct computation of for macroscopic is neither necessary nor possible; the results above rest on , approximated by Stirling’s formula:
Applying Stirling to the peak multiplicity gives the exact asymptotic form
The leading term, , is extensive — it doubles when doubles, exactly as entropy should. The correction term is not: it grows only logarithmically, so it becomes negligible relative to the leading term as , but it is never exactly zero at finite .
Verify computationally¶
1. Small- combinatorics. from the log-gamma implementation matches computed by exact integer arithmetic, for every at .
2. The peak sits at the even split. For , the macrostate that maximises over all 101 values of is exactly .
3. The Gaussian limit. At , the Gaussian approximation to agrees with the exact combinatorial value to better than across the range .
4. Stirling’s error bound. The three-term approximation’s error stays under at — the code’s tests measure this bound rather than asserting it.
5. The Ehrenfest urn finds and holds the even split. Started from every object on one side, a system of objects sampled for steps has its late-time occupancy fraction land within of exactly one half, with a late-time spread under of — and it stays there rather than passing through and continuing on.
Transfer the idea¶
The same structure — count the microstates, note that one macrostate has overwhelmingly more of them, and call the log of that count “entropy” — reappears far beyond two-state systems.
Free expansion and diffusion. A gas released into a larger volume, or a drop of ink diffusing through water, is the same phenomenon as the two-box system: astronomically more microstates correspond to “spread out” than to “concentrated,” so spreading is what happens, every time, without any force driving it.
Entropy of mixing. Two different gases (or, as above, two isotopes on a lattice) mixed together have more entropy than either kept separately, purely from the combinatorics of interleaving them — the same counting, applied to molecules instead of coin flips.
Entropic elasticity. A stretched rubber band pulls back not primarily because stretching its polymer chains costs energy, but because a stretched chain has far fewer available configurations than a relaxed, coiled one — an entropic force, with the restoring tendency coming from exactly the same “more ways to be typical” counting used throughout this module.
Shannon information entropy. Claude Shannon’s measure of the information content of a message, , has the identical mathematical form as the entropy this module derives, for the identical reason: it is the unique measure, up to a constant, that is additive over independent choices.
Check your understanding¶
An isolated gas, released from a small corner of its container, spreads to fill the whole volume and is never observed to spontaneously regather in the corner. Newton’s laws are exactly time-reversible. What resolves the apparent tension?
A. Nothing in the mechanics forbids regathering; there are simply so vastly many more microstates corresponding to “spread out” that regathering is never observed in practice. B. Collisions between gas molecules are inelastic, so kinetic energy is lost and the gas cannot regather. C. Time-reversal symmetry is only approximate at the molecular scale, so the reverse process is mechanically forbidden. D. Once the gas reaches equilibrium, the molecules stop moving, so there is nothing left to regather.
Check your answer
Correct answer: A — Nothing in the mechanics forbids regathering; there are simply so vastly many more microstates corresponding to “spread out” that regathering is never observed in practice.
A. Right. The asymmetry lives entirely in the counting, not in the laws of motion. A time-reversed trajectory that regathers the gas is exactly as valid mechanically as the one that spreads it out — it is just overwhelmingly outnumbered.
B. This module’s model assumes no such dissipation, and in any case real molecular collisions conserve kinetic energy on average in a gas at equilibrium. Energy loss is not what prevents regathering — counting is.
C. Time-reversal symmetry of the underlying mechanics is not approximate here — reverse every velocity in a valid trajectory and you get another valid trajectory. The reverse process is not forbidden; it is merely represented by a vanishingly small fraction of the accessible microstates.
D. The molecules never stop moving; equilibrium is a statement about a macroscopic average, not about individual motion. This is the same point module 04 makes about pressure never going to zero at equilibrium.
“Every accessible microstate of an isolated system is equally probable.” What kind of statement is this, within the framework this module builds?
A. A postulate — the foundation the rest of the module is built on, justified by the agreement of its consequences with experiment, not derived from anything more basic. B. A theorem, proved from Newton’s laws applied to the colliding objects. C. An approximation that only holds at high temperature. D. A restatement of energy conservation.
Check your answer
Correct answer: A — A postulate — the foundation the rest of the module is built on, justified by the agreement of its consequences with experiment, not derived from anything more basic.
A. Correct, and worth being precise about. Nothing in this module proves equal probability from Newton’s laws or anything else; it is assumed, and everything that follows — multiplicity, entropy, the even split dominating — is a consequence of that one assumption.
B. No proof from Newton’s laws is given here or exists in general; the assumption is a postulate of statistical mechanics, not a derived theorem. Confusing the two hides exactly what is being assumed.
C. The postulate carries no temperature dependence at all in this module’s model — there are no energy differences between the two states to begin with. Temperature enters statistical mechanics elsewhere, not here.
D. Energy conservation is a separate statement (and, in this module’s model, all microstates share the same energy by construction, so conservation says nothing about which one is occupied). Equal probability is an additional, independent assumption.
The number of objects N in a two-state system is quadrupled, with everything else held fixed. What happens to the relative width of the multiplicity peak, sigma / (N/2)?
A. It halves, since the relative width scales as N^(-1/2) and quadrupling N halves 1/sqrt(N). B. It quarters, since N appears to the first power in the multiplicity formula. C. It doubles, because there are more objects and therefore more ways to deviate from the even split. D. It is unchanged, because the even split n = N/2 always dominates regardless of N.
Check your answer
Correct answer: A — It halves, since the relative width scales as N^(-1/2) and quadrupling N halves 1/sqrt(N).
A. Exactly. The relative width is 1/sqrt(N) exactly, so N -> 4N takes 1/sqrt(N) -> 1/sqrt(4N) = (1/2) * 1/sqrt(N) — the peak becomes twice as sharp, relatively speaking.
B. The relative width scales as N^(-1/2), not N^(-1). Quadrupling N changes 1/sqrt(N) by a factor of 1/sqrt(4) = 1/2, not 1/4.
C. There are indeed more ways to deviate in absolute terms, but there are even more ways to sit near the peak, and the ratio — which is what “relative width” measures — falls, not rises, as N grows.
D. The even split dominating is true at every N, but “dominating” becomes more extreme as N grows — that sharpening is exactly what the shrinking relative width describes. The width is not independent of N.
For a two-state system of N = 1,000,000 objects, use the N^(-1/2) law to estimate the relative width of the multiplicity peak, sigma / (N/2). Give your answer as a decimal fraction.
Check your answer
Correct answer: 0.001 (± 0.0002)
sigma / (N/2) = N^(-1/2) = 1/1000 = 0.001, i.e. 0.1%. The same law that gave a mole of gas an undetectable pressure fluctuation in module 04 gives a mole-scale multiplicity peak a relative width of about 1.3e-12 — the reason macroscopic systems never wander far from the even split.
Two crystals of the same element look identical under a microscope: same lattice structure, same density. One is a single isotope. The other is a 50/50 random mixture of two isotopes of the same element, on the same lattice. Compare their entropies.
A. The mixed crystal has vastly higher entropy, because entropy counts the number of accessible microstates, and there are astronomically many ways to arrange two isotopes across the lattice sites — even though nothing about the appearance changes. B. They have equal entropy, since neither crystal looks disordered and entropy is a measure of visible disorder. C. The pure crystal has higher entropy, because maintaining isotopic purity requires more structural order. D. Entropy cannot be compared between the two crystals unless one is visibly messier than the other.
Check your answer
Correct answer: A — The mixed crystal has vastly higher entropy, because entropy counts the number of accessible microstates, and there are astronomically many ways to arrange two isotopes across the lattice sites — even though nothing about the appearance changes.
A. Correct. Multiplicity(1000, 500) is about 2.7e299 for the mixed crystal against Omega=1 for the pure one, giving the mixed crystal roughly 690 k_B of entropy that the pure crystal simply does not have. Nothing about either crystal looks more “disordered” — the difference is purely in how many microstates share the visible macrostate.
B. This is exactly the intuition this example is built to break. Entropy is k_B ln Omega, a count of microstates, not a measure of how messy something looks. The two crystals look equally tidy and have wildly different entropies.
C. This has the comparison backwards, and it also imports “order” as if it settled the question. The pure crystal has exactly one microstate (Omega = 1, S = 0); the mixed crystal has an enormous number of them.
D. Entropy is well defined for both macrostates regardless of appearance — it is computed from the multiplicity of each, not from a visual inspection. The comparison in this question is exactly the kind Boltzmann’s formula was built to make.
Two independent subsystems, A and B, are part of one larger isolated system. Over time, subsystem A’s entropy decreases while subsystem B’s increases by a larger amount, so the combined entropy S_A + S_B rises. Is this consistent with the second law as developed in this module?
A. Yes — the second law here constrains only the total entropy of the isolated combined system; it places no requirement on any individual subsystem’s entropy. B. No — every subsystem’s entropy must increase individually, so this scenario is physically impossible. C. No, unless A and B are exchanging energy, in which case any change is allowed. D. Yes, but only because the total entropy was decreasing overall, which compensates.
Check your answer
Correct answer: A — Yes — the second law here constrains only the total entropy of the isolated combined system; it places no requirement on any individual subsystem’s entropy.
A. Correct. Because Omega_AB = Omega_A * Omega_B for independent subsystems, entropies add exactly: S_AB = S_A + S_B. Nothing about that additivity requires each term to move in the same direction — only their sum is constrained to (typically) increase for the isolated whole.
B. This is the misconception this example exists to falsify. A worked case in the module’s advanced section gives concrete numbers: subsystem A’s entropy falls by about 0.17 k_B while subsystem B’s rises by about 133.8 k_B, and the total rises. Nothing in the derivation forbids a subsystem’s entropy from falling.
C. The permissibility does not hinge on energy exchange specifically — it follows directly from additivity of entropy across independent subsystems, which holds whenever Omega_AB = Omega_A * Omega_B, regardless of what is being exchanged.
D. The premise states explicitly that the combined entropy rises, not falls. The consistency here does not require any compensating decrease elsewhere — it only requires that the sum of the two subsystem entropies not decrease.
Before reading the derivation: a two-state system’s size N is increased tenfold. Predict what happens to (a) the multiplicity of the even split, Omega(N, N/2), (b) the relative width of the multiplicity peak, and (c) the probability of the fully ordered extreme macrostate, n = 0.
Check your answer
Omega(N, N/2) grows enormously — its logarithm grows roughly linearly in N (ln Omega ~ N ln 2), so Omega itself grows exponentially with N, far faster than a factor of ten. The relative width of the peak shrinks by a factor of sqrt(10) ~ 3.16, following the N^(-1/2) law. The probability of the fully ordered extreme, P(0) = 1/2^N, collapses: multiplying N by ten multiplies the exponent by ten, so P(0) is raised to roughly its own tenth power — an already-tiny number becoming inconceivably smaller. If you predicted that all three quantities would change by comparable, “tenfold-ish” amounts, notice how differently these three quantities actually respond to the same change in N; that difference is the entire content of this module.
In two or three sentences, explain why an isolated gas never spontaneously gathers into one corner, in a way that would not also (incorrectly) predict that ten gas molecules could never be found gathered in one region by chance.
Check your answer
A good answer identifies the mechanism as counting: the macrostate “spread out” has overwhelmingly more accessible microstates than “gathered,” and makes the size of N do the work, since the relative dominance of the spread-out macrostate grows with N rather than being absolute. For ten molecules, the “gathered” macrostates are not negligibly rare at all — small systems visibly fluctuate into atypical configurations. Answers that say “it’s forbidden” or “it’s just what gases do” without reference to N do not distinguish the two cases and should be pushed further.
As N grows, the relative discrepancy between S(2N, N) and 2 S(N, N/2) — the test of whether Boltzmann entropy is exactly extensive — behaves how?
A. It shrinks toward zero as N grows, but is not exactly zero at any finite N. B. It is exactly zero for every N, since entropy is extensive by definition. C. It grows without bound as N grows, since larger systems have more ways to deviate. D. It depends only on whether N is even or odd, not on the size of N.
Check your answer
Correct answer: A — It shrinks toward zero as N grows, but is not exactly zero at any finite N.
A. Correct. The discrepancy is set by the sub-leading, logarithmic term in Stirling’s approximation, (1/2) ln(pi N) roughly, divided by the leading extensive term, N ln 2. That ratio falls with N but never reaches exactly zero for finite N — extensivity is a thermodynamic-limit statement, not an identity.
B. Extensivity is not built into the definition S = k_B ln Omega; it is something the combinatorics only delivers approximately, with the approximation improving as N grows. Measured directly, the discrepancy is about 0.9% at N=200 and about 0.002% at N=200,000 — small, but not zero.
C. The opposite is measured: the discrepancy shrinks as N grows, because the leading term in the entropy (proportional to N) grows faster than the sub-leading correction (proportional to ln N).
D. The discrepancy is set by the size of N through the logarithmic correction term, not by parity. It shrinks systematically and predictably as N increases.
Exam-style problems for this module — the ones worth doing with a pen — are collected in the problem set.
Explain it in your own words¶
Answer in a few sentences each.
A student says: “Gases spread out because spreading out is the natural direction of time.” Rewrite this so that it is actually correct, and say precisely what was wrong with the original.
Two crystals look identical to the eye but have very different entropies. Explain how this is possible without contradicting the idea that entropy measures “how spread out” a system is.
A subsystem’s entropy decreases while the total entropy of the isolated system it belongs to increases. Is this a violation of anything you have learned in this module? Justify your answer using the additivity of for independent subsystems.
Explain, without writing an equation, why doubling the number of coin flips makes the fraction landing exactly at heads shrink relative to nearby outcomes, even though the number of ways to land at heads grows enormously.
Advanced: beyond the simplest picture¶
A subsystem’s entropy can fall while the total rises. Consider two independent two-state populations, and , each with objects, so that their combined entropy is exactly additive: . Suppose starts exactly at its own peak, (), while starts far from its peak, at (). Now let the coupling between them nudge slightly away from its peak, to (, a decrease of about ), while relaxes all the way to its own peak, (, an increase of about ). Subsystem ’s entropy strictly decreased. The total, , strictly increased. Both statements are exact consequences of the same combinatorics used throughout this module. The second law, as this module has derived it, constrains the entropy of an isolated total system; it places no such requirement on any piece of that system considered on its own.
Read that example for what it is: an arithmetic demonstration that the two statements are compatible, not a dynamical account of why would move. In this energy-free two-state model nothing couples to , so the displacement of is stipulated rather than driven. A mechanism needs a conserved quantity the two subsystems actually exchange — energy in module 11, particles in module 13 — and then the direction of the exchange is fixed by requiring the total multiplicity to increase. The arithmetic above is what makes room for a refrigerator: a subsystem’s entropy may fall, provided something else pays more than the difference.
Full Stirling series. The three-term approximation used above is the start of an asymptotic series, . The series does not converge as for fixed number of terms — it is an asymptotic expansion, useful because truncating it after a few terms gives an error smaller than the first omitted term, which is exactly the bound the figure above reflects.
Loschmidt’s paradox and Poincaré recurrence. If the microscopic dynamics are exactly time-reversible, a purist objection follows: any trajectory that spreads out has a time-reversed twin that gathers back up, so how can spreading be typical? The resolution is entirely quantitative, and this module has already computed the relevant number: at , a state just off the even split is suppressed by a factor of 10-88 relative to the peak. A macroscopic gas has , where the analogous suppression factor is inconceivably smaller still. Poincaré’s recurrence theorem guarantees that an isolated, bounded, energy-conserving system does eventually return arbitrarily close to any earlier state, including a “gathered in one corner” state — but for a macroscopic the expected waiting time vastly exceeds the age of the universe. Reversibility of the underlying dynamics and the practical irreversibility of the macroscopic world are both true at once; the numbers above are what reconcile them.
Gibbs paradox, briefly. The isotope-mixing example earlier relied on the two isotopes being genuinely distinguishable species — the entropy of mixing counted above is real and measurable. Mixing two samples of the literally same substance, by contrast, produces no increase in multiplicity at all, because swapping two identical particles does not create a new microstate. Treating identical particles as if they were distinguishable is precisely the mistake that historically produced the paradox; the fix is to divide the naive count by the particles’ indistinguishability, a correction this module’s model sidesteps by keeping its objects explicitly distinguishable (particles by box, coins by flip) throughout.