Tutorials › Stochastic Processes › Detailed Balance and Reversible Chains

Reversibility and Detailed Balance · Tutorial 259 of 994

Detailed Balance and Reversible Chains

Learn to express reversibility through symmetric stationary flows and distinguish its pairwise balance equations from global stationarity.

Advanced 11 min read

What You'll Learn

  • Define detailed balance and reversibility with respect to a stationary distribution
  • Compute stationary edge flows and check their symmetry
  • Distinguish pairwise balance equations from global stationarity equations
  • Relate a reversible transition matrix to the time-reversed transition matrix
  • Identify when zero stationary probabilities require special care

Pairwise Balance and Reversibility

Stationarity describes how probability mass is distributed after one transition: the total mass arriving at each state agrees with its mass before the transition. Reversibility imposes a more detailed condition. It asks whether, for every pair of states, the stationary probability flow from the first state to the second matches the flow in the opposite direction. Keeping these two levels of balance distinct is important: stationarity is a global, state-by-state equation, whereas detailed balance compares individual pairs.

Let \((X_n)_{n\ge0}\) be a Markov chain on a finite or countable state space \(S\), on a probability space \((\Omega,\mathcal{F},\mathbb{P})\), with discrete time \(n\ge0\) and row-stochastic transition matrix \(P=(p_{ij})\). Thus \(\sum_{j\in S}p_{ij}=1\) for every \(i\). A distribution is a probability row vector \(\pi=(\pi_i)_{i\in S}\). It is stationary when \(\pi P=\pi\), or, coordinate by coordinate, when \(\sum_{i\in S}\pi_i p_{ij}=\pi_j\) for every \(j\).

Definition: Given a stationary distribution \(\pi\), the stationary edge flow from \(i\) to \(j\) is \(f_{ij}=\pi_i p_{ij}\). The chain satisfies detailed balance with respect to \(\pi\) if \(f_{ij}=f_{ji}\) for every \(i,j\in S\), that is, if \(\pi_i p_{ij}=\pi_j p_{ji}\) for every pair. A transition matrix satisfying detailed balance with respect to \(\pi\) is called reversible with respect to \(\pi\).

The edge-flow terminology includes self-loops: \(f_{ii}=\pi_i p_{ii}\), and the balance equation for \(i=j\) holds automatically. For distinct states, the equation matches the two directed flows. The equations are meaningful even when some \(\pi_i=0\). In that case they do not impose a restriction on every transition out of a zero-mass state. For example, if \(\pi_i=0\) and \(\pi_j>0\), detailed balance requires \(p_{ji}=0\), but does not require \(p_{ij}=0\).

The stationarity equations and the detailed-balance equations have different forms. Stationarity at \(j\) sums all incoming flows, \(\sum_i f_{ij}=\pi_j\). Detailed balance instead compares each incoming flow \(f_{ij}\) with the corresponding outgoing flow \(f_{ji}\) separately. Pairwise equations therefore record more local information than the aggregate stationarity equation. A standard result is that detailed balance with respect to a probability distribution implies that the distribution is stationary; the proof of that implication is treated separately. The calculations below check stationarity directly when it is needed, rather than substituting the implication for the check.

Global Flow Conservation and Stationarity

Proposition: Let \(P\) be row-stochastic on a finite or countable state space, and let \(\pi\) be a probability distribution. Define \(f_{ij}=\pi_i p_{ij}\). Then \(\pi\) is stationary if and only if, for every state \(j\), the total incoming flow \(\sum_i f_{ij}\) equals \(\pi_j\). The total outgoing flow from \(i\) is always \(\sum_j f_{ij}=\pi_i\).

Proof. For each fixed \(i\), nonnegativity and the row-sum condition give \(\sum_j f_{ij}=\sum_j\pi_i p_{ij}=\pi_i\sum_jp_{ij}=\pi_i\), including when \(\pi_i=0\). For each fixed \(j\), \(\sum_i f_{ij}=\sum_i\pi_i p_{ij}\), which is exactly the \(j\)-th coordinate of the row vector \(\pi P\). Thus \(\sum_i f_{ij}=\pi_j\) for every \(j\) holds exactly when \(\pi P=\pi\). These sums are well-defined for a countable state space because their terms are nonnegative. \(\square\)

This proposition explains the word “global”: the stationarity condition checks a total at each destination after summing over every possible source. Detailed balance is the pairwise condition \(f_{ij}=f_{ji}\). Do not replace one type of equation with the other when doing a calculation. A direct stationarity check uses incoming sums; a direct detailed-balance check compares pairs.

Worked Example: Symmetric Flows with a Uniform Distribution

Consider the chain on \(S=\{1,2,3\}\) with transition matrix

$$ P= \begin{bmatrix} \tfrac12&\tfrac12&0\\ \tfrac12&\tfrac14&\tfrac14\\ 0&\tfrac14&\tfrac34 \end{bmatrix}. $$

Before using the matrix, check its row sums: row 1 has \(\tfrac12+\tfrac12+0=1\), row 2 has \(\tfrac12+\tfrac14+\tfrac14=1\), and row 3 has \(0+\tfrac14+\tfrac34=1\). Take \(\pi=(\tfrac13,\tfrac13,\tfrac13)\). The stationary edge-flow matrix, whose \((i,j)\) entry is \(\pi_i p_{ij}\), is

$$ (f_{ij})= \begin{bmatrix} \tfrac16&\tfrac16&0\\ \tfrac16&\tfrac1{12}&\tfrac1{12}\\ 0&\tfrac1{12}&\tfrac14 \end{bmatrix}. $$

Every entry has been obtained by multiplying its transition probability by \(\tfrac13\). The flow matrix is symmetric: the two flows between states 1 and 2 are both \(\tfrac16\); those between states 1 and 3 are both 0; and those between states 2 and 3 are both \(\tfrac1{12}\). Diagonal entries match themselves. Hence the detailed-balance equations hold for every pair.

We can also check stationarity directly by computing the incoming flow at each state. The three column sums of the flow matrix are \(\tfrac16+\tfrac16+0=\tfrac13\), \(\tfrac16+\tfrac1{12}+\tfrac1{12}=\tfrac13\), and \(0+\tfrac1{12}+\tfrac14=\tfrac13\). Thus \(\pi P=\pi\), and \(\sum_i\pi_i=1\). This verifies both the pairwise balances and the global equations in this example.

Reversibility and the Reverse Transition Matrix

For a stationary chain with \(\pi_i>0\) at every state under consideration, the reverse transition probability from \(i\) to \(j\) is \(p^*_{ij}=\pi_jp_{ji}/\pi_i\). This formula describes transitions read in the opposite time direction when the chain is stationary. The positivity condition ensures that the division by \(\pi_i\) is defined. If \(\pi\) is stationary, the reverse row sums are one: for a fixed \(i\), \(\sum_j\pi_jp_{ji}/\pi_i=\pi_i/\pi_i=1\), using stationarity at \(i\).

Proposition: Suppose \(\pi\) is stationary and \(\pi_i>0\) for every \(i\in S\). The reverse transition matrix \(P^*\), defined by \(p^*_{ij}=\pi_jp_{ji}/\pi_i\), equals \(P\) if and only if \(P\) satisfies detailed balance with respect to \(\pi\).

Proof. Fix any \(i,j\in S\). The equality \(p^*_{ij}=p_{ij}\), after substituting the definition of \(p^*_{ij}\), is \(\pi_jp_{ji}/\pi_i=p_{ij}\). Since \(\pi_i>0\), multiplying both sides by \(\pi_i\) gives \(\pi_jp_{ji}=\pi_i p_{ij}\), exactly the detailed-balance equation for this pair. Reversing the algebra shows that this detailed-balance equation implies \(p^*_{ij}=p_{ij}\). Since the argument holds for each pair, \(P^*=P\) if and only if all detailed-balance equations hold. \(\square\)

Worked Example: A Nonuniform Reversible Chain

Consider the transition matrix on \(S=\{1,2,3\}\)

$$ P= \begin{bmatrix} \tfrac12&\tfrac12&0\\ \tfrac14&\tfrac12&\tfrac14\\ 0&\tfrac12&\tfrac12 \end{bmatrix}, \qquad \pi=\left(\tfrac14,\tfrac12,\tfrac14\right). $$

Check that the transition rows sum to one: row 1 has \(\tfrac12+\tfrac12+0=1\), row 2 has \(\tfrac14+\tfrac12+\tfrac14=1\), and row 3 has \(0+\tfrac12+\tfrac12=1\). The proposed distribution is normalized because \(\tfrac14+\tfrac12+\tfrac14=1\). Its edge-flow matrix is

$$ (f_{ij})= \begin{bmatrix} \tfrac18&\tfrac18&0\\ \tfrac18&\tfrac14&\tfrac18\\ 0&\tfrac18&\tfrac18 \end{bmatrix}. $$

For the pair \((1,2)\), the two flows are \(\tfrac14\cdot\tfrac12=\tfrac18\) and \(\tfrac12\cdot\tfrac14=\tfrac18\). For \((1,3)\), both are zero. For \((2,3)\), they are \(\tfrac12\cdot\tfrac14=\tfrac18\) and \(\tfrac14\cdot\tfrac12=\tfrac18\). The diagonal equations hold automatically, so detailed balance holds for all pairs.

Now check the global equations separately by summing each column of the flow matrix. The sums are \(\tfrac18+\tfrac18+0=\tfrac14\), \(\tfrac18+\tfrac14+\tfrac18=\tfrac12\), and \(0+\tfrac18+\tfrac18=\tfrac14\). Therefore \(\pi P=\pi\). The reverse transition from 1 to 2 is \(\pi_2p_{21}/\pi_1=(\tfrac12\cdot\tfrac14)/\tfrac14=\tfrac12=p_{12}\). From 2 to 3 it is \(\pi_3p_{32}/\pi_2=(\tfrac14\cdot\tfrac12)/\tfrac12=\tfrac14=p_{23}\); the reverse transition from 2 to 1 is \((\tfrac14\cdot\tfrac12)/\tfrac12=\tfrac14=p_{21}\). The diagonal reverse probabilities equal the original diagonal probabilities by the same formula. Thus the reverse matrix agrees with \(P\), as the proposition predicts.

Worked Example: The Stationary Weights Matter

Let \(S=\{1,2\}\), with

$$ P= \begin{bmatrix} \tfrac34&\tfrac14\\ \tfrac12&\tfrac12 \end{bmatrix}, \qquad \pi=\left(\tfrac23,\tfrac13\right). $$

The rows sum to one: \(\tfrac34+\tfrac14=1\) and \(\tfrac12+\tfrac12=1\). The proposed distribution sums to one. Its flows from 1 to 2 and from 2 to 1 are \(\tfrac23\cdot\tfrac14=\tfrac16\) and \(\tfrac13\cdot\tfrac12=\tfrac16\). The two diagonal flows are \(\tfrac23\cdot\tfrac34=\tfrac12\) and \(\tfrac13\cdot\tfrac12=\tfrac16\), each of which balances with itself. Hence detailed balance holds.

For a direct stationarity check, the incoming total at state 1 is \(\tfrac12+\tfrac16=\tfrac23\), and at state 2 it is \(\tfrac16+\tfrac16=\tfrac13\). Thus \(\pi P=\pi\). Notice that the transition probabilities across the edge are unequal: \(p_{12}=\tfrac14\), while \(p_{21}=\tfrac12\). Reversibility does not require these probabilities to be equal; it requires their stationary flows to agree.

Common Mistakes and Checks

A frequent error is to test reversibility by comparing \(p_{ij}\) directly with \(p_{ji}\), without weighting by the stationary probabilities. In the two-state example, that incorrect test says \(\tfrac14\ne\tfrac12\), so it labels the chain nonreversible. The correction is to use the detailed-balance equation: \(\pi_1p_{12}=\tfrac23\cdot\tfrac14=\tfrac16\), while \(\pi_2p_{21}=\tfrac13\cdot\tfrac12=\tfrac16\). The flows match, so the chain is reversible with respect to \(\pi\).

Another error is to treat a stationarity equation as though it matched every pair of transitions. The equation at state \(j\) is the single sum \(\sum_i\pi_i p_{ij}=\pi_j\); it does not itself list pairwise comparisons. Conversely, checking only one pair cannot establish the full collection of detailed-balance equations. For finite chains, a practical check is to verify that \(\pi\) is a probability distribution, check the transition row sums, and then compute the required flows for every distinct pair, along with the global column sums when stationarity must be confirmed directly.

When a stationary distribution has zero entries, do not use the reverse-transition formula by dividing by those entries. The pairwise detailed-balance equations remain defined, but the reverse transition formula above requires positive \(\pi_i\) for its row \(i\). In an irreducible finite chain the stationary distribution is positive at every state; without such a condition, the positivity needed for this formula must be checked rather than assumed.

Check Your Understanding

Use the definitions and verify calculations by substituting into the relevant equations.

  1. For the three-state chain in the first example, calculate the flow from state 2 to state 3 and the reverse flow. What equation expresses their balance?
  2. State the difference between the global stationarity equation at \(j\) and the detailed-balance equation for the pair \((i,j)\).
  3. For the two-state example, show why comparing \(p_{12}\) and \(p_{21}\) alone gives the wrong reversibility test.
  4. Write the reverse transition formula and identify the condition needed to divide by \(\pi_i\).
  5. For a countable state space, why are the total outgoing and incoming flows well-defined as nonnegative sums?