// Numbas version: exam_results_page_options {"name": "Michael's copy of Weight of a scoop in two ice cream parlours", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "name": "Michael's copy of Weight of a scoop in two ice cream parlours", "variables": {"medianb": {"name": "medianb", "definition": "median(b)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "asort": {"name": "asort", "definition": "sort(a)", "description": "", "group": "A", "templateType": "anything"}, "b2": {"name": "b2", "definition": "meanab - 14", "description": "", "group": "B", "templateType": "anything"}, "b7": {"name": "b7", "definition": "meanab - 2", "description": "", "group": "B", "templateType": "anything"}, "modea": {"name": "modea", "definition": "mode(a)[0]", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "a2": {"name": "a2", "definition": "meanab - 1 - random2", "description": "", "group": "A", "templateType": "anything"}, "blist": {"name": "blist", "definition": "[b1,b2,b3,b4,b5,b6,b7,b8,b9,b10]", "description": "", "group": "B", "templateType": "anything"}, "a1": {"name": "a1", "definition": "meanab - 2 - random2", "description": "", "group": "A", "templateType": "anything"}, "a4": {"name": "a4", "definition": "meanab", "description": "", "group": "A", "templateType": "anything"}, "meana": {"name": "meana", "definition": "(a1 + a2 + a3 + a4 + a5+ a6 + a7 + a8 + a9 + a10)/10", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "a10": {"name": "a10", "definition": "meanab + 2 + random2", "description": "", "group": "A", "templateType": "anything"}, "a": {"name": "a", "definition": "shuffle(alist)", "description": "", "group": "A", "templateType": "anything"}, "suma": {"name": "suma", "definition": "sum(a)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "mediana": {"name": "mediana", "definition": "median(a)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "rangea": {"name": "rangea", "definition": "max(a) - min(a)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "modeb": {"name": "modeb", "definition": "mode(b)[0]", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "meanb": {"name": "meanb", "definition": "(b1+b2+b3+b4+b5+b6+b7+b8+b9+b10)/10", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "meanab": {"name": "meanab", "definition": "random(80..90)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "a5": {"name": "a5", "definition": "meanab", "description": "", "group": "A", "templateType": "anything"}, "alist": {"name": "alist", "definition": "[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10]", "description": "", "group": "A", "templateType": "anything"}, "b": {"name": "b", "definition": "shuffle(blist)", "description": "", "group": "B", "templateType": "anything"}, "b8": {"name": "b8", "definition": "meanab + 13", "description": "", "group": "B", "templateType": "anything"}, "b10": {"name": "b10", "definition": "meanab + 27 + random/2", "description": "", "group": "B", "templateType": "anything"}, "b5": {"name": "b5", "definition": "meanab - 8 ", "description": "", "group": "B", "templateType": "anything"}, "a8": {"name": "a8", "definition": "meanab + 1", "description": "", "group": "A", "templateType": "anything"}, "b4": {"name": "b4", "definition": "meanab - 10", "description": "", "group": "B", "templateType": "anything"}, "a9": {"name": "a9", "definition": "meanab + 1 + random2", "description": "", "group": "A", "templateType": "anything"}, "random2": {"name": "random2", "definition": "random(1..3)", "description": "", "group": "A", "templateType": "anything"}, "b6": {"name": "b6", "definition": "meanab - 6", "description": "", "group": "B", "templateType": "anything"}, "bsort": {"name": "bsort", "definition": "sort(b)", "description": "", "group": "B", "templateType": "anything"}, "b3": {"name": "b3", "definition": "meanab - 12", "description": "", "group": "B", "templateType": "anything"}, "a7": {"name": "a7", "definition": "meanab + 1", "description": "", "group": "A", "templateType": "anything"}, "rangeb": {"name": "rangeb", "definition": "max(b) - min(b)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "b1": {"name": "b1", "definition": "meanab - 15 - random", "description": "", "group": "B", "templateType": "anything"}, "random": {"name": "random", "definition": "random(2..10 #2)", "description": "", "group": "B", "templateType": "anything"}, "sumb": {"name": "sumb", "definition": "sum(b)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "a3": {"name": "a3", "definition": "meanab - 2", "description": "", "group": "A", "templateType": "anything"}, "a6": {"name": "a6", "definition": "meanab", "description": "", "group": "A", "templateType": "anything"}, "b9": {"name": "b9", "definition": "meanab + 27 + random/2", "description": "", "group": "B", "templateType": "anything"}}, "ungrouped_variables": ["meanab", "meana", "modea", "mediana", "meanb", "modeb", "medianb", "rangea", "rangeb", "suma", "sumb"], "parts": [{"gaps": [{"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "meana", "scripts": {}, "minValue": "meana", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "meanb", "scripts": {}, "minValue": "meanb", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "mediana", "scripts": {}, "minValue": "mediana", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "medianb", "scripts": {}, "minValue": "medianb", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "modea", "scripts": {}, "minValue": "modea", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "modeb", "scripts": {}, "minValue": "modeb", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "rangea", "scripts": {}, "minValue": "rangea", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}, {"correctAnswerStyle": "plain", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "marks": 1, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "rangeb", "scripts": {}, "minValue": "rangeb", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "correctAnswerFraction": false}], "marks": 0, "scripts": {}, "showCorrectAnswer": true, "variableReplacements": [], "showFeedbackIcon": true, "prompt": "

Using the data above, fill in the following table.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)Tasty Hell (g)
Mean weight[[0]][[1]]
Median weight[[2]][[3]]
Modal weight[[4]][[5]]
Range[[6]][[7]]
\n

", "variableReplacementStrategy": "originalfirst", "type": "gapfill"}, {"maxMarks": 0, "displayType": "radiogroup", "scripts": {}, "variableReplacements": [], "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?

", "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "marks": 0, "matrix": ["2", "0"], "choices": ["

Sweet Heaven

", "

Tasty Hell

"], "distractors": ["", ""], "shuffleChoices": false, "showCorrectAnswer": true, "displayColumns": 0, "minMarks": 0}], "tags": ["mean", "median", "mode", "range", "taxonomy"], "variable_groups": [{"name": "A", "variables": ["random2", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", "alist", "a", "asort"]}, {"name": "B", "variables": ["random", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "b10", "blist", "b", "bsort"]}], "preamble": {"css": "", "js": ""}, "functions": {}, "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.

"}, "advice": "

We denote Sweet Heaven as $s$ and Tasty Hell as $t$.

\n

a)

\n

We are going to start with completing the column for Sweet Heaven.

\n

First, 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}\\]

\n

The total number of measurements $n$ is $10$.

\n

Therefore 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:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)$\\var{asort[0]}$$\\var{asort[1]}$$\\var{asort[2]}$$\\var{asort[3]}$$\\var{asort[4]}$$\\var{asort[5]}$$\\var{asort[6]}$$\\var{asort[7]}$$\\var{asort[8]}$$\\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.

\n

To find a mode, we can look at our sorted list:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)$\\var{asort[0]}$$\\var{asort[1]}$$\\var{asort[2]}$$\\var{asort[3]}$$\\var{asort[4]}$$\\var{asort[5]}$$\\var{asort[6]}$$\\var{asort[7]}$$\\var{asort[8]}$$\\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.

\n

To 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)
Mean weight$\\var{meana}$
Median weight$\\var{mediana}$
Modal weight$\\var{modea}$
Range$\\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}\\]

\n

The total number of measurements $n$ is $10$ again.

\n

Therefore 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:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Tasty Hell (g)$\\var{bsort[0]}$$\\var{bsort[1]}$$\\var{bsort[2]}$$\\var{bsort[3]}$$\\var{bsort[4]}$$\\var{bsort[5]}$$\\var{bsort[6]}$$\\var{bsort[7]}$$\\var{bsort[8]}$$\\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:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Tasty Hell (g)$\\var{bsort[0]}$$\\var{bsort[1]}$$\\var{bsort[2]}$$\\var{bsort[3]}$$\\var{bsort[4]}$$\\var{bsort[5]}$$\\var{bsort[6]}$$\\var{bsort[7]}$$\\var{bsort[8]}$$\\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)Tasty Hell (g)
Mean weight$\\var{meana}$$\\var{meanb}$
Median weight$\\var{mediana}$$\\var{medianb}$
Modal weight$\\var{modea}$$\\var{modeb}$
Range$\\var{rangea}$$\\var{rangeb}$
\n


Let's look at the differences between the two ice cream parlours:

\n

The range of weight of Tasty Hell scoops ($\\var{rangeb}$) is far greater than that of Sweet Heaven scoops ($\\var{rangea}$).

\n

The 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.

\n

When 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.

\n

Looking 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.

\n

b)

\n

Alice wants her children's ice creams to be very similar.

\n

This is more likely to happen in the shop with a lower range of values.

\n

Comparing 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.

", "variablesTest": {"condition": "\n", "maxRuns": 100}, "extensions": ["stats"], "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:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Sweet Heaven (g)$\\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]}$
Tasty Hell (g)$\\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]}$
\n

", "type": "question", "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}]}]}], "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}]}