Detailed balance (source code)

= Detailed balance
{wiki}

= Detailed balance equations
{synonym}

For a <Markov chain> with <transition matrix> $P$, <Detailed balance> with a <probability distribution> $\pi$ <means>
$$
\pi_iP_{ij}=\pi_jP_{ji}\qquad\text{for every }i,j.
$$
The left side is the equilibrium <Probability> of the directed transition $i\to j$; <Detailed balance> equates it to the reverse flow. Summing over $i$ gives $\sum_i\pi_iP_{ij}=\pi_j\sum_iP_{ji}=\pi_j$, so <Detailed balance> implies <stationary distribution>[stationarity]. Under the stationary initial law, repeated application of the pairwise identity equates a finite path's <Probability> to that of its reversal, establishing <reversible Markov chain>[reversibility].<Mixing Time Bounds via the Spectral Profile by Sharad Goel and others>[Section 1.1: invariant measure and reversibility]{ref}

For example, take
$$
P=\begin{pmatrix}1-a&a\\b&1-b\end{pmatrix},\qquad
\pi=\left(\frac b{a+b},\frac a{a+b}\right),\qquad 0<a,b<1.
$$
The off-diagonal flows are both $ab/(a+b)$, which verifies <Detailed balance> and the <Stationary distribution> directly. A directed three-state cycle has a uniform <Stationary distribution> but no reverse transitions, so it is not reversible. <stationary distribution>[Stationarity] alone therefore does not imply <Detailed balance>, and <Detailed balance> alone does not imply rapid convergence.