This Demonstration performs a goodness-of-fit test on a set of random samples of a given sample size from a finite population. The count for each subset is indicated by a point; the expected value is indicated by the horizontal line. Tooltips on each show the values. The "trial" slider controls a seed for the random number generator, and gives a new set of samples for each value. The -value () is the probability that another set of truly random samples would be as far or farther away from the expected value (as measured by ).

Contributed by: Michael Rogers (Oxford College of Emory University)

This Demonstration shows that the random sample function in Mathematica seems to choose each possible sample with (at least approximately) equal likelihood. The -value ranges over the interval [0,1]. This Demonstration does not show that the -values have a uniform distribution, but a user could keep track of the -values and plot his or her own distribution.