Second Law of Thermodynamics

Why gas never un-spreads

A box of particles, one gate, and the whole idea of entropy. Watch it happen below, then run it yourself.

drag to rotate · pinch / scroll to zoom
Live readout
occupancy
1
microstates Ω for this macrostate
0.00
entropy, S / kB = ln Ω
ln Ω vs time since release

It's not a force. It's just counting.

Nothing pushes the particles apart. Every exact arrangement is equally likely — there's just only one way to have all of them crowded on the left, and an almost unimaginable number of ways to have them spread across both halves. Once the gate opens, plain probability carries the system toward whichever split has the most microstates.

A macrostate is what you can measure from the outside — just the count, "2 left, 2 right." A microstate is the full, exact arrangement — which particles are where. Many microstates can look like the same macrostate. Ω counts exactly how many.

all 5 possible macrostates — 4 particles split across 2 cells
4∣0
Ω=1
3∣1
Ω=4
2∣2
Ω=6
1∣3
Ω=4
0∣4
Ω=1
16 microstates total (2⁴), spread unevenly across those 5 macrostates — the middle one alone holds more than a third of them. Zooming into two of the five below:
Macrostate: 2 left / 2 right
A BC D
A CB D
A DB C
B CA D
B DA C
C DA B
6 different microstates — 6 ways to choose which 2 of the 4 particles sit on the left. Same macrostate every time. Ω = 6.
Macrostate: 4 left / 0 right
A B C D—
Only one microstate can look like this — there's no other way to arrange it. Ω = 1.

The box above works the same way, just arranged as a full 3D grid of cube cells instead of 2 — that's why Ω gets astronomically bigger once the particles spread out.

Ω — all in cell 0
1
Ω — current macrostate
1
Ω — max-entropy macrostate
…
S = kB ln Ω

Boltzmann's formula. More microstates behind a macrostate means more entropy — that's the entire definition. For a real mole of gas (N ≈ 6×10²³) this same logic, scaled up, is where ΔS = nR ln(V₂/V₁) comes from.

JEE formula reference

Same idea, exam-ready.

Definition
ΔS = Qrev / T
Entropy change for heat exchanged reversibly at temperature T.
Second law
ΔSuniverse ≥ 0
Equality only for reversible processes; every real process gives > 0.
Isothermal (ideal gas)
ΔS = nR ln(V₂/V₁)
Equivalently nR ln(P₁/P₂). Temperature constant.
Free expansion
ΔS = nR ln(V₂/V₁)
Same formula as isothermal — S is a state function, even though Q = W = 0 in the actual process.
General process
ΔS = nCv ln(T₂/T₁) + nR ln(V₂/V₁)
Both temperature and volume change.
Reversible adiabatic
ΔS = 0
Isentropic — Q = 0 and reversible together give no entropy change.
Phase change
ΔS = L / T
At the constant T of melting or boiling; L is latent heat.
Statistical (Boltzmann)
S = kB ln Ω
The microscopic origin of every formula above.

The same arrow of time, everywhere

Ice melting
Rigid lattice → free-moving molecules. Far more ways to arrange the liquid.
Perfume in a room
Exactly this simulation — a gas spreading to fill the volume available to it.
Salt in water
Ordered crystal → dispersed ions. Dissolving is entropy-driven.
Heat: hot → cold
Never spontaneously reverses. This is the Clausius statement of the 2nd law.