The chi-square test is used to determine if an observed frequency distribution differs from an expected theoretical distribution. It can test for independence and goodness of fit. Karl Pearson introduced the chi-square test to compare observed and expected frequencies across categories. The test calculates a chi-square statistic and compares it to a critical value to determine if the null hypothesis that the distributions are the same can be rejected. Examples demonstrated how to calculate expected frequencies, the chi-square statistic, degrees of freedom, and compare to critical values to test independence between variables and goodness of fit to theoretical distributions.