// Numbas version: exam_results_page_options {"name": "Measures of central tendency from a list", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Measures of central tendency from a list", "tags": [], "metadata": {"description": "

This question provides a list of data to the student. They are asked to find the mean, median, mode and range.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The average number of tackles per game was measured during the last Rugby Union World Cup.

\n

Here is a random sample from 20 forwards:

\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
$\\var{x[0]}$$\\var{x[1]}$$\\var{x[2]}$$\\var{x[3]}$$\\var{x[4]}$$\\var{x[5]}$$\\var{x[6]}$$\\var{x[7]}$$\\var{x[8]}$$\\var{x[9]}$
$\\var{x[10]}$$\\var{x[11]}$$\\var{x[12]}$$\\var{x[13]}$$\\var{x[14]}$$\\var{x[15]}$$\\var{x[16]}$$\\var{x[17]}$$\\var{x[18]}$$\\var{x[19]}$
\n

", "advice": "

a)

\n

The mean is the sum of all the responses ($\\sum x$) divided by the number of responses ($n$).

\n

Here, $n = 20$.

\n

\\begin{align}
\\sum x &= \\var{x[0]} + \\var{x[1]} +\\var{x[2]} +\\var{x[3]} +\\var{x[4]} +\\var{x[5]} +\\var{x[6]} +\\var{x[7]} +\\var{x[8]} +\\var{x[9]} + \\var{x[10]} + \\var{x[11]} +\\var{x[12]} +\\var{x[13]} +\\var{x[14]} +\\var{x[15]} +\\var{x[16]} +\\var{x[17]} +\\var{x[18]} +\\var{x[19]} \\\\
&= \\var{sum(x)} \\text{.}
\\end{align}

\n

Therefore we calculate the mean

\n

\\begin{align}
\\overline{x} &= \\frac{\\sum x}{n} \\\\[0.5em]
&= \\frac{\\var{sum(x)}}{20} \\\\[0.5em]
&= \\var{meanx} \\text{.}
\\end{align}

\n

 

\n

b)

\n

The median is the middle value. We need to sort the list in ascending order:

\n

\\[ \\var{s[0]}, \\quad \\var{s[1]}, \\quad \\var{s[2]}, \\quad \\var{s[3]}, \\quad \\var{s[4]}, \\quad \\var{s[5]}, \\quad \\var{s[6]}, \\quad \\var{s[7]}, \\quad \\var{s[8]}, \\quad \\var{s[9]}, \\quad \\var{s[10]}, \\quad \\var{s[11]}, \\quad \\var{s[12]}, \\quad \\var{s[13]}, \\quad \\var{s[14]}, \\quad \\var{s[15]}, \\quad \\var{s[16]}, \\quad \\var{s[17]}, \\quad \\var{s[18]}, \\quad \\var{s[19]} \\]

\n

There is an even number of responses, so there are two numbers in the middle (10th and 11th place). To find the median, we need to find the mean of these two numbers $\\var{s[9]}$ and $\\var{s[10]}$:

\n

\\begin{align}
\\frac{\\var{s[9]} + \\var{s[10]}}{2} &=  \\frac{\\var{s[9] + s[10]}}{2} \\\\
&= \\var{medianx} \\text{.} 
\\end{align}

\n

 

\n

c)

\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

$\\var{s[0]}, \\var{s[1]}, \\var{s[2]}, \\var{s[3]}, \\var{s[4]}, \\var{s[5]}, \\var{s[6]}, \\var{s[7]}, \\var{s[8]}, \\var{s[9]}, \\var{s[10]}, \\var{s[11]}, \\var{s[12]}, \\var{s[13]}, \\var{s[14]}, \\var{s[15]}, \\var{s[16]}, \\var{s[17]}, \\var{s[18]}, \\var{s[19]}$.

\n

We notice that the values $\\var{modex}$ occur the most. The lowest of these values is $\\var{modex[0]}$.

\n

 

\n

d)

\n

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(x)} - \\var{min(x)} = \\var{rangex} \\text{.}\\]

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"modea1": {"name": "modea1", "group": "Ungrouped variables", "definition": "mode(a1)", "description": "", "templateType": "anything", "can_override": false}, "mean": {"name": "mean", "group": "final list", "definition": "mean(a)", "description": "", "templateType": "anything", "can_override": false}, "modea2": {"name": "modea2", "group": "Ungrouped variables", "definition": "mode(a2)", "description": "", "templateType": "anything", "can_override": false}, "sigm": {"name": "sigm", "group": "Ungrouped variables", "definition": "5", "description": "", "templateType": "anything", "can_override": false}, "medianx": {"name": "medianx", "group": "Ungrouped variables", "definition": "median(x)", "description": "", "templateType": "anything", "can_override": false}, "meanx": {"name": "meanx", "group": "Ungrouped variables", "definition": "mean(x)", "description": "", "templateType": "anything", "can_override": false}, "a3": {"name": "a3", "group": "Ungrouped variables", "definition": "shuffle([ random(0..1),\n 2, \n random(4..6),\n random(0..3 except 2), \n random(0..3 except 2),\n random(4..6),\n 2,\n 2,\n random(4..6),\n random(7..8),\n random(0..3 except 2 except 1), \n random(4..6),\n 2,\n random(1..3 except 2), \n random(7..8),\n 2,\n random(7..8),\n random(4..6), \n random(0..3 except 2), \n 2\n])", "description": "

Option 3 for the list. Ensures there is only one mode (2) while still randomising the data.

", "templateType": "anything", "can_override": false}, "x": {"name": "x", "group": "Ungrouped variables", "definition": "repeat(precround(normalsample(mu,sigm),0),20)", "description": "", "templateType": "anything", "can_override": false}, "mu": {"name": "mu", "group": "Ungrouped variables", "definition": "23", "description": "", "templateType": "anything", "can_override": false}, "rangex": {"name": "rangex", "group": "Ungrouped variables", "definition": "range(x)", "description": "", "templateType": "anything", "can_override": false}, "range": {"name": "range", "group": "final list", "definition": "max(a) - min(a)", "description": "", "templateType": "anything", "can_override": false}, "modex": {"name": "modex", "group": "Ungrouped variables", "definition": "mode(x)", "description": "", "templateType": "anything", "can_override": false}, "mode1": {"name": "mode1", "group": "final list", "definition": "mode[0]", "description": "

Mode as a value.

", "templateType": "anything", "can_override": false}, "modetimes": {"name": "modetimes", "group": "final list", "definition": "map(\nlen(filter(x=j,x,a)),\nj, 0..8)", "description": "

The vector of number of times of each value in the data.

", "templateType": "anything", "can_override": false}, "median": {"name": "median", "group": "final list", "definition": "median(a)", "description": "", "templateType": "anything", "can_override": false}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "repeat(random(0..8), 20)", "description": "

Option 1 for the list. Only used if there is only one mode.

", "templateType": "anything", "can_override": false}, "mode": {"name": "mode", "group": "final list", "definition": "mode(a)", "description": "

Mode as a vector.

", "templateType": "anything", "can_override": false}, "as": {"name": "as", "group": "final list", "definition": "sort(a)", "description": "

Sorted list.

", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "sort(x)", "description": "", "templateType": "anything", "can_override": false}, "a2": {"name": "a2", "group": "Ungrouped variables", "definition": "repeat(random(0..8), 20)", "description": "

Option 2 for the list. Only used if there is only one mode and option 1 was not used.

", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "final list", "definition": "if(len(modea1) = 1, a1, if(len(modea2) = 1, a2, a3))", "description": "

The final list.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["modea1", "modea2", "a1", "a2", "a3", "mu", "sigm", "x", "modex", "meanx", "medianx", "rangex", "s"], "variable_groups": [{"name": "final list", "variables": ["a", "as", "mean", "median", "mode", "mode1", "range", "modetimes"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the mean number of tackles.

", "minValue": "meanx", "maxValue": "meanx", "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": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the median number of tackles.

", "minValue": "medianx", "maxValue": "medianx", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the mode number of tackles. If there is more than one modal value, enter the smallest modal value.

", "minValue": "modex[0]", "maxValue": "modex[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the range of the number of tackles.

", "minValue": "rangex", "maxValue": "rangex", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}, {"name": "Pete Philipson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/13881/"}]}]}], "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": "Vicky Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/659/"}, {"name": "Stanislav Duris", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1590/"}, {"name": "Lauren Frances Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2490/"}, {"name": "Pete Philipson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/13881/"}]}