Myers, James, et al. “Exact Conditional Inference for Two-Way Randomized Bernoulli Experiments”. Journal of Statistical Software, Code Snippets, vol. 21, no. 1, Sept. 2007, pp. 1-7, doi:10.18637/jss.v021.c01.