Total variation and mixing times
Measure distinguishability from equilibrium with an explicit worst-case convention and compute an exact two-state mixing time.
On this page
The question for today
What you’ll understand
- Compute total variation with its factor of one half and event supremum.
- Distinguish a fixed-start distance from the worst-case mixing profile.
- Find the first integer time satisfying a mixing tolerance.
Convergence to equilibrium becomes useful only after specifying a distance, an initial-state convention and an acceptable error. Total variation measures the largest discrepancy in the probability of any event, making it suitable for statements about approximate sampling. A small error for the state used by a demonstration does not automatically control every other initial state. This lesson defines worst-case mixing on finite irreducible aperiodic chains and uses an exactly solvable example to expose both that distinction and the importance of rounding the required time upward to an integer.
One distance, two equivalent descriptions
For probability laws μ and ν on a finite or countable space, total variation is half the sum of absolute coordinate differences. It also equals the supremum of their difference over events, achieved by collecting coordinates where μ exceeds ν. Its values lie between zero and one under this convention. Some authors omit the factor one half when discussing an L¹ norm, so a claimed error should always identify its convention. On two states, the two coordinate discrepancies have equal magnitude, and total variation is simply the discrepancy in either single-state probability.
Applying a common Markov kernel cannot increase total variation. One proof writes an event probability after the kernel as an average of a function valued between zero and one, whose expectation discrepancy is bounded by the same event supremum. If π is stationary, this gives monotone distance to equilibrium for each fixed start and also for the worst-case maximum. Individual coordinates can still oscillate around equilibrium when an eigenvalue is negative. Monotonicity concerns the absolute distributional distance, not monotonicity of each probability bar in a diagram.
Worst-case time means all initial states
For a finite irreducible aperiodic kernel, define d(t) as the maximum over starting states of the distance between its t-step law and π. The ε-mixing time is the smallest nonnegative integer with d(t) at most ε. A mixture of starts cannot do worse than the worst point mass, by convexity, so this also controls arbitrary initial laws. The conventional unqualified mixing time often uses ε equal to one quarter, but a different tolerance must be stated explicitly rather than hidden in a numerical report.
The finite convergence theorem ensures this time is finite for every positive tolerance. Removing aperiodicity can make it infinite, and removing finiteness can leave the supremum over starts equal to one at every finite time even when each individual start converges. These qualifications matter when interpreting practical diagnostics. An observed average from one run can be accurate for a particular function while the entire distribution is still far in total variation. Conversely, a rigorous total-variation bound controls all bounded event questions simultaneously and therefore supplies a distributional guarantee rather than a visual convergence judgment.
A two-state profile can be solved exactly
Write p for the probability from zero to one and q for the probability back. When both are positive, the stationary masses are q/(p+q) and p/(p+q). Subtracting the stationary value from the one-state probability shows that each transition multiplies the discrepancy by 1−p−q. Therefore its absolute value contracts by the modulus of that number. The fixed start at zero has prefactor π(1), while the fixed start at one has prefactor π(0); taking the larger prefactor gives the worst-case profile.
When p+q is one, every row already equals π, so all initial laws reach stationarity in one transition. When p=q=1, the contraction modulus is one and a point-mass law never converges. Between these endpoints, solving a logarithmic inequality gives a real threshold that must be rounded upward, with a separate check when time zero already meets the tolerance. A negative multiplier creates alternating convergence but does not justify discarding every second transition or redefining the step count. The kernel, rather than the playback duration in seconds, determines the mathematical time.
Work it through
A lab start can be closer than the worst start
For p=1/5,q=2/5, compute d(t) and the worst-case mixing time at tolerance 1/20. Compare the distance from initial state zero.
The stationary law is (2/3,1/3), and the discrepancy multiplier is 1−p−q=2/5.
The worst prefactor is 2/3, attained from state one, so d(t)=(2/3)(2/5)ᵗ. Starting from zero gives only (1/3)(2/5)ᵗ.
At t=2 the worst distance is 8/75, above 1/20. At t=3 it is 16/375, below 1/20. Monotonicity proves that the first qualifying integer is three.
The worst-case mixing time is three transitions. From zero the distance at t=2 is 4/75, still slightly above the requested tolerance; its prefactor is nevertheless only half the worst-case one.
The living notebook
Explore the model
Interactive lab · markov
Compute distance from the displayed state-0 start
Pause and Reset, then set p=0.20,q=0.40. Predict P(state 1)=0.28 after two Steps and stationary P(state 1)=1/3, so the displayed-start TV error is 4/75. For a fresh comparison Reset and set p=0.40,q=0.20. After two Steps predict P(state 1)=0.56 versus stationary 2/3, giving error 8/75. The exchange uses state 0 to show the other initial-state error; stationary readouts do not themselves report the current error.
- P(state 1) at step 0
- 0%
- Stationary P(state 1)
- 60%
- Chain behavior
- Monotone convergence
Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA fixed-start display and a worst-case mixing guarantee can differ by a substantial prefactor.
Pause & reason
Check your understanding
Your turn
Try it yourself
Take p=4/5,q=3/5. Find the worst-case profile and mixing time at tolerance 1/10. Explain whether alternating probability bars prevent mixing.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use stationary masses 3/7 and 4/7, and retain the sign of the second eigenvalue before taking absolute values.
Compare with the solution
The discrepancy multiplier is −2/5. The worst prefactor is 4/7, hence d(t)=(4/7)(2/5)ᵗ. At t=1 this is 8/35, above 1/10; at t=2 it is 16/175, below 1/10. Thus the mixing time is two. The sign makes coordinates alternate across their stationary values, but the absolute distance decreases geometrically. Alternation alone differs from the nondecaying periodic case with multiplier −1.
Keep the idea
Take it with you
- Total variation here is half the L¹ discrepancy.
- Worst-case mixing maximizes over initial states and uses integer transition time.
- Oscillating coordinates can converge while the TV distance decreases monotonically.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.