One use of a chi-square distribution is with hypothesis tests for multinomial experiments. To see how this hypothesis test works, we will investigate the following two examples. Both examples work through the same set of steps:

- Form the null and alternative hypotheses
- Calculate the test statistic
- Find the critical value
- Make a decision on whether to reject or fail to reject our null hypothesis.

## Example 1: A Fair Coin

For our first example, we want to look at a coin. A fair coin has an equal probability of 1/2 of coming up heads or tails. We toss a coin 1000 times and record the results of a total of 580 heads and 420 tails. We want to test the hypothesis at a 95% level of confidence that the coin we flipped is fair. More formally, the null hypothesis *H*_{0} is that the coin is fair. Since we are comparing observed frequencies of results from a coin toss to the expected frequencies from an idealized fair coin, a chi-square test should be used.

## Compute the Chi-Square Statistic

We begin by computing the chi-square statistic for this scenario. There are two events, heads and tails. Heads has an observed frequency of *f*_{1} = 580 with expected frequency of *e*_{1} = 50% x 1000 = 500. Tails have an observed frequency of *f*_{2} = 420 with an expected frequency of *e*_{1} = 500.

We now use the formula for the chi-square statistic and see that χ^{2} = (*f*_{1} - *e*_{1} )^{2}/*e*_{1} + (*f*_{2} - *e*_{2} )^{2}/*e*_{2}= 80^{2}/500 + (-80)^{2}/500 = 25.6.

## Find the Critical Value

Next, we need to find the critical value for the proper chi-square distribution. Since there are two outcomes for the coin there are two categories to consider. The number of degrees of freedom is one less than the number of categories: 2 - 1 = 1. We use the chi-square distribution for this number of degrees of freedom and see that χ^{2}_{0.95}=3.841.

## Reject or Fail to Reject?

Finally, we compare the calculated chi-square statistic with the critical value from the table. Since 25.6 > 3.841, we reject the null hypothesis that this is a fair coin.

## Example 2: A Fair Die

A fair die has an equal probability of 1/6 of rolling a one, two, three, four, five or six. We roll a die 600 times and note that we roll a one 106 times, a two 90 times, a three 98 times, a four 102 times, a five 100 times and a six 104 times. We want to test the hypothesis at a 95% level of confidence that we have a fair die.

## Compute the Chi-Square Statistic

There are six events, each with expected frequency of 1/6 x 600 = 100. The observed frequencies are *f*_{1} = 106, *f*_{2} = 90, *f*_{3} = 98, *f*_{4} = 102, *f*_{5} = 100, *f*_{6} = 104,

We now use the formula for the chi-square statistic and see that χ^{2} = (*f*_{1} - *e*_{1} )^{2}/*e*_{1} + (*f*_{2} - *e*_{2} )^{2}/*e*_{2}+ (*f*_{3} - *e*_{3} )^{2}/*e*_{3}+(*f*_{4} - *e*_{4} )^{2}/*e*_{4}+(*f*_{5} - *e*_{5} )^{2}/*e*_{5}+(*f*_{6} - *e*_{6} )^{2}/*e*_{6} = 1.6.

## Find the Critical Value

Next, we need to find the critical value for the proper chi-square distribution. Since there are six categories of outcomes for the die, the number of degrees of freedom is one less than this: 6 - 1 = 5. We use the chi-square distribution for five degrees of freedom and see that χ^{2}_{0.95}=11.071.

## Reject or Fail to Reject?

Finally, we compare the calculated chi-square statistic with the critical value from the table. Since the calculated chi-square statistic is 1.6 is less than our critical value of 11.071, we fail to reject the null hypothesis.