Figure 1: Plot of calculated p-values for given test
statistics using numerical integration (red) compared
to the conservative chi-squared bound (dashed blue)
and the Markov inequality bound (dashed green).
The null distribution is uniform on the set f1, 2,3g in
this example. The sharp variations in the calculated
p-values are a result of numerical instabilities, and
the true p-values are bounded by the dashed curves.
We resolve this problem by using a combination of
two conservative approximations to avoid the numerical