Chi-Square Goodness of Fit Test
Problem
Roll a die 120 times: observed {18,22,16,20,24,20}. Is it fair? Expected: 20 each. Compute χ² and p-value.
Explanation
What is the chi-square goodness of fit test?
The test checks whether observed frequencies match expected frequencies. Is the die fair? Are the survey responses distributed as expected?
The formula
where = observed count and = expected count for each category.
Step-by-step: Is this die fair?
Data: 120 rolls. Observed: . If fair, expected: for each face.
Step 1 — State hypotheses.
: Die is fair (all faces equally likely). : Die is not fair.
Step 2 — Compute :
Step 3 — Degrees of freedom: .
Step 4 — Find the p-value. From a table with : gives .
Step 5 — Decision. . Fail to reject . No evidence the die is unfair — the deviations are within normal random variation.
Interpreting the value
- Large (small p-value): observed is far from expected → reject .
- Small (large p-value): observed is close to expected → fail to reject.
Try it in the visualization
Adjust the observed counts for each face. The bar chart compares observed vs expected. and the p-value update live. Adjust counts to make the die obviously unfair and see spike.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.