Entropy and the Second Law
Why does a gas spread out but never gather itself back into a corner? Count the microstates and the direction of time appears.
Free expansion of a gas
All particles start in the left half. Remove the partition and they spread out. Nothing pushes them right; there are simply far more ways to be spread out.
Particles do not collide with each other, so each one wanders independently.
The partition is in place. Remove it to start the expansion. For large N the fraction hugs 1/2. A spontaneous return to the left side is possible in principle but you would wait far longer than the age of the universe.
Heat flow between a hot and a cold block
Two identical blocks touch. Heat flows from hot to cold until they share one temperature, and the total entropy only goes up.
Right now a parcel of 100 J leaving A at 500 K and entering B at 250 K changes the total entropy by 100 / 250 − 100 / 500 = +0.200 J/K. The reverse transfer, cold to hot, would give -0.200 J/K, which the second law forbids. The flow stops at 375 K, where the gain becomes zero.
What entropy measures
Put N gas particles in a box and ask only how many are in the left half. If n are on the left, the number of ways to choose which particles those are is the binomial coefficient Ω = C(N, n). Boltzmann defined the entropy of that macrostate as S = k ln Ω.
With the partition in place every particle is on the left, so Ω = 1 and S = 0. Once the partition is gone the even split has by far the most microstates: for N = 100 there are about 10²⁹ ways to split 50/50 but only one way to have all 100 on the left. Each particle moves at random, so the gas drifts towards the states that make up almost all of the possibilities and stays there.
That is the second law of thermodynamics: the entropy of an isolated system does not decrease. It is not a force but overwhelming probability. With 4 particles you will see them all return to the left within seconds. With a mole of gas the odds are 1 in 2^(6 × 10²³), so it never happens.
Key formulas
Boltzmann entropy
S = k ln Ω
- k
- Boltzmann constant, 1.381 × 10⁻²³ J/K
- Ω
- number of microstates for the macrostate
Particles split between two halves
Ω(n) = C(N, n) = N! / (n! (N − n)!)
- n
- particles in the left half
ln N! is computed as ln 1 + ln 2 + … + ln N, so huge numbers never overflow.
Clausius entropy change
ΔS = Q / T
- Q
- heat transferred reversibly (J)
- T
- absolute temperature (K)
Heat flowing from hot to cold
ΔStotal = Q / Tcold − Q / Thot > 0
Free expansion to double volume: ΔS = N k ln 2
How to use this visualizer
- 1Choose the number of particles N. Changing N puts all particles back in the left half.
- 2Press Remove partition and watch the blue fraction-on-the-left curve fall to about one half while S / Smax climbs to about 1.
- 3Try N = 4 or 6. The curve jumps around and the gas regularly gathers on the left again; the counter shows how often.
- 4Now try N = 400. The curve barely wiggles and the probability of a return, 2^−N, is around 10^−120.
- 5In the heat-flow panel, set the two starting temperatures and press Start contact. The hot block loses less entropy than the cold block gains, so the total rises until both reach the average temperature.
Why big systems never run backwards
| Particles N | P(all on left) = 2^−N | Typical fluctuation |
|---|---|---|
| 2 | 1 / 4 | ≈ 0.35 |
| 10 | 1 / 1024 | ≈ 0.16 |
| 100 | ≈ 10^−30 | ≈ 0.05 |
| 1,000 | ≈ 10^−301 | ≈ 0.016 |
| 6 × 10²³ (1 mol) | 10^(−1.8 × 10²³) | ≈ 10⁻¹² |
Key ideas
Microstates and macrostates
Entropy counts possibilities
Irreversibility is statistics
Heat flows downhill
Practice problems
Problem 1: Counting microstates
Show solutionHide solution
Ω(3) = C(6, 3) = 6! / (3! 3!) = 20
Ω(6) = C(6, 6) = 1
ΔS = k ln 20 − k ln 1 = k ln 20
ΔS ≈ 3.00 k; the even split is 20 times as likely
Problem 2: Heat between two reservoirs
Show solutionHide solution
Hot reservoir: ΔS = −Q / T = −1200 / 600 = −2.0 J/K
Cold reservoir: ΔS = +Q / T = 1200 / 300 = +4.0 J/K
Total: −2.0 + 4.0 = +2.0 J/K
ΔSuniverse = +2.0 J/K > 0, so the process is allowed
Reversing it would give −2.0 J/K, which is why heat never flows from cold to hot on its own.
Discussion
Questions, ideas or a different approach? Join the conversation.