SME
Grade 12 Math · Problem type

Goodness of fit with five categories

Use this for “Do 200 lunch choices fit the shares 30%, 25%, 20%, 15% and 10%?”

Chart

X² = 4.3202468101214161820χ²reject H₀ (area α)p-value
Chi-square curve with df = 4.
Critical value at α = 0.05: χ² = 9.4877.
X² = 4.32: p = P(χ² ≥ 4.32) = 0.3644 ≥ α = 0.05: fail to reject H₀.
This is an example. Type your own values to start a new problem.
O₁
Count for choice 1
example
O₂
Count for choice 2
example
O₃
Count for choice 3
example
O₄
Count for choice 4
example
O₅
Count for choice 5
example
p₁
Expected share of choice 1
example
p₂
Expected share of choice 2
example
p₃
Expected share of choice 3
example
p₄
Expected share of choice 4
example
p₅
Expected share of choice 5
worked out (not typed)
n
Choices in all
worked out (not typed)
X²
Chi-square statistic
worked out (not typed)
P
p-value
worked out (not typed)
α
Significance level
example

Formulas

p₅
=
1
−
p₁
−
p₂
−
p₃
−
p₄
0.1 = 1 − 0.3 − 0.25 − 0.2 − 0.15
n
=
O₁
+
O₂
+
O₃
+
O₄
+
O₅
200 = 66 + 44 + 40 + 36 + 14
X
2
=
(
O₁
−
n
×
p₁
)
2
÷
(
n
×
p₁
)
+
(
O₂
−
n
×
p₂
)
2
÷
(
n
×
p₂
)
+
(
O₃
−
n
×
p₃
)
2
÷
(
n
×
p₃
)
+
(
O₄
−
n
×
p₄
)
2
÷
(
n
×
p₄
)
+
(
O₅
−
n
×
p₅
)
2
÷
(
n
×
p₅
)
4.32
=
(66 − 200 × 0.3)
2
÷
(200
×
0.3)
+
(44 − 200 × 0.25)
2
÷
(200
×
0.25)
+
(40 − 200 × 0.2)
2
÷
(200
×
0.2)
+
(36 − 200 × 0.15)
2
÷
(200
×
0.15)
+
(14 − 200 × 0.1)
2
÷
(200
×
0.1)
P
=
χ
2
cdf(
X
2
,
∞,
4)
0.3644
=
χ
2
cdf(4.32,
∞,
4)

Assumptions

•
H₀: the five shares are p₁ to p₅; they add to 1, so p₅ is what is left.
•
Every expected count n × p should be at least 5; df = 5 − 1 = 4.
•
A large X² (a small p-value) means the counts don’t fit the shares.

Step-by-step

WE KNOW
O₁ = 66, O₂ = 44, O₃ = 40, O₄ = 36, O₅ = 14, p₁ = 0.3, p₂ = 0.25, p₃ = 0.2, p₄ = 0.15, α = 0.05
FIND
expected share of choice 5 (p₅), choices in all (n), chi-square statistic (X²), p-value (P)
Step 1 · Find expected share of choice 5 (p₅)
Use p₅ = 1 − p₁ − p₂ − p₃ − p₄
The five shares make up the whole, 1.
p₅
=
1
−
0.3
−
0.25
−
0.2
−
0.15
p₅
=
0.1
Step 2 · Find choices in all (n)
Use n = O₁ + O₂ + O₃ + O₄ + O₅
Add the counts for the size of the sample.
n
=
66
+
44
+
40
+
36
+
14
n
=
200
Step 3 · Find chi-square statistic (X²)
Use X² = (O₁ − n × p₁)² ÷ (n × p₁) + (O₂ − n × p₂)² ÷ (n × p₂) + (O₃ − n × p₃)² ÷ (n × p₃) + (O₄ − n × p₄)² ÷ (n × p₄) + (O₅ − n × p₅)² ÷ (n × p₅)
The
expected
counts
are
E
=
n
×
p:
60,
50,
40,
30,
20.
Add
(O − E)
2
÷
E
over
the
five
choices.
X
2
=
(66 − 200 × 0.3)
2
÷
(200
×
0.3)
+
(44 − 200 × 0.25)
2
÷
(200
×
0.25)
+
(40 − 200 × 0.2)
2
÷
(200
×
0.2)
+
(36 − 200 × 0.15)
2
÷
(200
×
0.15)
+
(14 − 200 × 0.1)
2
÷
(200
×
0.1)
X
2
=
(66 − 60)
2
÷
60
+
(44 − 50)
2
÷
50
+
(40 − 40)
2
÷
40
+
(36 − 30)
2
÷
30
+
(14 − 20)
2
÷
20
X
2
=
36
60
+
36
50
+
0
40
+
36
30
+
36
20
X
2
=
0.6
+
0.72
+
0
+
1.2
+
1.8
X
2
=
4.32
Step 4 · Find p-value (P)
Use P = χ²cdf(X², ∞, 4)
The area under the chi-square curve with df 4 past the statistic.
P
=
χ
2
cdf(4.32,
∞,
4)
P
=
0.3644
→
0.3644
≥
α
=
0.05:
fail
to
reject
H₀
Check
Put the numbers back in. Both sides should match.
0.1 = 1 − 0.3 − 0.25 − 0.2 − 0.15 ✓
200 = 66 + 44 + 40 + 36 + 14 ✓
4.32
=
(66 − 200 × 0.3)
2
÷
(200
×
0.3)
+
(44 − 200 × 0.25)
2
÷
(200
×
0.25)
+
(40 − 200 × 0.2)
2
÷
(200
×
0.2)
+
(36 − 200 × 0.15)
2
÷
(200
×
0.15)
+
(14 − 200 × 0.1)
2
÷
(200
×
0.1)
✓
0.3644
=
χ
2
cdf(4.32,
∞,
4)
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Refresh

Related lessons

© 2026 SME. All rights reserved.