TNK LAB

Two Paramagnets Thermalizing

Paramagnet A (NA dipoles) and Paramagnet B (NB dipoles) share a fixed pool of m up-spins between them. Each step, one dipole in A and one in B are picked at random; if they point opposite ways they attempt to swap orientations — whether the swap succeeds depends on how many more ways the combined system has to arrange itself afterward. Watch temperature equalize and total entropy climb toward its maximum — and watch what happens when a paramagnet gets pushed past half its dipoles pointing up.

Capped at NA+NB — can't have more up-spins than dipoles.
0 = pack as many up-spins into B as possible, 1 = pack as many into A as possible.

State

Exchange Attempts: 0

NA↑ (up-spins in A): -
NB↑ (up-spins in B): -
UA (μB0): -
UB (μB0): -
TA (μB0/kB): -
TB (μB0/kB): -

Entropy (units of kB)

Stotal = ln ΩAΩB: -
Smax (true peak): -
Fraction of Smax reached: -

How This Is Calculated

$$\Omega(N,N_\uparrow) = \binom{N}{N_\uparrow}, \qquad S = k_B \ln(\Omega_A\Omega_B)$$
Ω(N,N↑) is the number of ways to choose which N↑ of N distinguishable dipoles point along the field. Statistical temperature follows from $$\frac{1}{T} = \frac{\partial S}{\partial N_\uparrow} \approx \ln\Omega(N,N_\uparrow{+}1) - \ln\Omega(N,N_\uparrow)$$
Unlike an Einstein solid's quanta (which can pile up without limit, so this derivative is always positive), a paramagnet's up-spin count is capped at N — S(N↑) is a symmetric hump, not a monotonic climb, so T can come out negative past the halfway point. That's not a bug; see the bonus note below.
Each attempted exchange picks one random dipole from A and one from B; if they point opposite ways, the swap is accepted with probability min(1, Ωnewold) — a Metropolis step, identical in spirit to sim15's quantum hop. Weighting by Ω is what makes the walk settle at equal temperature rather than equal energy.
Why does entropy increase?
Ωtotal(NA↑) = Ω(NA,NA↑)·Ω(NB,m−NA↑) counts every microstate consistent with a given split. For large N and m this product is astronomically peaked at one particular split — the one where TA=TB. Almost every microstate the combined system could possibly be in belongs to that peak.
No individual swap "knows" this. Each one is a local, reversible coin flip weighted only by the immediate Ω ratio — swaps toward lower S do happen, just exponentially less often as N grows. What looks like an irreversible, one-directional climb in Stotal(t) is really millions of small reversible steps whose net statistical bias is overwhelming.
Bonus: watch temperature go negative
Set Initial Skew Toward A close to 1 with NA < m — that forces NA↑ above NA/2 at the start, a "population-inverted" state that holds more energy than the maximum-entropy NA↑=NA/2 configuration.
Hit Run and watch TA in the temperature chart: it starts negative, shoots to ±∞ as NA↑ crosses NA/2, then settles positive as the system relaxes toward equilibrium — exactly the textbook negative-temperature story, playing out step by step instead of frozen in a table.

Two Paramagnets

Up spin (along field)
Down spin (against field)
Every dipole shown individually — only two flip per accepted exchange.

Temperature vs. Time

TA
TB
Gaps = T passed through ±∞ between frames.

Total Entropy vs. Time

Stotal(t)
Smax (true peak)

Entropy Landscape Stotal(NA↑)

All accessible splits
Current NA↑