  The uniform distribution on matrices with specified row and column sums is
often a natural choice of null model when testing for structure in two-way
tables (binary or nonnegative integer). Due to the difficulty of sampling from
this distribution, many approximate methods have been developed. We will show
that by exploiting certain symmetries, exact sampling and counting is in fact
possible in many nontrivial real-world cases. We illustrate with real datasets
including ecological co-occurrence matrices and contingency tables.
