Take balls numbered to and two urns, A and B. Every second, draw a number uniformly at random from to and move the ball with that number to the other urn. Start with all balls in A. The count in A drops, at first by nearly one ball per step, then more slowly, and settles into fluctuations around that never stop. Run the film backward and the same rule describes it: the process is reversible, and every configuration, the starting one included, is revisited eventually with probability one. This is the Ehrenfest urn, proposed by Paul and Tatiana Ehrenfest in 1907 as a model in which the approach to equilibrium and the recurrence of the initial state can both be computed, and in which the apparent conflict between them turns out to be a statement about time scales. Every quantity below is exact.
A walk on the corners of the cube
The state of the system is the set of balls in A, a binary vector with when ball is in A. One step flips one uniformly chosen coordinate. So the urn process is the simple random walk on the corners of the -dimensional cube, each corner joined to its neighbors at Hamming distance , and the number of balls in A is the Hamming weight of the current corner, the level of the post on the spiky cube.
Every corner has the same number of neighbors, so the stationary distribution of the walk is uniform over the corners, and the stationary distribution of the count of balls in A is the number of corners at each level, normalized:
The equilibrium of the urn is the binomial distribution, the spiky cross-section of the earlier post: in the long run the process spends time at level in proportion to the width of that drawing at level . The count itself is a Markov chain on , moving from to with probability (a ball in A was drawn) and to with probability . That is stationary for it is the detailed balance identity , whose two sides both count the edges of the cube between levels and .
The binomial has mean and standard deviation . For the equilibrium count is ; the stationary probability of finding or more balls in A is , and of finding all there, . In equilibrium, the state the process was started in is, together with its mirror image, the least probable state there is.
The mean relaxes exponentially
From level , the next count is with probability and otherwise, so
The same recursion holds for the imbalance . Subtract from both sides and use to get
Iterating, . The expected imbalance between the urns decays geometrically, with time constant steps. This is Newton’s law of cooling for two bodies exchanging heat, and it has been obtained from a reversible rule by taking an expectation; nothing irreversible was put in. Starting from all balls in A, the expected imbalance shrinks to the size of the equilibrium fluctuations, , after steps: about steps for . The same is the mixing time of the cube walk: Diaconis, Graham and Morrison (1990) proved that the walk (in a version allowed to stay put) is far from uniform before steps and close to uniform shortly after.
The factor is the second largest eigenvalue of the transition matrix, and the full spectrum is also explicit. On the cube, the walk is diagonalized by the parity functions , one for each subset of coordinates: flipping a random coordinate changes the sign of exactly when the coordinate lies in , which happens with probability , so is an eigenvector with eigenvalue . The eigenvalues of the count chain are therefore
a result of Kac (1947), and on the cube the eigenvalue has multiplicity : the binomial coefficient appears a third time, now as a spectral multiplicity. The second moment obeys a recursion of the same kind, , with as its factor, so the variance of the count at every time is also a closed computation, and the widget below uses both recursions.
Reversibility gives a statement about the past as well. In the stationary process, detailed balance means the film run backward has the same law as the film run forward, so for every , , and , and in particular
Conditional on an unusual count now, the expected past is the mirror image of the expected future: the count rose to along the same exponential curve it is about to descend. An imbalance observed in equilibrium is, in expectation, the top of a symmetric peak, not the start of a decay. This is the picture Boltzmann gave in his 1896 reply to Zermelo, and here it is a two-line consequence of detailed balance.
Return times
The return times follow from a formula of Kac. For an irreducible Markov chain with stationary distribution , the expected time to return to a state , starting from , is
For the proof, run the chain in its stationary regime. For each , the event that the most recent visit to at or before time occurred exactly steps ago has probability by stationarity. These events are disjoint and, since the chain visits infinitely often, their union is certain, so , and the sum is . (Periodicity is no obstacle: the count chain alternates parity, and the formula holds regardless.)
For the urn, then,
The all-in-A state returns, on average, after exactly steps. The balanced state returns after steps. As a function of the level, the expected return time is the binomial turned upside down: on a logarithmic scale it is , a U with its floor at in the middle and its rims at . The spiky cube, seen through return times, is a valley with two cliffs.
| return to all-in-A | return to balanced | all-in-A to balanced | |
|---|---|---|---|
| 10 | 1,024 | 4.1 | 8.9 |
| 20 | 5.7 | 21.3 | |
| 50 | 8.9 | 64.8 | |
| 100 | 12.6 | 146.9 |
The last column is the expected number of steps to go from the all-in-A state down to the balanced state for the first time, from the standard formula for hitting times of a birth–death chain: the expected time to step from to is with , and the reverse direction is the mirror image. Summing these over the levels between and gives for ; summing the reverse formula from up to gives , a little more than itself. Going down takes a hundred-odd steps and going back up takes , and both numbers come from the same reversible rule.
With balls and one move per microsecond, the initial state recurs about once a second, and the recurrence is observable. With and one move per nanosecond, the expected wait is nanoseconds, thirteen days. With it is years, three thousand times the age of the universe; a mole of molecules puts near . Recurrence is a theorem, and for of macroscopic size it is unobservable. The widget computes the exact mean and variance of the count from the all-in-A start, and the exact return-time landscape, for any :
The two objections
Boltzmann’s H-theorem of 1872 derived, from the kinetic equation for a dilute gas, a quantity that can only decrease in time. Two objections followed. Loschmidt’s, in 1876, is the reversibility objection: the equations of mechanics are symmetric under time reversal, so for every motion in which decreases there is a reversed motion in which it increases, and a monotone cannot follow from mechanics alone. Zermelo’s, in 1896, is the recurrence objection: by Poincaré’s recurrence theorem (1890), an isolated mechanical system with bounded energy returns arbitrarily close to its initial state, so cannot decrease forever. Boltzmann’s replies of 1896 and 1897 made the statistical position explicit: the theorem is about overwhelmingly probable behavior, the recurrence times of macroscopic systems are far longer than any observation, and the -curve of a system in equilibrium is a sequence of symmetric fluctuation peaks.
In the urn, each of these statements is a calculation. It is reversible (detailed balance holds), and its expected count nevertheless decays monotonically toward from any start, with the decay curve’s mirror image as the expected past. It is recurrent, with the initial state returning after exactly steps on average, and steps exceed any feasible observation for in the hundreds, while the relaxation takes steps. The 1907 paper of Paul and Tatiana Ehrenfest was written to exhibit this, and the mathematics was completed by Kac in 1947: the spectrum in one paper and the recurrence formula in another, both in 1947. Siegert (1949) treated the approach to equilibrium in related gas models. The urn is now a standard textbook example, both of a reversible chain with a computable spectrum and of a chain obtained by projecting a larger one (the cube walk onto the count), in Levin, Peres and Wilmer.
References
- Paul Ehrenfest, Tatiana Ehrenfest. Über zwei bekannte Einwände gegen das Boltzmannsche H-Theorem. Physikalische Zeitschrift, 8:311–314, 1907. The urn, introduced to answer the reversibility and recurrence objections.
- Mark Kac. Random walk and the theory of Brownian motion. The American Mathematical Monthly, 54(7):369–391, 1947. The eigenvalues and the full solution of the urn.
- Mark Kac. On the notion of recurrence in discrete stochastic processes. Bulletin of the American Mathematical Society, 53(10):1002–1010, 1947. The return-time formula .
- Arnold J. F. Siegert. On the approach to statistical equilibrium. Physical Review, 76:1708–1714, 1949. The approach to equilibrium in related gas models.
- Persi Diaconis, Ronald L. Graham, John A. Morrison. Asymptotic analysis of a random walk on a hypercube with many dimensions. Random Structures & Algorithms, 1(1):51–72, 1990. The cutoff at .
- David A. Levin, Yuval Peres, Elizabeth L. Wilmer. Markov Chains and Mixing Times. 2nd edition, American Mathematical Society, 2017. Section 2.3, the hypercube and the Ehrenfest urn; Section 2.5, hitting times of birth–death chains; Chapter 21, the return-time lemma.
- Ludwig Boltzmann. Entgegnung auf die wärmetheoretischen Betrachtungen des Hrn. E. Zermelo. Annalen der Physik, 293(4):773–784, 1896. The reply to the recurrence objection.
- Ernst Zermelo. Ueber einen Satz der Dynamik und die mechanische Wärmetheorie. Annalen der Physik, 293(3):485–494, 1896. The recurrence objection.