where
a,
b,
c,
d,
e,
f,
g,
h, and
i are the number of observations in each cell,
n is the total sample size, and
is a binomial coefficient. Note: to determine the exact probability for the observed table, the hypergeometric probability must be computed for every possible 3x3 contingency table that is consistent with the row and column sums for the observed table.