Each state has exactly neighbours: choose one occupied coordinate and one unoccupied coordinate to swap. The normalized proposal distribution is thereforeThe swap relation is symmetric and the number of neighbours is constant, so . The discrete uniform distribution used as the prior distribution is also constant on , with mass . Both factors cancel in the Metropolis–Hastings acceptance probability.
Let and . The displayed multivariate normal distribution presupposes that the covariance matrix is a positive-definite matrix, so is a symmetric matrix. Expanding the difference of quadratic forms givesConsequentlyThe truncation at zero is essential: a log acceptance ratio can be positive, but the logarithm of an acceptance probability cannot.
For the particular proposed swap, let be the coordinate changing from zero to one and the coordinate changing from one to zero. Then , and the untruncated scalar simplifies further toOnly two rows and four entries of are needed for this evaluation. This is Metropolis sampling on fixed-cardinality subsets.