A die is rolled 120 times, giving 25 ones, 17 twos, 15 threes, 23 fours, 24 fives and 16 sixes. Is this consistent with a fair die at α=0.05?
1
State the hypotheses
H0 says the die is fair, so each face has probability 1/6.Ha says at least one face does not. The level is α=0.05.
2
Find the expected counts
A fair die rolled 120 times is expected to show each face 120×1/6=20 times. All six expected counts are at least 5, and separate rolls are independent, so the test applies.
6120=20
3
Add the contributions
The misses from 20 are 5,−3,−5,3,4and −4, and their squares are 25,9,25,9,16and 16. Every expected count is 20, so the six contributions share one denominator.
2025+9+25+9+16+16=5
4
Find the p-value
Six faces give 6−1=5 degrees of freedom. The area to the right of 5 under that chi-square curve is about 0.416. A χ2 equal to its degrees of freedom is just what a fair die tends to give.
5
Decide
0.416>0.05, so fail to reject H0. The counts are consistent with a fair die. That does not prove the die is fair, because a small bias needs many more rolls to show.
Result
χ2=5.0 with 5 degrees of freedom and p≈0.42, so there is no evidence against a fair die.
Your turn
1. One like the example
Another die rolled 120 times gives 35 ones, 10 twos, 15 threes, 23 fours, 24 fives and 13 sixes. Is it fair, at α=0.05?
Show the answer and explanation
No. χ2=21.2 with 5 degrees of freedom and p≈0.0007, so reject H0: the data give convincing evidence that the die is not fair. The 35 ones drive most of it.
The misses from 20 are 15,−10,−5,3,4and −7. Their squares, 225,100,25,9,16 and 49, add to 424, and 424/20=21.2. That is far above the critical value 11.070. The ones alone contribute 225/20=11.25.
6120=2020225+100+25+9+16+49=21.2
2. A variation
A candy maker says its bags are 30% red, 20% yellow and 50% brown. A bag of 200 has 70 red, 30 yellow and 100 brown. Test the claim at α=0.05.
Show the answer and explanation
χ2≈4.17 with 2 degrees of freedom and p≈0.12, so the counts are consistent with the claim.
The expected counts are 200×0.3=60,200×0.2=40 and 200×0.5=100, no longer equal. The contributions are 100/60≈1.667,100/40=2.5and 0. Their sum, about 4.17, is below 5.991, the 5% critical value for 2 degrees of freedom.
A poll of 50 people finds that 60% prefer brand A to brand B. Test an even split. Then suppose 500 people had given the same 60%.
Show the answer and explanation
With 50 people, χ2=2 and p≈0.16, which is no evidence. With 500,χ2=20 and p<0.0001, which is strong evidence.
60% of 50 is 30 and 40% is 20, against 25 each, so χ2=25/25+25/25=2 with 1 degree of freedom. With 500 people the counts are 300 and 200 against 250 each, and χ2=2500/250+2500/250=20. The same percentages give ten times the χ2 from ten times the people.
In Statistics, Distributions shows P(X≥5)≈0.41588 for chi-square with 5 degrees of freedom. The table view gives the 5% critical value, 11.0705, which χ2 would have to exceed to reject H0.