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/

jmaths

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

Goodness of fit when parameters are estimated Problem set A 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 bakery records the number of burnt loaves in each of 50 batches. The results are shown. A Poisson model is to be tested.

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

      • From the calculator, with values and frequencies: x̄ = 115 ÷ 50
      • x̄ = 2.30
    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(2.30)
      • P(X = 2) = 0.265
  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 6 groups. State the degrees of freedom.

      • The mean was estimated from the data
      • df = 6 − 1 − 1 = 4
    2. (b) A binomial distribution B(7, 0.3) is fitted to data. The value 0.3 comes from a national survey, not from this data. After combining groups there are 7 groups. State the degrees of freedom.

      • The probability 0.3 is known (it comes from outside the data)
      • df = 7 − 1 = 6
    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 8 groups. State the degrees of freedom.

      • Two parameters are estimated from the data
      • df = 8 − 1 − 2 = 5
    4. (d) A company says the mean number of faults per day is 2.5. One student tests whether 40 days of data fit Po(2.5). Another student tests whether the data fit a Poisson distribution with the mean taken from the 40 days. Which student has a parameter that is estimated? How do their degrees of freedom compare, for the same number of groups?

      • The company's value 2.5 is known: nothing is estimated, so df = groups − 1
      • The second student calculates the mean from the same data: one parameter estimated, so df = groups − 2
  3. The journey times, in minutes, of 80 commuters are recorded. The data are grouped as shown.

    Time (min)10 to under 2020 to under 3030 to under 4040 to under 5050 to under 6060 to under 70Frequency414282932
    1. (a) Write down the midpoint of each class and use them to estimate the mean.

      • Midpoints: 15, 25, 35, 45, 55, 65
      • From the calculator, with frequencies: x̄ = 37.4
    2. (b) Estimate the standard deviation.

      • Use the sample standard deviation (n − 1) from the same calculator output
      • s = 10.3
  4. The marks of 100 candidates are to be compared with a normal distribution with mean 52 and standard deviation 8. The marks are put into six groups: under 36, 36 to under 44, 44 to under 52, 52 to under 60, 60 to under 68, 68 or over.

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

      • Expected = 100 × P(group), with the first group below 36 and the last group above 68
      • From the calculator: x < 36: 2.28; 36 ≤ x < 44: 13.6; 44 ≤ x < 52: 34.1; 52 ≤ x < 60: 34.1; 60 ≤ x < 68: 13.6; x ≥ 68: 2.28
    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 < 36 (2.28); x ≥ 68 (2.28)
      • Combine these with their neighbours: x < 44, 44 ≤ x < 52, 52 ≤ x < 60, x ≥ 60
      • New expected frequencies: 15.9, 34.1, 34.1, 15.9. There are 4 groups

In context

  1. A call centre records the number of dropped calls in each of 100 hours. The results are shown. Test, at the 5% significance level, whether a Poisson distribution is a suitable model.

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

      • From the calculator: x̄ = 227 ÷ 100 = 2.27
      • The model is Po(2.27)
    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: 10.3; X = 1: 23.5; X = 2: 26.6; X = 3: 20.1; X = 4: 11.4; X = 5: 5.19; X = 6: 1.96; X = 7: 0.637; X ≥ 8: 0.239
      • Expected frequencies of 5 or less: X = 6 (1.96); X = 7 (0.637); X ≥ 8 (0.239). 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: 17, 23, 26, 9, 12, 13. Expected: 10.3, 23.5, 26.6, 20.1, 11.4, 8.03
    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): χ² = 13.6, p = 0.00870
      • 0.00870 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow a Poisson distribution.
  2. A museum says it receives a mean of 1.8 school group visits per day. The number of visits on each of 80 days is recorded. Test, at the 5% significance level, whether Po(1.8) is a suitable model.

    Visits01234567Frequency152126105201
    1. (a) State the hypotheses.

      • H0: the number of visits per day follows Po(1.8). H1: the number of visits per day does not follow Po(1.8).
      • The mean 1.8 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: 13.2; X = 1: 23.8; X = 2: 21.4; X = 3: 12.9; X = 4: 5.78; X = 5: 2.08; X = 6: 0.625; X ≥ 7: 0.206
      • Expected frequencies of 5 or less: X = 5 (2.08); X = 6 (0.625); X ≥ 7 (0.206). 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.
      • Observed: 15, 21, 26, 10, 8. Expected: 13.2, 23.8, 21.4, 12.9, 8.70
      • df = 5 − 1 = 4 (no parameter estimated from the data)
    3. (c) Find the p-value and state your conclusion.

      • From the calculator (χ² GOF, with df entered as 4): χ² = 2.24, p = 0.692
      • 0.692 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow Po(1.8).
  3. 100 students each answer 5 quiz questions and the number of correct answers is recorded. The teacher says each answer is correct with probability 0.7. Use a 5% significance level.

    Correct012345Students0621273610
    1. (a) Test whether B(5, 0.7) is a suitable model.

      • H0: the data follows B(5, 0.7). H1: the data does not follow B(5, 0.7).
      • Expected: X = 0: 0.243; X = 1: 2.83; X = 2: 13.2; X = 3: 30.9; X = 4: 36.0; X = 5: 16.8
      • Combine: X ≤ 2, X = 3, X = 4, X = 5
      • df = 4 − 1 = 3
      • From the calculator: χ² = 10.3, p = 0.0165
      • 0.0165 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow B(5, 0.7).
    2. (b) Find an estimate of p from the data.

      • x̄ = 323 ÷ 100 = 3.23
      • p̂ = x̄ ÷ 5 = 0.646
    3. (c) Test whether a binomial distribution, with p estimated in part (b), is a suitable model.

      • H0: the data follows B(5, p). H1: the data does not follow B(5, p).
      • Expected using p̂: X = 0: 0.556; X = 1: 5.07; X = 2: 18.5; X = 3: 33.8; X = 4: 30.8; X = 5: 11.3
      • Combine: X ≤ 1, X = 2, X = 3, X = 4, X = 5
      • df = 5 − 1 − 1 = 3
      • From the calculator: χ² = 2.73, p = 0.435
      • 0.435 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow a binomial distribution B(5, p).
  4. The test scores of 100 students are grouped as shown. The teacher says the mean score is 60. Treat the first and last classes as open-ended. Use a 5% significance level.

    Score30 to under 4040 to under 5050 to under 6060 to under 7070 to under 8080 to under 90Frequency416373850
    1. (a) Use the class midpoints to estimate the standard deviation.

      • Midpoints: 35, 45, 55, 65, 75, 85
      • From the calculator: s = 9.22
    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 < 40: 1.50; 40 ≤ x < 50: 12.4; 50 ≤ x < 60: 36.1; 60 ≤ x < 70: 36.1; 70 ≤ x < 80: 12.4; x ≥ 80: 1.50
      • Expected frequencies of 5 or less: x < 40 (1.50); x ≥ 80 (1.50). Combine neighbouring groups until every expected frequency is greater than 5. The new groups are: x < 50, 50 ≤ x < 60, 60 ≤ x < 70, x ≥ 70.
      • Observed: 20, 37, 38, 5. Expected: 13.9, 36.1, 36.1, 13.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(60, σ²). H1: they do not follow N(60, σ²)
      • From the calculator (χ² GOF, with df entered as 2): χ² = 8.50, p = 0.0143
      • 0.0143 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow a normal distribution with mean 60.
  5. The heights of 180 sunflower plants are recorded and grouped as shown. A student thinks the heights follow a normal distribution. Use a 5% significance level.

    Height (cm)120 to under 130130 to under 140140 to under 150150 to under 160160 to under 170170 to under 180180 to under 190190 to under 200Frequency01732523622129
    1. (a) Use the class midpoints to estimate the mean and the standard deviation.

      • Midpoints: 125, 135, 145, 155, 165, 175, 185, 195
      • From the calculator, with frequencies: x̄ = 159.78…, s = 15.59…
    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 < 130 cm: 5.05; 130 ≤ x < 140 cm: 13.4; 140 ≤ x < 150 cm: 29.3; 150 ≤ x < 160 cm: 43.3; 160 ≤ x < 170 cm: 42.9; 170 ≤ x < 180 cm: 28.6; 180 ≤ x < 190 cm: 12.8; x ≥ 190 cm: 4.73
      • Expected frequencies of 5 or less: x ≥ 190 cm (4.73). Combine it with its neighbour. The new groups are: x < 130 cm, 130 ≤ x < 140 cm, 140 ≤ x < 150 cm, 150 ≤ x < 160 cm, 160 ≤ x < 170 cm, 170 ≤ x < 180 cm, x ≥ 180 cm.
      • Observed: 0, 17, 32, 52, 36, 22, 21. Expected: 5.05, 13.4, 29.3, 43.3, 42.9, 28.6, 17.5
      • df = 7 − 1 − 2 = 4 (the mean and σ were both estimated from the data)
    3. (c) Test whether the heights follow a normal distribution, and state your conclusion.

      • H0: the heights follow a normal distribution. H1: they do not follow a normal distribution.
      • From the calculator (χ² GOF, with df entered as 4): χ² = 11.4, p = 0.0228
      • 0.0228 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the heights do not follow a normal distribution.
  6. A game spinner has five sectors numbered 1 to 5. The maker says the number X it shows has probability function \(P(X=x)=\dfrac{x}{15}\). The spinner is spun 75 times. The numbers 1 to 5 occur 9, 10, 16, 20, 20 times. A teacher picks a student by number from 1 to 5, 80 times in all. The numbers 1 to 5 are picked 10, 20, 25, 15, 10 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{x}{15}\). H1: they do not
      • Expected (N × probability): X = 1: 5.00; X = 2: 10.0; X = 3: 15.0; X = 4: 20.0; X = 5: 25.0
      • Combine to make every expected frequency greater than 5: X = 1 or 2, X = 3, X = 4, X = 5. Expected: 15.0, 15.0, 20.0, 25.0
      • df = 4 − 1 = 3
      • From the calculator: χ² = 2.13, p = 0.545
      • 0.545 > 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 5 outcomes are equally likely. H1: they are not
      • Expected frequency for each outcome = 80 ÷ 5 = 16.0, which is greater than 5
      • df = 5 − 1 = 4
      • From the calculator: χ² = 10.6, p = 0.0311
      • 0.0311 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that the data do not follow a uniform distribution.
  7. A scientist breeds fruit flies and expects long and short wings in the ratio 3 : 1. Of 570 flies, 416 have long wings and 154 have short wings. Test, at the 5% significance level, whether the data agree with the ratio.

    TypeLongShortCount416154
    • H0: the types appear in the ratio 3 : 1. H1: they do not
    • Expected (N × probability): Long: 428; Short: 142
    • df = 2 − 1 = 1
    • From the calculator: χ² = 1.24, p = 0.266
    • 0.266 > 0.05, so do not reject H0. There is insufficient evidence, at the 5% significance level, that the data do not follow the ratio 3 : 1.
  8. A survey asks 227 shoppers how they usually travel to the shops and on which day of the week they shop. Test, at the 5% significance level, whether how a shopper travels is independent of the day of the week. Combine categories if you need to.

    TravelTuesdayWednesdayThursdayFridayCar211668Bus151542Bike281697Walk1844108
    • Expected frequencies of the original table: Car: 18.4, 20.4, 6.52, 5.62; Bus: 13.0, 14.4, 4.60, 3.96; Bike: 21.7, 24.1, 7.67, 6.61; Walk: 28.9, 32.1, 10.2, 8.81
    • Combine: Thursday or Friday = Thursday + Friday
    • New table: Car: 21, 16, 14; Bus: 15, 15, 6; Bike: 28, 16, 16; Walk: 18, 44, 18. Smallest expected frequency: 8.56
    • H0: how a shopper travels and the day of the week are independent. H1: they are not independent
    • df = (4 − 1)(3 − 1) = 6. From the calculator: χ² = 16.1, p = 0.0134
    • 0.0134 < 0.05, so reject H0. There is sufficient evidence, at the 5% significance level, that how a shopper travels is not independent of the day of the week.

Stretch

  1. The number of customers arriving at a till in each of 100 one-minute periods is recorded. The results are shown.

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

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

      • From the calculator: s = 1.51
      • Unbiased variance s² = 2.28
    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 mean 2.00 and the variance 2.28 are close, so a Poisson model is plausible.
  2. A student spins a spinner with 5 equal-looking sectors 60 times. The results are shown.

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

      • H0: the spinner is fair (all 5 outcomes equally likely). H1: it is not
      • Expected for each outcome = 60 ÷ 5 = 12.0
      • df = 5 − 1 = 4
      • From the calculator: χ² = 6.17, p = 0.187
      • 0.187 > 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 ÷ 5 = 60.0
      • df = 4
      • From the calculator: χ² = 30.8, p = 0.00000331
      • 0.00000331 < 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.17 to 30.8
      • The degrees of freedom do not change, so the p-value falls from 0.187 to 0.00000331
      • 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 2.3, 6.8, 11.4 and 4.1. 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
      • 2.3 and 4.1 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 every pupil in the canteen queue: 'Do you agree that the disappointing canteen food should be improved?' Comment on the validity of this questionnaire.

      • Validity means the questionnaire measures what it claims to measure
      • The wording 'disappointing' pushes pupils towards agreeing, so it is a leading question
      • The answers would not show what pupils really think, so the questionnaire has poor validity

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