jmaths
IB Mathematics: Applications and Interpretation HL · 13.4: Hypothesis Testing · 13.4.4
Chi-squared test for independence Problem set B Worked solutions
Skills
-
A school canteen records the main lunch chosen by 272 pupils from five houses. The results are shown. A chi-squared test for independence is carried out.
(a) State the null and alternative hypotheses.
- H0: the lunch a pupil chooses is independent of house
- H1: the lunch a pupil chooses is not independent of house
(b) Find the number of degrees of freedom.
- 3 rows and 5 columns: df = (3 − 1)(5 − 1) = 8
-
The table shows the exhibition chosen by 155 visitors to a museum. If the exhibition chosen is independent of ticket type, find the expected frequency of adult visitors who chose Space.
- Row total = 72, column total = 49, grand total = 155
- E = 72 × 49 ÷ 155
- E = 22.8
-
Find the degrees of freedom for a chi-squared test for independence on a contingency table with: (a) 3 rows and 7 columns; (b) 6 rows and 2 columns; (c) 5 rows and 5 columns.
- (a) df = (3 − 1)(7 − 1) = 12
- (b) df = (6 − 1)(2 − 1) = 5
- (c) df = (5 − 1)(5 − 1) = 16
-
A shop company asks 143 customers how satisfied they were, by branch. Use your calculator to find the expected frequencies, \(\chi^2\), the p-value and the degrees of freedom for a test of independence.
- Enter the observed table as a matrix
- Expected frequencies: North: 18.9, 21.4, 19.7; South: 26.1, 29.6, 27.3
- From the calculator: χ² = 11.2, p = 0.00363, df = 2
-
The curve shows the \(\chi^2\) distribution with 3 degrees of freedom. The shaded right tail has area 0.10.
(a) Find the critical value.
- From the calculator: critical value = 6.25
(b) A test gives \(\chi^2=9.1\). Find the p-value.
- From the calculator: P(χ² > 9.1) = 0.0280
- 9.1 > 6.25, so the test statistic is inside the shaded tail
In context
-
A library asks 306 members which type of book they borrowed and which age band they are in. At the 5% significance level, test whether book type is independent of age band.
(a) State the hypotheses.
- H0: book type is independent of age band
- H1: book type is not independent of age band
(b) Write down the number of degrees of freedom.
- 3 rows and 3 columns: df = (3 − 1)(3 − 1) = 4
(c) Use your calculator to find \(\chi^2\) and the p-value.
- Enter the table as a matrix. From the calculator: χ² = 6.98, p = 0.137, df = 4
(d) State the conclusion in context.
- 0.137 > 0.05, so do not reject H0.
- There is insufficient evidence, at the 5% significance level, that book type is not independent of age band.
-
A farmer records 236 apples from two orchards by size class. Test, at the 5% significance level, whether the size of an apple is independent of the orchard.
(a) Find the value of \(\chi^2\).
- Enter the table as a matrix. From the calculator: χ² = 12.2, df = 3
(b) The critical value is 7.81. State the conclusion in context.
- 12.2 > 7.81, so reject H0.
- There is sufficient evidence, at the 5% significance level, that the size of an apple is not independent of the orchard.
-
A café asks 323 customers which drink they usually order and how often they visit. The results are shown.
(a) Find the expected frequencies.
- Enter the observed matrix. From the calculator, the expected frequencies:
- Tea: 24.2, 25.1, 19.4, 23.4; Coffee: 29.7, 30.8, 23.8, 28.7; Juice: 31.1, 32.1, 24.8, 30.0
(b) Find the cell that adds most to \(\chi^2\), and give its value of \((O-E)^2/E\).
- (O − E)²/E for each cell: Tea: 0.202, 8.90, 0.0967, 5.52; Coffee: 1.77, 3.78, 2.19, 0.474; Juice: 0.822, 0.535, 1.37, 7.55
- The largest is 8.90, for Tea and Weekly
(c) Compare the observed and expected frequencies in that cell. Describe what this shows in context.
- O = 40, E = 25.1
- O is above E: there are more observed in the Tea, Weekly cell than independence predicts, so drink and visit frequency look linked here.
Stretch
-
A school records whether 109 students ate breakfast and whether they arrived late.
(a) Find the expected frequency for students who ate breakfast and arrived late if the variables are independent.
- Row total = 52, column total = 55, grand total = 109
- E = 52 × 55 ÷ 109 = 26.2
(b) State the degrees of freedom. Use your calculator to find \(\chi^2\), then use the critical value 3.84 to state the conclusion in context, at the 5% significance level.
- df = (2 − 1)(2 − 1) = 1
- From the calculator: χ² = 2.08
- 2.08 < 3.84, so do not reject H0.
- There is insufficient evidence, at the 5% significance level, that arriving late is not independent of eating breakfast.
-
A test of whether the choice of pet is independent of the type of home gives a p-value of 0.018.
(a) State the conclusion at the 5% significance level, in context.
- 0.018 < 0.05, so reject H0.
- There is sufficient evidence, at the 5% significance level, that the choice of pet is not independent of the type of home.
(b) State the conclusion at the 1% significance level, in context.
- 0.018 > 0.01, so do not reject H0.
- There is insufficient evidence, at the 1% significance level, that the choice of pet is not independent of the type of home.
jmaths.xyz · AI HL · 13.4.4 Chi-squared test for independence