Sign in to jmaths to print this page or save it as a PDF: jmaths-8ce638778fd6.herokuapp.com/maths/ai-hl/hypothesis-testing/13-4-9/problems/b/

jmaths

IB Mathematics: Applications and Interpretation HL · 13.4: Hypothesis Testing · 13.4.9

Goodness of fit when parameters are estimated Problem set B One question at a time

Try each question on paper first. Open the working a line at a time, then say whether you had it.

Skills

  1. A bike shop records the number of punctures it repairs for each of 50 customers. The results are shown. A Poisson model is to be tested.

    Punctures012345678Frequency151011136211
    1. (a) Use the calculator to find the mean of the data.

      • From the calculator, with values and frequencies: x̄ = 167 ÷ 50
      • x̄ = 3.34
    2. (b) Write down the Poisson distribution that uses this mean and find P(X = 2) under it.

      • The mean of Po(λ) is λ, so use Po(3.34)
      • P(X = 2) = 0.198
  2. Find the number of degrees of freedom for each goodness of fit test, and answer the last part in words.

    1. (a) A Poisson distribution is fitted to data and its mean is found from the data. After combining groups there are 7 groups. State the degrees of freedom.

      • The mean was estimated from the data
      • df = 7 − 1 − 1 = 5
    2. (b) A binomial distribution B(10, 0.45) is fitted to data. The value 0.45 is stated by the manufacturer, not found from this data. After combining groups there are 5 groups. State the degrees of freedom.

      • The probability 0.45 is known (it comes from outside the data)
      • df = 5 − 1 = 4
    3. (c) A normal distribution is fitted to data. Both the mean and the standard deviation are calculated from the data. After combining groups there are 9 groups. State the degrees of freedom.

      • Two parameters are estimated from the data
      • df = 9 − 1 − 2 = 6
    4. (d) A coach says a player scores each penalty with probability 0.6. One analyst tests whether the number scored in 5 penalties, over 50 rounds, fits B(5, 0.6). Another analyst tests whether the data fit B(5, p) with p found from the 50 rounds. Which analyst has a parameter that is estimated? How do their degrees of freedom compare, for the same number of groups?

      • The coach's value 0.6 is known: nothing is estimated, so df = groups − 1
      • The second analyst finds p from the same data: one parameter estimated, so df = groups − 2
  3. The heights, in centimetres, of 60 students are recorded. The data are grouped as shown.

    Height (cm)140 to under 150150 to under 160160 to under 170170 to under 180180 to under 190Frequency21132132
    1. (a) Write down the midpoint of each class and use them to estimate the mean.

      • Midpoints: 145, 155, 165, 175, 185
      • From the calculator, with frequencies: x̄ = 165
    2. (b) Estimate the standard deviation.

      • Use the sample standard deviation (n − 1) from the same calculator output
      • s = 8.23
  4. The lengths of 150 fish are to be compared with a normal distribution with mean 40 cm and standard deviation 6 cm. The lengths are put into seven groups: under 30 cm, 30 to under 35 cm, 35 to under 40 cm, 40 to under 45 cm, 45 to under 50 cm, 50 to under 56 cm, 56 cm or over.

    1. (a) Find the expected frequencies for the groups, using the open-ended first and last groups.

      • Expected = 150 × P(group), with the first group below 30 and the last group above 56
      • From the calculator: x < 30 cm: 7.17; 30 ≤ x < 35 cm: 23.2; 35 ≤ x < 40 cm: 44.7; 40 ≤ x < 45 cm: 44.7; 45 ≤ x < 50 cm: 23.2; 50 ≤ x < 56 cm: 6.59; x ≥ 56 cm: 0.575
    2. (b) Which groups must be combined so that every expected frequency is greater than 5? Write down the new groups and the number of groups.

      • Expected frequencies of 5 or less: x ≥ 56 cm (0.575)
      • Combine these with their neighbours: x < 30 cm, 30 ≤ x < 35 cm, 35 ≤ x < 40 cm, 40 ≤ x < 45 cm, 45 ≤ x < 50 cm, x ≥ 50 cm
      • New expected frequencies: 7.17, 23.2, 44.7, 44.7, 23.2, 7.17. There are 6 groups

In context

  1. The number of goals scored in each of 100 football matches is recorded. The results are shown. Test, at the 5% significance level, whether a Poisson distribution is a suitable model.

    Goals01234567Frequency132633139321
    1. (a) Find the mean and write down the Poisson distribution that will be tested.

      • From the calculator: x̄ = 201 ÷ 100 = 2.01
      • The model is Po(2.01)
    2. (b) State the hypotheses, find the expected frequencies and combine groups so that every expected frequency is greater than 5.

      • H0: the data follows a Poisson distribution. H1: the data does not follow a Poisson distribution.
      • Expected frequencies (N × probability): X = 0: 13.4; X = 1: 26.9; X = 2: 27.1; X = 3: 18.1; X = 4: 9.11; X = 5: 3.66; X = 6: 1.23; X ≥ 7: 0.466
      • Expected frequencies of 5 or less: X = 5 (3.66); X = 6 (1.23); X ≥ 7 (0.466). Combine neighbouring groups until every expected frequency is greater than 5. The new groups are: X = 0, X = 1, X = 2, X = 3, X = 4, X ≥ 5.
      • Observed: 13, 26, 33, 13, 9, 6. Expected: 13.4, 26.9, 27.1, 18.1, 9.11, 5.36
    3. (c) Find the degrees of freedom, χ² and the p-value, and state your conclusion.

      • df = 6 − 1 − 1 = 4 (1 parameter estimated from the data)
      • From the calculator (χ² GOF, with df entered as 4): χ² = 2.88, p = 0.579
      • 0.579 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow a Poisson distribution.
  2. A shop says it receives a mean of 3.4 online orders per hour. The number of orders in each of 60 hours is recorded. Test, at the 5% significance level, whether Po(3.4) is a suitable model.

    Orders012345678910Frequency02913111181311
    1. (a) State the hypotheses.

      • H0: the number of orders per hour follows Po(3.4). H1: the number of orders per hour does not follow Po(3.4).
      • The mean 3.4 is given, so it is not estimated
    2. (b) Find the expected frequencies, say which groups must be combined, and state the degrees of freedom.

      • Expected frequencies (N × probability): X = 0: 2.00; X = 1: 6.81; X = 2: 11.6; X = 3: 13.1; X = 4: 11.1; X = 5: 7.58; X = 6: 4.30; X = 7: 2.09; X = 8: 0.887; X = 9: 0.335; X ≥ 10: 0.163
      • Expected frequencies of 5 or less: X = 0 (2.00); X = 6 (4.30); X = 7 (2.09); X = 8 (0.887); X = 9 (0.335); X ≥ 10 (0.163). Combine neighbouring groups until every expected frequency is greater than 5. The new groups are: X ≤ 1, X = 2, X = 3, X = 4, X = 5, X ≥ 6.
      • Observed: 2, 9, 13, 11, 11, 14. Expected: 8.81, 11.6, 13.1, 11.1, 7.58, 7.77
      • df = 6 − 1 = 5 (no parameter estimated from the data)
    3. (c) Find the p-value and state your conclusion.

      • From the calculator (χ² GOF, with df entered as 5): χ² = 12.4, p = 0.0299
      • 0.0299 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow Po(3.4).
  3. A player takes 10 free throws in each of 100 practice sessions and the number scored is recorded. The coach says the player scores each throw with probability 0.5. Use a 5% significance level.

    Scored012345678910Sessions0161022201118642
    1. (a) Test whether B(10, 0.5) is a suitable model.

      • H0: the data follows B(10, 0.5). H1: the data does not follow B(10, 0.5).
      • Expected: X = 0: 0.0977; X = 1: 0.977; X = 2: 4.39; X = 3: 11.7; X = 4: 20.5; X = 5: 24.6; X = 6: 20.5; X = 7: 11.7; X = 8: 4.39; X = 9: 0.977; X = 10: 0.0977
      • Combine: X ≤ 2, X = 3, X = 4, X = 5, X = 6, X = 7, X ≥ 8
      • df = 7 − 1 = 6
      • From the calculator: χ² = 17.2, p = 0.00848
      • 0.00848 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow B(10, 0.5).
    2. (b) Find an estimate of p from the data.

      • x̄ = 527 ÷ 100 = 5.27
      • p̂ = x̄ ÷ 10 = 0.527
    3. (c) Test whether a binomial distribution, with p estimated in part (b), is a suitable model.

      • H0: the data follows B(10, p). H1: the data does not follow B(10, p).
      • Expected using p̂: X = 0: 0.0561; X = 1: 0.625; X = 2: 3.13; X = 3: 9.30; X = 4: 18.1; X = 5: 24.3; X = 6: 22.5; X = 7: 14.3; X = 8: 5.99; X = 9: 1.48; X = 10: 0.165
      • Combine: X ≤ 3, X = 4, X = 5, X = 6, X = 7, X ≥ 8
      • df = 6 − 1 − 1 = 4
      • From the calculator: χ² = 12.0, p = 0.0171
      • 0.0171 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow a binomial distribution B(10, p).
  4. The delivery times, in minutes, of 90 orders are grouped as shown. The company says the mean delivery time is 44 minutes. Treat the first and last classes as open-ended. Use a 5% significance level.

    Time (min)20 to under 2828 to under 3636 to under 4444 to under 5252 to under 6060 to under 68Frequency3123223155
    1. (a) Use the class midpoints to estimate the standard deviation.

      • Midpoints: 24, 32, 40, 48, 56, 64
      • From the calculator: s = 9.45
    2. (b) Find the expected frequencies, combine groups so that every expected frequency is greater than 5, and state the degrees of freedom.

      • Expected frequencies (using normal cdf with open ends): x < 28 min: 4.07; 28 ≤ x < 36 min: 13.8; 36 ≤ x < 44 min: 27.1; 44 ≤ x < 52 min: 27.1; 52 ≤ x < 60 min: 13.8; x ≥ 60 min: 4.07
      • Expected frequencies of 5 or less: x < 28 min (4.07); x ≥ 60 min (4.07). Combine neighbouring groups until every expected frequency is greater than 5. The new groups are: x < 36 min, 36 ≤ x < 44 min, 44 ≤ x < 52 min, x ≥ 52 min.
      • Observed: 15, 32, 23, 20. Expected: 17.9, 27.1, 27.1, 17.9
      • df = 4 − 1 − 1 = 2 (1 parameter estimated from the data)
    3. (c) Test whether the data follow a normal distribution with this mean, and state your conclusion.

      • H0: the data follow N(44, σ²). H1: they do not follow N(44, σ²)
      • From the calculator (χ² GOF, with df entered as 2): χ² = 2.22, p = 0.330
      • 0.330 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow a normal distribution with mean 44 min.
  5. The times taken by 120 runners to complete a 5 km race are recorded and grouped as shown. A club coach thinks the times follow a normal distribution. Use a 5% significance level.

    Time (min)20 to under 2525 to under 3030 to under 3535 to under 4040 to under 4545 to under 5050 to under 55Frequency410343525102
    1. (a) Use the class midpoints to estimate the mean and the standard deviation.

      • Midpoints: 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 52.5
      • From the calculator, with frequencies: x̄ = 36.88…, s = 6.34…
    2. (b) Find the expected frequencies for a normal distribution with these values, treating the first and last classes as open-ended. Combine groups so that every expected frequency is greater than 5, and state the degrees of freedom.

      • Expected (N × probability, normal cdf with these values, open ends): x < 25 min: 3.66; 25 ≤ x < 30 min: 13.0; 30 ≤ x < 35 min: 29.4; 35 ≤ x < 40 min: 36.6; 40 ≤ x < 45 min: 25.3; 45 ≤ x < 50 min: 9.69; x ≥ 50 min: 2.30
      • Expected frequencies of 5 or less: x < 25 min (3.66); x ≥ 50 min (2.30). Combine each with its neighbour. The new groups are: x < 30 min, 30 ≤ x < 35 min, 35 ≤ x < 40 min, 40 ≤ x < 45 min, x ≥ 45 min.
      • Observed: 14, 34, 35, 25, 12. Expected: 16.7, 29.4, 36.6, 25.3, 12.0
      • df = 5 − 1 − 2 = 2 (the mean and σ were both estimated from the data)
    3. (c) Test whether the times follow a normal distribution, and state your conclusion.

      • H0: the times follow a normal distribution. H1: they do not follow a normal distribution.
      • From the calculator (χ² GOF, with df entered as 2): χ² = 1.24, p = 0.538
      • 0.538 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the times do not follow a normal distribution.
  6. A shop says the number of scoops X that a customer buys has probability function \(P(X=x)=\dfrac{5-x}{10}\) for \(x=1,2,3,4\). The scoops bought by 80 customers are recorded. The numbers 1 to 4 occur 25, 25, 20, 10 times. A spinner has six equal-looking sectors numbered 1 to 6. It is spun 90 times. The numbers 1 to 6 occur 9, 21, 14, 14, 18, 14 times.

    1. (a) Test, at the 5% significance level, whether the model suggested in the first paragraph is suitable.

      • H0: the data follow \(P(X=x)=\frac{5-x}{10}\). H1: they do not
      • Expected (N × probability): X = 1: 32.0; X = 2: 24.0; X = 3: 16.0; X = 4: 8.00
      • Every expected frequency is greater than 5
      • df = 4 − 1 = 3
      • From the calculator: χ² = 3.07, p = 0.381
      • 0.381 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow the suggested model.
    2. (b) Test, at the 5% significance level, whether the second situation is modelled by a uniform distribution.

      • H0: all 6 outcomes are equally likely. H1: they are not
      • Expected frequency for each outcome = 90 ÷ 6 = 15.0, which is greater than 5
      • df = 6 − 1 = 5
      • From the calculator: χ² = 5.60, p = 0.347
      • 0.347 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow a uniform distribution.
  7. A gardener crosses red and white snapdragons and expects red, pink and white flowers in the ratio 1 : 2 : 1. Of 200 plants, 47 are red, 96 are pink and 57 are white. Test, at the 5% significance level, whether the data agree with the ratio.

    TypeRedPinkWhiteCount479657
    • H0: the types appear in the ratio 1 : 2 : 1. H1: they do not
    • Expected (N × probability): Red: 50.0; Pink: 100; White: 50.0
    • df = 3 − 1 = 2
    • From the calculator: χ² = 1.32, p = 0.517
    • 0.517 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow the ratio 1 : 2 : 1.
  8. 226 people using a library are asked how they travel there. They are grouped by age. Test, at the 5% significance level, whether how a person travels to the library is independent of age group. Combine categories if you need to.

    AgeWalkCycleBusCarUnder 105616510 to 14359415 to 24131116925 or over24246412
    • Expected frequencies of the original table: Under 10: 6.37, 6.51, 14.9, 4.25; 10 to 14: 4.18, 4.27, 9.76, 2.79; 15 to 24: 9.76, 9.97, 22.8, 6.50; 25 or over: 24.7, 25.2, 57.6, 16.5
    • Combine: Under 15 = Under 10 + 10 to 14
    • New table: Under 15: 8, 11, 25, 9; 15 to 24: 13, 11, 16, 9; 25 or over: 24, 24, 64, 12. Smallest expected frequency: 6.50
    • H0: how a person travels to the library and age group are independent. H1: they are not independent
    • df = (3 − 1)(4 − 1) = 6. From the calculator: χ² = 7.33, p = 0.292
    • 0.292 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that how a person travels to the library is not independent of age group.

Stretch

  1. The number of insects found on each of 100 plants is recorded. The results are shown.

    Insects012345678910Plants291514817834101
    1. (a) Find an unbiased estimate of the mean.

      • From the calculator: x̄ = 2.39
    2. (b) Find an unbiased estimate of the variance.

      • From the calculator: s = 2.27
      • Unbiased variance s² = 5.17
    3. (c) Compare your answers and say whether a Poisson distribution is a plausible model. Give a reason.

      • For a Poisson distribution the mean and the variance are equal
      • The variance 5.17 is much larger than the mean 2.39 (about 2.16 times). A Poisson distribution has mean = variance, so a Poisson model is not plausible.
  2. A student rolls a 6-sided die 60 times. The results are shown.

    Face123456Rolls613117158
    1. (a) Test, at the 5% significance level, whether the die is fair.

      • H0: the die is fair (all 6 outcomes equally likely). H1: it is not
      • Expected for each outcome = 60 ÷ 6 = 10.0
      • df = 6 − 1 = 5
      • From the calculator: χ² = 6.40, p = 0.269
      • 0.269 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow a fair model.
    2. (b) Every frequency is now multiplied by 5, so the proportions are the same. Test again at the 5% significance level.

      • Expected for each outcome = 300 ÷ 6 = 50.0
      • df = 5
      • From the calculator: χ² = 32.0, p = 0.00000594
      • 0.00000594 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow a fair model.
    3. (c) Explain why the conclusions differ.

      • (O − E)² ÷ E is multiplied by 5 for every outcome, so χ² goes from 6.40 to 32.0
      • The degrees of freedom do not change, so the p-value falls from 0.269 to 0.00000594
      • A larger sample can detect a small departure from the model. A small sample often cannot
  3. Answer both parts in words.

    1. (a) A goodness of fit test has expected frequencies 1.8, 4.2, 9.5 and 12.5. Explain why the test should not be used with these values, and say what to do.

      • The chi-squared approximation needs every expected frequency greater than 5
      • 1.8 and 4.2 are not, so the p-value would be unreliable
      • Combine the small groups with their neighbours and recalculate the expected frequencies
    2. (b) A school asks only the members of its gym club how many hours of exercise pupils take each week. Comment on the validity of this questionnaire.

      • Validity means the questionnaire measures what it claims to measure
      • Gym members are not typical of all pupils: they exercise more
      • The answers would overstate how much pupils exercise, so the questionnaire has poor validity

jmaths.xyz · AI HL · 13.4.9 Goodness of fit when parameters are estimated