// Numbas version: finer_feedback_settings {"showstudentname": true, "feedback": {"showactualmark": true, "intro": "", "advicethreshold": 0, "showtotalmark": true, "showanswerstate": true, "feedbackmessages": [], "allowrevealanswer": true, "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "question_groups": [{"pickingStrategy": "all-ordered", "name": "Group", "pickQuestions": 1, "questions": [{"name": "Complete a frequency table and find the measures of central tendency", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}], "tags": ["Frequency Table", "frequency table", "Frequency table", "taxonomy"], "metadata": {"description": "
Given a table of data, calculate the mean, mode and median, and complete a frequency table.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "30 random students were asked about the number of siblings they have. These are their responses:
\n$\\var{a[0]}$ | \n$\\var{a[1]}$ | \n$\\var{a[2]}$ | \n$\\var{a[3]}$ | \n$\\var{a[4]}$ | \n$\\var{a[5]}$ | \n$\\var{a[6]}$ | \n$\\var{a[7]}$ | \n$\\var{a[8]}$ | \n$\\var{a[9]}$ | \n
$\\var{a[10]}$ | \n$\\var{a[11]}$ | \n$\\var{a[12]}$ | \n$\\var{a[13]}$ | \n$\\var{a[14]}$ | \n$\\var{a[15]}$ | \n$\\var{a[16]}$ | \n$\\var{a[17]}$ | \n$\\var{a[18]}$ | \n$\\var{a[19]}$ | \n
$\\var{a[20]}$ | \n$\\var{a[21]}$ | \n$\\var{a[22]}$ | \n$\\var{a[23]}$ | \n$\\var{a[24]}$ | \n$\\var{a[25]}$ | \n$\\var{a[26]}$ | \n$\\var{a[27]}$ | \n$\\var{a[28]}$ | \n$\\var{a[29]}$ | \n
Organising the data in a frequency table helps to make mistakes less likely when calculating statistics from our data, summarising the responses all in one place with fewer numbers.
\nEach row of the frequency column gives the number of students with the corresponding number of siblings.
\nNumber of siblings | \nFrequency | \n
---|---|
$0$ | \n$\\var{freq[0]}$ | \n
$1$ | \n$\\var{freq[1]}$ | \n
$2$ | \n$\\var{freq[2]}$ | \n
$3$ | \n$\\var{freq[3]}$ | \n
$4$ | \n$\\var{freq[4]}$ | \n
$5$ | \n$\\var{freq[5]}$ | \n
$6$ | \n$\\var{freq[6]}$ | \n
Total | \n$30$ | \n
Always remember to check whether your frequency column adds up to the total (here, it is $30$) to make sure you have not left out any responses.
\nThe mean number of siblings is the total number of siblings, $\\sum x$, divided by the number of students in the sample, $n$.
\n\\begin{align}
\\sum x &= 0 \\times \\var{freq[0]} + 1 \\times \\var{freq[1]} + 2 \\times \\var{freq[2]} + 3 \\times \\var{freq[3]} + 4 \\times \\var{freq[4]} + 5 \\times \\var{freq[5]} + 6 \\times \\var{freq[6]}
\\\\
&= 0 + \\var{1*freq[1]} + \\var{2*freq[2]} + \\var{3*freq[3]} + \\var{4*freq[4]} + \\var{5*freq[5]} + \\var{6*freq[6]} \\\\&= \\var{sum(a)} \\text{.}
\\end{align}
The total number of students $n$ is $30$.
\nTherefore the mean is
\n\\begin{align}
\\bar{x} &= \\frac{\\sum x}{n} \\\\
&= \\frac{\\var{sum(a)}}{30} \\\\
&= \\var{mean} \\text{.}
\\end{align}
Rounding the answer to 2 decimal places, we get $\\var{precround(mean, 2)}$.
\nThe mode is the value with the highest frequency. Here, the mode is $\\var{mode}$ siblings, with frequency $\\var{freq[mode]}$.
\nThe median is the \"middle\" value in the sample, when arranged in numerical order.
\nSince $n = 30$, we have two middle values in this data (15th and 16th place). We can count from the top of the table until we locate rows where these middle values lie, as the numbers in the table are already sorted by order.
\nHere, both $15$th and $16$th value lie in the row $\\var{asa[14]}$.Here, the $15$th value lies in the row $\\var{asa[14]}$ while the $16$th value lies in the row $\\var{asa[15]}$.
\nAs $15$th value $= 16$th value $= \\var{asa[14]}$, the median is $\\var{asa[14]}$.As $15$th value $= \\var{asa[14]}$ and $16$th value $= \\var{asa[15]}$, we need to find their mean.
\n\\[ \\displaystyle \\begin{align} \\frac{\\var{asa[14]} + \\var{asa[15]}}{2} &= \\frac{\\var{asa[14] + asa[15]}}{2} \\\\&= \\var{median} \\text{.} \\end{align}\\]
\nThis is the median for this data.
\n", "rulesets": {}, "variables": {"m": {"name": "m", "group": "Final data", "definition": "mode(a)", "description": "", "templateType": "anything"}, "a2": {"name": "a2", "group": "Ungrouped variables", "definition": "shuffle(repeat(random(0..1), 13) + 0 + 2 + 2 + repeat(random(2..3), 10) + repeat(random(4..5), 3) + random(0..6))", "description": "", "templateType": "anything"}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "shuffle(repeat(random(0..1), 13) + 0 + 2 + 2 + repeat(random(2..3), 10) + repeat(random(4..5), 3) + random(0..6))", "description": "", "templateType": "anything"}, "modea1": {"name": "modea1", "group": "Ungrouped variables", "definition": "mode(a1)", "description": "", "templateType": "anything"}, "mode": {"name": "mode", "group": "Final data", "definition": "m[0]", "description": "", "templateType": "anything"}, "mean": {"name": "mean", "group": "Final data", "definition": "mean(a)", "description": "", "templateType": "anything"}, "modea2": {"name": "modea2", "group": "Ungrouped variables", "definition": "mode(a2)", "description": "", "templateType": "anything"}, "a3": {"name": "a3", "group": "Ungrouped variables", "definition": "shuffle(repeat(0, 7) + repeat(1, 10) + repeat(2, 5) + repeat(3, 4) + repeat(4, 2) + repeat(5,1) + repeat(6,1))", "description": "", "templateType": "anything"}, "freq": {"name": "freq", "group": "Final data", "definition": "map(\nlen(filter(x=j,x,a)),\nj, 0..6)", "description": "", "templateType": "anything"}, "median": {"name": "median", "group": "Final data", "definition": "median(a)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Final data", "definition": "if(len(modea1) = 1, a1, if(len(modea2) = 1, a2, a3))", "description": "", "templateType": "anything"}, "modea3": {"name": "modea3", "group": "Ungrouped variables", "definition": "mode(a3)", "description": "", "templateType": "anything"}, "asa": {"name": "asa", "group": "Final data", "definition": "sort(a)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["a1", "modea1", "a2", "modea2", "a3", "modea3"], "variable_groups": [{"name": "Final data", "variables": ["a", "mean", "median", "m", "mode", "freq", "asa"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Complete the following frequency table:
\nNumber of siblings | \nFrequency | \n
---|---|
$0$ | \n[[0]] | \n
$1$ | \n[[1]] | \n
$2$ | \n[[2]] | \n
$3$ | \n[[3]] | \n
$4$ | \n[[4]] | \n
$5$ | \n[[5]] | \n
$6$ | \n[[6]] | \n
Total | \n$30$ | \n
Find the mean, mode and median for this data.
\nMean = [[0]]
\nMode = [[1]]
\nMedian = [[2]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Mean", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "mean", "maxValue": "mean", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Mode", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "mode", "maxValue": "mode", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Median", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "median", "maxValue": "median", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Weight of a scoop in two ice cream parlours", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}], "type": "question", "tags": ["mean", "median", "mode", "range", "taxonomy"], "variablesTest": {"condition": "\n", "maxRuns": 100}, "variables": {"b6": {"templateType": "anything", "name": "b6", "description": "", "definition": "meanab - 6", "group": "B"}, "alist": {"templateType": "anything", "name": "alist", "description": "", "definition": "[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10]", "group": "A"}, "a2": {"templateType": "anything", "name": "a2", "description": "", "definition": "meanab - 1 - random2", "group": "A"}, "bsort": {"templateType": "anything", "name": "bsort", "description": "", "definition": "sort(b)", "group": "B"}, "suma": {"templateType": "anything", "name": "suma", "description": "", "definition": "sum(a)", "group": "Ungrouped variables"}, "rangeb": {"templateType": "anything", "name": "rangeb", "description": "", "definition": "max(b) - min(b)", "group": "Ungrouped variables"}, "b5": {"templateType": "anything", "name": "b5", "description": "", "definition": "meanab - 8 ", "group": "B"}, "meana": {"templateType": "anything", "name": "meana", "description": "", "definition": "(a1 + a2 + a3 + a4 + a5+ a6 + a7 + a8 + a9 + a10)/10", "group": "Ungrouped variables"}, "a6": {"templateType": "anything", "name": "a6", "description": "", "definition": "meanab", "group": "A"}, "a10": {"templateType": "anything", "name": "a10", "description": "", "definition": "meanab + 2 + random2", "group": "A"}, "rangea": {"templateType": "anything", "name": "rangea", "description": "", "definition": "max(a) - min(a)", "group": "Ungrouped variables"}, "asort": {"templateType": "anything", "name": "asort", "description": "", "definition": "sort(a)", "group": "A"}, "a": {"templateType": "anything", "name": "a", "description": "", "definition": "shuffle(alist)", "group": "A"}, "modea": {"templateType": "anything", "name": "modea", "description": "", "definition": "mode(a)[0]", "group": "Ungrouped variables"}, "modeb": {"templateType": "anything", "name": "modeb", "description": "", "definition": "mode(b)[0]", "group": "Ungrouped variables"}, "b3": {"templateType": "anything", "name": "b3", "description": "", "definition": "meanab - 12", "group": "B"}, "random": {"templateType": "anything", "name": "random", "description": "", "definition": "random(2..10 #2)", "group": "B"}, "a9": {"templateType": "anything", "name": "a9", "description": "", "definition": "meanab + 1 + random2", "group": "A"}, "meanb": {"templateType": "anything", "name": "meanb", "description": "", "definition": "(b1+b2+b3+b4+b5+b6+b7+b8+b9+b10)/10", "group": "Ungrouped variables"}, "a3": {"templateType": "anything", "name": "a3", "description": "", "definition": "meanab - 2", "group": "A"}, "meanab": {"templateType": "anything", "name": "meanab", "description": "", "definition": "random(80..90)", "group": "Ungrouped variables"}, "b10": {"templateType": "anything", "name": "b10", "description": "", "definition": "meanab + 27 + random/2", "group": "B"}, "a8": {"templateType": "anything", "name": "a8", "description": "", "definition": "meanab + 1", "group": "A"}, "b1": {"templateType": "anything", "name": "b1", "description": "", "definition": "meanab - 15 - random", "group": "B"}, "b4": {"templateType": "anything", "name": "b4", "description": "", "definition": "meanab - 10", "group": "B"}, "medianb": {"templateType": "anything", "name": "medianb", "description": "", "definition": "median(b)", "group": "Ungrouped variables"}, "b7": {"templateType": "anything", "name": "b7", "description": "", "definition": "meanab - 2", "group": "B"}, "b9": {"templateType": "anything", "name": "b9", "description": "", "definition": "meanab + 27 + random/2", "group": "B"}, "a4": {"templateType": "anything", "name": "a4", "description": "", "definition": "meanab", "group": "A"}, "b8": {"templateType": "anything", "name": "b8", "description": "", "definition": "meanab + 13", "group": "B"}, "a5": {"templateType": "anything", "name": "a5", "description": "", "definition": "meanab", "group": "A"}, "random2": {"templateType": "anything", "name": "random2", "description": "", "definition": "random(1..3)", "group": "A"}, "b": {"templateType": "anything", "name": "b", "description": "", "definition": "shuffle(blist)", "group": "B"}, "b2": {"templateType": "anything", "name": "b2", "description": "", "definition": "meanab - 14", "group": "B"}, "sumb": {"templateType": "anything", "name": "sumb", "description": "", "definition": "sum(b)", "group": "Ungrouped variables"}, "a7": {"templateType": "anything", "name": "a7", "description": "", "definition": "meanab + 1", "group": "A"}, "a1": {"templateType": "anything", "name": "a1", "description": "", "definition": "meanab - 2 - random2", "group": "A"}, "mediana": {"templateType": "anything", "name": "mediana", "description": "", "definition": "median(a)", "group": "Ungrouped variables"}, "blist": {"templateType": "anything", "name": "blist", "description": "", "definition": "[b1,b2,b3,b4,b5,b6,b7,b8,b9,b10]", "group": "B"}}, "functions": {}, "statement": "Two ice cream parlours called Sweet Heaven and Tasty Hell both sell ice cream for the same price. Alice likes both of these places equally, and has visited each place 10 times. After every visit, Alice measured the weight of her scoop, in grams, to the nearest integer. Here is the table of her values:
\nSweet Heaven (g) | \n$\\var{a[0]}$ | \n$\\var{a[1]}$ | \n$\\var{a[2]}$ | \n$\\var{a[3]}$ | \n$\\var{a[4]}$ | \n$\\var{a[5]}$ | \n$\\var{a[6]}$ | \n$\\var{a[7]}$ | \n$\\var{a[8]}$ | \n$\\var{a[9]}$ | \n
---|---|---|---|---|---|---|---|---|---|---|
Tasty Hell (g) | \n$\\var{b[0]}$ | \n$\\var{b[1]}$ | \n$\\var{b[2]}$ | \n$\\var{b[3]}$ | \n$\\var{b[4]}$ | \n$\\var{b[5]}$ | \n$\\var{b[6]}$ | \n$\\var{b[7]}$ | \n$\\var{b[8]}$ | \n$\\var{b[9]}$ | \n
Using the data above, fill in the following table.
\n\n | Sweet Heaven (g) | \nTasty Hell (g) | \n
---|---|---|
Mean weight | \n[[0]] | \n[[1]] | \n
Median weight | \n[[2]] | \n[[3]] | \n
Modal weight | \n[[4]] | \n[[5]] | \n
Range | \n[[6]] | \n[[7]] | \n
Sweet Heaven
", "Tasty Hell
"], "showFeedbackIcon": true, "prompt": "Now suppose Alice has two children. Which ice cream shop is it better for her to visit if she does not want her children to fight over who has more ice cream?
", "shuffleChoices": false, "matrix": ["2", "0"], "variableReplacements": [], "marks": 0, "scripts": {}, "showCorrectAnswer": true, "displayType": "radiogroup", "distractors": ["", ""]}], "ungrouped_variables": ["meanab", "meana", "modea", "mediana", "meanb", "modeb", "medianb", "rangea", "rangeb", "suma", "sumb"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Given two distributions, calculate the measures of average and spread and make some decisions based on the results.
"}, "preamble": {"css": "", "js": ""}, "advice": "We denote Sweet Heaven as $s$ and Tasty Hell as $t$.
\nWe are going to start with completing the column for Sweet Heaven.
\nFirst, we need to find the sum of weights of all the scoops:
\n\\[\\begin{align} \\sum s &= \\var{a[0]} + \\var{a[1]} + \\var{a[2]} + \\var{a[3]} + \\var{a[4]} + \\var{a[5]} + \\var{a[6]} + \\var{a[7]} + \\var{a[8]} + \\var{a[9]} \\\\&= \\var{suma} \\text{.}
\\end{align}\\]
The total number of measurements $n$ is $10$.
\nTherefore the mean is
\n\\[ \\begin{align} \\overline{s} &= \\frac{\\sum s}{n} \\\\[3pt]&= \\frac{\\var{suma}}{10} \\\\&= \\var{meana} \\text{.} \\end{align}\\]
\n\n
The median is the middle value. We need to sort the list in order:
\nSweet Heaven (g) | \n$\\var{asort[0]}$ | \n$\\var{asort[1]}$ | \n$\\var{asort[2]}$ | \n$\\var{asort[3]}$ | \n$\\var{asort[4]}$ | \n$\\var{asort[5]}$ | \n$\\var{asort[6]}$ | \n$\\var{asort[7]}$ | \n$\\var{asort[8]}$ | \n$\\var{asort[9]}$ | \n
---|
There is an even number of responses, so there are two numbers in the middle (5th and 6th place). To find the median, we need to find the mean of these two numbers $\\var{asort[4]}$ and $\\var{asort[5]}$:
\n\\[ \\displaystyle \\begin{align} \\frac{\\var{asort[4]} + \\var{asort[5]}}{2} &= \\frac{\\var{asort[4] + asort[5]}}{2} \\\\&= \\var{mediana} \\text{.} \\end{align}\\]
\n\n
The mode is the value that occurs the most often in the data.
\nTo find a mode, we can look at our sorted list:
\nSweet Heaven (g) | \n$\\var{asort[0]}$ | \n$\\var{asort[1]}$ | \n$\\var{asort[2]}$ | \n$\\var{asort[3]}$ | \n$\\var{asort[4]}$ | \n$\\var{asort[5]}$ | \n$\\var{asort[6]}$ | \n$\\var{asort[7]}$ | \n$\\var{asort[8]}$ | \n$\\var{asort[9]}$ | \n
---|
We notice that $\\var{modea}$ occurs the most times (3) and so $\\var{modea}$ is the mode.
\n\n
The range is the difference between the highest and the lowest value in the data.
\nTo find this, we subtract the lowest value from the highest value:
\n\\[ \\var{max(a)} - \\var{min(a)} = \\var{rangea} \\text{.}\\]
\n\n
So the first column is
\n\n | Sweet Heaven (g) | \n
---|---|
Mean weight | \n$\\var{meana}$ | \n
Median weight | \n$\\var{mediana}$ | \n
Modal weight | \n$\\var{modea}$ | \n
Range | \n$\\var{rangea}$ | \n
\n
Similarly for Tasty Hell,
\n\\[\\begin{align} \\sum t &= \\var{b[0]} + \\var{b[1]} + \\var{b[2]} + \\var{b[3]} + \\var{b[4]} + \\var{b[5]} + \\var{b[6]} + \\var{b[7]} + \\var{b[8]} + \\var{b[9]} \\\\&= \\var{sumb} \\text{.}
\\end{align}\\]
The total number of measurements $n$ is $10$ again.
\nTherefore the mean is
\n\\[ \\begin{align} \\overline{t} &= \\frac{\\sum t}{n} \\\\[3pt]&= \\frac{\\var{sumb}}{10} \\\\&= \\var{meanb} \\text{.} \\end{align}\\]
\n\n
For median, we sort the list in order:
\nTasty Hell (g) | \n$\\var{bsort[0]}$ | \n$\\var{bsort[1]}$ | \n$\\var{bsort[2]}$ | \n$\\var{bsort[3]}$ | \n$\\var{bsort[4]}$ | \n$\\var{bsort[5]}$ | \n$\\var{bsort[6]}$ | \n$\\var{bsort[7]}$ | \n$\\var{bsort[8]}$ | \n$\\var{bsort[9]}$ | \n
---|
There is an even number of responses, so there are two numbers in the middle (5th and 6th place). We find the mean of these two numbers $\\var{bsort[4]}$ and $\\var{bsort[5]}$:
\n\\[ \\displaystyle \\begin{align} \\frac{\\var{bsort[4]} + \\var{bsort[5]}}{2} &= \\frac{\\var{bsort[4] + bsort[5]}}{2} \\\\&= \\var{medianb} \\text{.} \\end{align}\\]
\n\n
For mode, we look at our sorted list:
\nTasty Hell (g) | \n$\\var{bsort[0]}$ | \n$\\var{bsort[1]}$ | \n$\\var{bsort[2]}$ | \n$\\var{bsort[3]}$ | \n$\\var{bsort[4]}$ | \n$\\var{bsort[5]}$ | \n$\\var{bsort[6]}$ | \n$\\var{bsort[7]}$ | \n$\\var{bsort[8]}$ | \n$\\var{bsort[9]}$ | \n
---|
We notice that $\\var{modeb}$ occurs the most times (2) and so $\\var{modeb}$ is the mode.
\n\n
To find the range, we subtract the lowest value from the highest value:
\n\\[ \\var{max(b)} - \\var{min(b)} = \\var{rangeb} \\text{.}\\]
\n\n
So the complete table is\u200b
\n\n | Sweet Heaven (g) | \nTasty Hell (g) | \n
---|---|---|
Mean weight | \n$\\var{meana}$ | \n$\\var{meanb}$ | \n
Median weight | \n$\\var{mediana}$ | \n$\\var{medianb}$ | \n
Modal weight | \n$\\var{modea}$ | \n$\\var{modeb}$ | \n
Range | \n$\\var{rangea}$ | \n$\\var{rangeb}$ | \n
Let's look at the differences between the two ice cream parlours:
The range of weight of Tasty Hell scoops ($\\var{rangeb}$) is far greater than that of Sweet Heaven scoops ($\\var{rangea}$).
\nThe mean weight for each shop is $\\var{meanab}$. This implies that the scoops are more-or-less the same in both shops. However, looking at the actual values as well as other measures, we can see this is not true, so the mean is not very reliable in this case.
\nWhen we compare the medians ($\\var{mediana}$ and $\\var{medianb}$), we might assume that the scoops are generally lighter in Tasty Hell. This is partly true, but there were some much heavier scoops provided by this shop as well.
\nLooking at modes ($\\var{modea}$ and $\\var{modeb}$) can be very misleading, because the modal weight for Tasty Hell is the maximum value at the same time, so it is not a reliable measure of average in this case.
\nAlice wants her children's ice creams to be very similar.
\nThis is more likely to happen in the shop with a lower range of values.
\nComparing the ranges, the range of weight of Sweet Heaven scoops ($\\var{rangea}$) is far lower than that of Tasty Hell scoops ($\\var{rangeb}$), implying Sweet Heaven is more consistent with their scoops.
"}, {"name": "Relative Frequency ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}], "advice": "The relative frequency of an outcome is the frequency of the outcome divided by the number of trials.
\nWe are told that $\\var{no_people}$ people were asked whether they preferred to buy free-range eggs or caged eggs in supermarkets and that $\\var{free_range}$ of these people said that they preferred to buy free-range eggs.
\nTo calculate the relative frequency of people who prefer buying free-range eggs we need the number of trials and the frequency of people who said that they preferred buying free-range eggs.
\nSo, the number of trials in this situation is the number of people who were asked the question, which is $\\var{no_people}$.
\nThe frequency of people who said that they preferred to buy free-range eggs is $\\var{free_range}$.
\nTherefore, the relative frequency of people who prefer buying free-range eggs is
\n\\[
\\frac{\\var{free_range}}{\\var{no_people}} = \\var{dpformat({free_range/no_people}, 2)} \\; (\\text{rounded to $2$ decimal places}).
\\]
We are told that the relative frequency of a student being taller than $150$ cm is $\\var{rel_freq}$.
\nHere, we must use the formula for relative frequency in reverse in order to estimate the number of students in the class who are taller than $150$ cm.
\nAs we are using relative frequency to calculate this number, our answer may not be completely accurate, therefore our answer will be an estimate of the actual number.
\nIf we let $n$ denote the number of students in the class who are taller than $150$ cm and if there are $\\var{no_students}$ students in the class then
\n\\[
\\begin{align}
\\frac{n}{\\var{no_students}} &= \\var{rel_freq}\\\\
n &= \\var{rel_freq} \\times \\var{no_students}\\\\
&= \\var{{rel_freq}*{no_students}}.
\\end{align}
\\]
As $n$ represents a number of people we must round our value of $n$ to the nearest integer.
\nSo, the estimated number of students in the class who are taller than $150$ cm is $\\var{dpformat({rel_freq}*{no_students},0)}$.
\n\n
i)
\nUsing the frequency table given in the question, we can calculate the sample size of the survey by adding together the frequencies of each of the different types of pets.
\nSo, the sample size of the survey is
\n\\[
\\var{dog}+\\var{cat}+\\var{hamster}+\\var{parrot} = \\var{{dog}+{cat}+{hamster}+{parrot}}.
\\]
ii)
\nTo calculate the relative frequency of a person having a dog as a pet, we divide the frequency of people in the survey who had a dog as a pet by the sample size of the survey.
\nSo, the relative frequency is
\n\\[
\\frac{\\var{dog}}{\\var{n}} = \\var{dpformat({dog/n}, 2)} \\; (\\text{rounded to $2$ decimal places}).
\\]
The relative frequency of an outcome is the frequency of the outcome divided by the number of trials.
", "variables": {"dog": {"name": "dog", "group": "Ungrouped variables", "templateType": "anything", "description": "Frequency of dog in part c
", "definition": "random(10..50)"}, "free_range": {"name": "free_range", "group": "Ungrouped variables", "templateType": "anything", "description": "Number of people who prefer free-range eggs in part a)
", "definition": "random(10..40)"}, "cat": {"name": "cat", "group": "Ungrouped variables", "templateType": "anything", "description": "Frequency of cat in part c.
", "definition": "random(10..50 except dog)"}, "parrot": {"name": "parrot", "group": "Ungrouped variables", "templateType": "anything", "description": "Frequency of guinea pig in part c.
", "definition": "random(10..50 except dog except cat except hamster)"}, "rel_freq": {"name": "rel_freq", "group": "Ungrouped variables", "templateType": "anything", "description": "Relative frequency for part b
", "definition": "random(0.1..0.9 # 0.01)"}, "n": {"name": "n", "group": "Ungrouped variables", "templateType": "anything", "description": "Sample size for part c
", "definition": "dog+cat+hamster+parrot"}, "no_students": {"name": "no_students", "group": "Ungrouped variables", "templateType": "anything", "description": "Number of students in the class for part b
", "definition": "random(20..40 #10)"}, "no_people": {"name": "no_people", "group": "Ungrouped variables", "templateType": "anything", "description": "Number of people asked in part a)
", "definition": "random(50..150 #10)"}, "hamster": {"name": "hamster", "group": "Ungrouped variables", "templateType": "anything", "description": "Frequency of hamster in part c
", "definition": "random(10..40 except dog except cat) "}}, "tags": ["Experimental Probability", "Relative Frequency", "taxonomy"], "ungrouped_variables": ["no_people", "free_range", "no_students", "rel_freq", "dog", "cat", "hamster", "parrot", "n"], "functions": {}, "preamble": {"js": "", "css": ""}, "type": "question", "variable_groups": [], "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "metadata": {"description": "Calculate relative frequencies in a variety of scenarios.
", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "strictPrecision": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "correctAnswerStyle": "plain", "precision": "2", "scripts": {}, "maxValue": "{free_range}/{no_people}", "prompt": "$\\var{no_people}$ people were asked whether they preferred to buy free-range eggs or caged eggs in supermarkets. $\\var{free_range}$ people said that they preferred to buy free-range eggs. What is the relative frequency of people who prefer buying free-range eggs? Give your answer as a decimal, to $2$ decimal places.
\n", "marks": 1, "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerFraction": false, "minValue": "{free_range}/{no_people}", "precisionType": "dp", "showCorrectAnswer": true, "type": "numberentry", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionMessage": "You must give your answer as a decimal to 2 decimal places.
"}, {"notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": 0, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "correctAnswerStyle": "plain", "precision": 0, "scripts": {}, "maxValue": "{no_students}*{rel_freq}", "prompt": "The heights of a class of students were measured. The relative frequency of a student being taller than $150$ cm is known to be $\\var{rel_freq}$. If there are $\\var{no_students}$ students in the class, estimate the number of students who are taller than $150$ cm.
", "marks": 1, "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerFraction": false, "minValue": "{no_students}*{rel_freq}", "precisionType": "dp", "showCorrectAnswer": true, "type": "numberentry", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionMessage": "Round your answer to the nearest integer.
"}, {"scripts": {}, "showCorrectAnswer": true, "gaps": [{"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "minValue": "{dog}+{cat}+{hamster}+{parrot}", "correctAnswerFraction": false, "allowFractions": false, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "scripts": {}, "maxValue": "{dog}+{cat}+{hamster}+{parrot}", "showCorrectAnswer": true, "type": "numberentry", "marks": 1, "variableReplacementStrategy": "originalfirst"}, {"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "precisionPartialCredit": 0, "strictPrecision": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "minValue": "{dog}/({dog}+{cat}+{hamster}+{parrot})", "allowFractions": false, "correctAnswerStyle": "plain", "precisionType": "dp", "scripts": {}, "maxValue": "{dog}/({dog}+{cat}+{hamster}+{parrot})", "showCorrectAnswer": true, "precision": "2", "type": "numberentry", "showPrecisionHint": true, "marks": 1, "showFeedbackIcon": true, "precisionMessage": "Round your answer to 2 decimal places.
"}], "type": "gapfill", "prompt": "A survey was conducted to find out what type of pet is the most common. The results are given in the table below.
\nType of Pet | \nFrequency | \n
Dog | \n$\\var{dog}$ | \n
Cat | \n$\\var{cat}$ | \n
Hamster | \n$\\var{hamster}$ | \n
Parrot | \n\n $\\var{parrot}$ \n | \n
i)
\nWhat was the sample size for the survey?
\n[[0]]
\nii)
\nWhat is the relative frequency of a person having a dog as a pet? Give your answer as a decimal, to $2$ decimal places.
\n[[1]]
\n", "variableReplacementStrategy": "originalfirst", "marks": 0, "variableReplacements": [], "showFeedbackIcon": true}]}, {"name": "Calculating Expected Values given a table of probabilities", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}], "type": "question", "tags": ["Dice", "dice", "Expected values", "Expected Values", "Experimental Probability", "experimental probability", "Experimental probability", "Probability", "probability", "relative frequency", "Relative Frequency", "taxonomy", "Theoretical Probability", "theoretical probability"], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"SW": {"templateType": "anything", "name": "SW", "description": "Probability someone goes to see Star Wars
", "definition": "random(0.4..0.51 #0.05)", "group": "Ungrouped variables"}, "Avatar": {"templateType": "anything", "name": "Avatar", "description": "Probability someone sees Avatar
", "definition": "random(0.2..0.31 #0.05)", "group": "Ungrouped variables"}, "NYSM": {"templateType": "anything", "name": "NYSM", "description": "Probability someone goes to see Now you see me
", "definition": "(1-(Avatar+SW))*3/5", "group": "Ungrouped variables"}, "TIJ": {"templateType": "anything", "name": "TIJ", "description": "Probability someone goes to see the Italian Job
", "definition": "1-(Avatar+SW+NYSM)", "group": "Ungrouped variables"}, "no_people": {"templateType": "anything", "name": "no_people", "description": "Number of people who see a movie.
", "definition": "random(100..180 #20)", "group": "Ungrouped variables"}}, "functions": {}, "statement": "There are four films being shown in a cinema on a particular day.
\nThe probability that a person buys a ticket to see each film, denoted $P(\\text{Film})$, is given in the table below.
\nFilm | \n$P(\\text{Film})$ | \nGenre | \n
Forgotten Game | \n$\\var{Avatar}$ | \nSci-Fi | \n
The Diamond Valley | \n$\\var{SW}$ | \nSci-Fi | \n
School of Return | \n$\\var{NYSM}$ | \nThriller | \n
The Silk's Nobody | \n$\\var{TIJ}$ | \nCrime | \n
$\\var{no_people}$ people each buy a ticket at the cinema to see a film of their own choosing during the day.
", "variable_groups": [], "parts": [{"correctAnswerFraction": false, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "maxValue": "{no_people}*{Avatar}", "showFeedbackIcon": true, "prompt": "How many of these people would you expect to have bought tickets to see Forgotten Game?
", "minValue": "{no_people}*{Avatar}", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "marks": 1, "showCorrectAnswer": true}, {"correctAnswerFraction": false, "scripts": {}, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "maxValue": "{no_people}*({Avatar}+{SW})", "showFeedbackIcon": true, "prompt": "How many of these people would you expect to have bought tickets to see a Sci-Fi film?
", "minValue": "{no_people}*({Avatar}+{SW})", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "marks": 1, "showCorrectAnswer": true}], "ungrouped_variables": ["Avatar", "SW", "NYSM", "TIJ", "no_people"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "This question assesses the students ability to find the expected number of times an event occurs given the probability of the event occurring for a single trial and the total number of trials.
"}, "preamble": {"css": "", "js": ""}, "advice": "If we are given the probability of an event occurring in a single trial then we can calculate the expected number of times that this event would occur in a larger number of trials.
\nTo do this, we multiply the probability of the event occurring in a single trial by the total number of trials:
\n\\[\\text{Expected number of times an event occurs} = \\text{Probability of event} \\times \\text{Number of trials}.\\]
\nWe are given the probabilities that someone buys a ticket to see each film in the table below.
\nFilm | \n$P(\\text{Film})$ | \nGenre | \n
Forgotten Game | \n$\\var{Avatar}$ | \nSci-Fi | \n
The Diamond Valley | \n$\\var{SW}$ | \nSci-Fi | \n
School of Return | \n$\\var{NYSM}$ | \nThriller | \n
The Silk's Nobody | \n$\\var{TIJ}$ | \nCrime | \n
We are also told that $\\var{no_people}$ people each buy a ticket at the cinema to see a film of their own choosing during this day.
\nTo calculate the expected number of people who bought tickets to see one of these films we multiply the probability that a person buys a ticket for that film by how many people bought tickets for a film at the cinema.
\nSo the expected number of people who bought tickets to see Forgotten Game is
\n\\[
\\var{Avatar} \\times \\var{no_people} = \\var{{Avatar}*{no_people}}.
\\]
We are now asked to calculate the expected number of people who bought tickets to see a Sci-Fi film.
\nFrom the table above we can see that there are two films which belong to the Sci-Fi genre: Forgotten Game and The Diamond Valley.
\nFirstly, we need to calculate the probability that a person buys a ticket to see a Sci-Fi film, which we will denote $P(\\text{Sci-Fi})$.
\nSince the probability that a person buys a ticket to see each film is different, it would be incorrect to say that the probability that a person buys a ticket to see a Sci-Fi film is
\n\\[\\displaystyle\\frac{2}{4} = \\displaystyle\\frac{1}{2}.\\]
\nInstead we must recognise that the probability that a person buys a ticket to see a Sci-Fi film is the probability that a person buys a ticket to see either Forgotten or The Diamond Valley.
\nTherefore to calculate this probability, we add the probabilities of a person buying a ticket to see each of these films:
\n\\[
\\begin{align}
P(\\text{Sci-Fi}) &= P(\\text{Forgotten Game})+P(\\text{The Diamond Valley})\\\\
&= \\var{Avatar}+\\var{SW}\\\\
&= \\var{Avatar+SW}.
\\end{align}
\\]
Then the expected number of people who bought tickets to see a Sci-Fi film is
\n\\[
\\var{Avatar+SW} \\times \\var{no_people} = \\var{({Avatar+SW})*{no_people}}.
\\]
Calculate and work with measures of central tendency such as mean, median and mode, and measures of spread such as range and standard deviation.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "name": "Measures of central tendency and spread-original without context", "duration": 0, "navigation": {"showfrontpage": true, "preventleave": true, "onleave": {"action": "none", "message": ""}, "browse": true, "allowregen": true, "showresultspage": "oncompletion", "reverse": true}, "type": "exam", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}