Subroutines for Computing Exact CHI-Square and Fisher's Exact Probability Tests

Abstract
Algorithms for the exact chi-square test and the Fisher exact probability test are presented. One- and two-tailed probability values for each test are computed recursively. The use of an arbitrary initial value in the recursion provides a significant reduction in computation time over previously published algorithms.