// Numbas version: finer_feedback_settings
{"name": "Estimate the mean and find the modal class for grouped data", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "
Fill in a frequency table for grouped data, then estimate the mean and identify the modal class.
", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "preamble": {"css": "", "js": ""}, "advice": "a)
\nWe calculate the midpoint by finding the mean of the lower and upper bounds. For example, the midpoint for $40 \\leq a \\lt 50$ is
\n\\[\\begin{align} \\displaystyle \\frac{40 + 50}{2} &= \\frac{90}{2} \\\\&= 45 \\text{.} \\end{align}\\]
\nTo calculate the final column, we multiply the second and the third columns:
\n\\[\\var{freq[4]} \\times 45 = \\var{45*freq[4]} \\text{.} \\]
\nFinally, when we have completed all the other values, we can calculate the total for the last column.
\n\\[\\begin{align} \\text{Total} &= 5\\times\\var{freq[0]} + 15\\times\\var{freq[1]} + 25\\times\\var{freq[2]} + 35\\times\\var{freq[3]} + 45\\times\\var{freq[4]} + 55\\times\\var{freq[5]} + 65\\times\\var{freq[6]} + 75\\times\\var{freq[7]} + 85\\times\\var{freq[8]} + 95\\times\\var{freq[9]} \\\\&= \\var{5*freq[0]} + \\var{15*freq[1]} + \\var{25*freq[2]} + \\var{35*freq[3]} + \\var{45*freq[4]} + \\var{55*freq[5]} + \\var{65*freq[6]} + \\var{75*freq[7]} + \\var{85*freq[8]} + \\var{95*freq[9]} \\\\&= \\var{freq_midpoint} \\text{.} \\end{align}\\]
\nThe completed frequency table looks like this:
\n\n\n\nStage 1 grade $a$ | \nFrequency | \nMidpoint | \nFrequency $\\times$ Midpoint | \n
\n\n$0 \\leq a \\lt 10$ | \n$\\var{freq[0]}$ | \n$5$ | \n$\\var{5*freq[0]}$ | \n
\n\n$10 \\leq a \\lt 20$ | \n$\\var{freq[1]}$ | \n$15$ | \n$\\var{15*freq[1]}$ | \n
\n\n$20 \\leq a \\lt 30$ | \n$\\var{freq[2]}$ | \n$25$ | \n$\\var{25*freq[2]}$ | \n
\n\n$30 \\leq a \\lt 40$ | \n$\\var{freq[3]}$ | \n$35$ | \n$\\var{35*freq[3]}$ | \n
\n\n$40 \\leq a \\lt 50$ | \n$\\var{freq[4]}$ | \n$45$ | \n$\\var{45*freq[4]}$ | \n
\n\n$50 \\leq a \\lt 60$ | \n$\\var{freq[5]}$ | \n$55$ | \n$\\var{55*freq[5]}$ | \n
\n\n$60 \\leq a \\lt 70$ | \n$\\var{freq[6]}$ | \n$65$ | \n$\\var{65*freq[6]}$ | \n
\n\n$70 \\leq a \\lt 80$ | \n$\\var{freq[7]}$ | \n$75$ | \n$\\var{75*freq[7]}$ | \n
\n\n$80 \\leq a \\lt 90$ | \n$\\var{freq[8]}$ | \n$85$ | \n$\\var{85*freq[8]}$ | \n
\n\n$90 \\leq a \\lt 100$ | \n$\\var{freq[9]}$ | \n$95$ | \n$\\var{95*freq[9]}$ | \n
\n\nTotals | \n$\\var{sum(freq)}$ | \n | \n$\\var{freq_midpoint}$ | \n
\n\n
\n
\nb)
\nWe don't know exactly how much each student got, so we have to assume all students got the midpoint of their group. To estimate the sum of all student grades in a particular interval, we can multiply the interval's midpoint by its frequency.
\nThe sum of all the grades in the class is the sum of the estimates for each interval. We've already calculated this in the table above.
\nSo the estimate for the mean, $\\bar{a}$, is as follows:
\n\\begin{align}
\\bar{a} &\\approx \\frac{\\var{freq_midpoint}}{\\var{sum(freq)}} \\\\
&= \\var{freq_midpoint/sum(freq)} \\text{.}
\\end{align}
\nRounding the mean to 2 decimal places, we get $\\var{precround(freq_midpoint/sum(freq),2)}$.
\nc)
\nThe modal class is the interval with the highest frequency. In this case, the interval $50 \\leq a \\lt 60$ is the modal class.
", "rulesets": {}, "extensions": ["stats"], "name": "Estimate the mean and find the modal class for grouped data", "ungrouped_variables": ["freq", "freq_midpoint", "sixty", "seventy"], "functions": {}, "tags": ["estimate the mean", "grouped data", "intervals", "modal class", "taxonomy"], "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "variables": {"freq_midpoint": {"name": "freq_midpoint", "definition": "5*freq[0] + 15*freq[1] + 25*freq[2] + 35*freq[3] + 45*freq[4] + 55*freq[5] + 65*freq[6] + 75*freq[7] + 85*freq[8] + 95*freq[9]", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "freq": {"name": "freq", "definition": "repeat(random(0..8), 2) + random(0..4) + random(6..18) + random(20..40) + sixty + seventy + random(10..40) + random(0..6) + random(0..1)", "group": "Ungrouped variables", "description": "\n\n\n$0 \\leq a \\lt 10$ | \n0..8 | \n | \n | \n
\n\n$10 \\leq a \\lt 20$ | \n0..7 | \n | \n | \n
\n\n$20 \\leq a \\lt 30$ | \n0..4 | \n | \n | \n
\n\n$30 \\leq a \\lt 40$ | \n6..18 | \n | \n | \n
\n\n$40 \\leq a \\lt 50$ | \n20..50 | \n | \n | \n
\n\n$50 \\leq a \\lt 60$ | \n30..60 | \n\n\n\n | \n | \n
\n\n60 70 | \n | \n | \n | \n
\n\n$70 \\leq a \\lt 80$ | \n10..40 | \n | \n | \n
\n\n$80 \\leq a \\lt 90$ | \n0..6 | \n | \n | \n
\n\n$90 \\leq a \\lt 100$ | \n0..1 | \n | \n | \n
\n\n
\n", "templateType": "anything"}, "sixty": {"name": "sixty", "definition": " random(40..85)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "seventy": {"name": "seventy", "definition": "random(35..sixty except sixty)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "statement": "$\\var{sum(freq)}$ Mathematics and Statistics students have finished their first year at Newcastle University.
", "parts": [{"type": "gapfill", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "prompt": "Their stage 1 grades (denoted $a$) have been summarised and grouped into intervals in the frequency table below. Complete the table.
\n\n\n\nStage 1 grade $a$ | \nFrequency | \nMidpoint | \nFrequency $\\times$ Midpoint | \n
\n\n$0 \\leq a \\lt 10$ | \n$\\var{freq[0]}$ | \n[[0]] | \n[[10]] | \n
\n\n$10 \\leq a \\lt 20$ | \n$\\var{freq[1]}$ | \n[[1]] | \n[[11]] | \n
\n\n$20 \\leq a \\lt 30$ | \n$\\var{freq[2]}$ | \n[[2]] | \n[[12]] | \n
\n\n$30 \\leq a \\lt 40$ | \n$\\var{freq[3]}$ | \n[[3]] | \n[[13]] | \n
\n\n$40 \\leq a \\lt 50$ | \n$\\var{freq[4]}$ | \n[[4]] | \n[[14]] | \n
\n\n$50 \\leq a \\lt 60$ | \n$\\var{freq[5]}$ | \n[[5]] | \n[[15]] | \n
\n\n$60 \\leq a \\lt 70$ | \n$\\var{freq[6]}$ | \n[[6]] | \n[[16]] | \n
\n\n$70 \\leq a \\lt 80$ | \n$\\var{freq[7]}$ | \n[[7]] | \n[[17]] | \n
\n\n$80 \\leq a \\lt 90$ | \n$\\var{freq[8]}$ | \n[[8]] | \n[[18]] | \n
\n\n$90 \\leq a \\lt 100$ | \n$\\var{freq[9]}$ | \n[[9]] | \n[[19]] | \n
\n\nTotals | \n$\\var{sum(freq)}$ | \n$-$ | \n[[20]] | \n
\n\n
", "showCorrectAnswer": true, "gaps": [{"maxValue": "5", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "5", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "15", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "15", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "25", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "25", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "35", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "35", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "45", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "45", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "55", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "55", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "65", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "65", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "75", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "75", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "85", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "85", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "95", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": "0.5", "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "95", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "5*freq[0]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "5*freq[0]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "15*freq[1]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "15*freq[1]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "25*freq[2]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "25*freq[2]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "35*freq[3]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "35*freq[3]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "45*freq[4]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "45*freq[4]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "55*freq[5]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "55*freq[5]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "65*freq[6]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "65*freq[6]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "75*freq[7]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "75*freq[7]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "85*freq[8]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "85*freq[8]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "95*freq[9]", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "95*freq[9]", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}, {"maxValue": "freq_midpoint", "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "marks": 1, "showFeedbackIcon": true, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "minValue": "freq_midpoint", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false}], "showFeedbackIcon": true, "variableReplacements": [], "steps": [{"type": "information", "scripts": {}, "variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "The midpoint of an interval is the mean of the upper and lower bounds.
", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": []}]}, {"precision": "2", "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "freq_midpoint/sum(freq)", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "minValue": "freq_midpoint/sum(freq)", "showCorrectAnswer": true, "correctAnswerFraction": false, "showPrecisionHint": true, "strictPrecision": false, "marks": "2", "precisionPartialCredit": 0, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "mustBeReduced": false, "prompt": "Now use the table to estimate the mean grade, $\\bar{a}$.
", "variableReplacements": [], "allowFractions": false}, {"type": "1_n_2", "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "From the choices below, choose the correct modal class for this data.
", "displayColumns": "5", "minMarks": 0, "distractors": ["", "", "", "", ""], "shuffleChoices": false, "scripts": {}, "variableReplacements": [], "displayType": "radiogroup", "choices": ["$30 \\leq a \\lt 40$
", "$40 \\leq a \\lt 50$
", "$50 \\leq a \\lt 60$
", "$60 \\leq a \\lt 70$
", "$70 \\leq a \\lt 80$
"], "showCorrectAnswer": true, "showFeedbackIcon": true, "matrix": [0, 0, "2", "0", 0]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}