Chalk−1

Math · Introductory statistics · Worked example

Test whether a die is fair

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?

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.

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.

1206=20

Add the contributions

The misses from 20 are 5, −3, −5, 3, 4 and −4, and their squares are 25, 9, 25, 9, 16 and 16. Every expected count is 20, so the six contributions share one denominator.

25+9+25+9+16+1620=5

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.

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, 4 and −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.

1206=20225+100+25+9+16+4920=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.5 and 0. Their sum, about 4.17, is below 5.991, the 5⁢% critical value for 2 degrees of freedom.

200⋅0.3=60200⋅0.2=40200⋅0.5=100(70−60)260≈1.667(30−40)240=2.51.667+2.5+0≈4.17

3. Somewhere new

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.

(30−25)225+(20−25)225=2(300−250)2250+(200−250)2250=20

Keep exploring

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.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Find the p-value in Statistics Check χ2 in Math Study the 6 key terms Open worked example on a board Statistics formulas in Math Reference

Your existing work stays on this device. Examples open as editable copies.