Statistical Applets: Chi-square Goodness of Fit Test
Suppose you have a large "hopper" of colored candies. You believe each of the 5 colors are represented equally often in the hopper (that is, you think the hopper contains 20% of each color), but you're not sure. To test this hypothesis, you can pour a "bag" of candies, count the number of each color in the bag, and perform a chi-square goodness-of-fit test on the resulting frequencies. The goodness-of-fit test can be used to test any null hypothesis about the underlying population frequencies; in this case we test against the null hypothesis that all 5 colors have the same likelihood of coming out of the hopper.