// Numbas version: exam_results_page_options {"name": "Michael's copy of 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": [{"rulesets": {}, "extensions": ["stats"], "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

", "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"}, "functions": {}, "variables": {"a2": {"description": "

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

", "templateType": "anything", "name": "a2", "group": "Ungrouped variables", "definition": "repeat(random(0..8), 20)"}, "sigm": {"description": "", "templateType": "anything", "name": "sigm", "group": "Ungrouped variables", "definition": "5"}, "mode1": {"description": "

Mode as a value.

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

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

", "templateType": "anything", "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])"}, "mu": {"description": "", "templateType": "anything", "name": "mu", "group": "Ungrouped variables", "definition": "23"}, "meanx": {"description": "", "templateType": "anything", "name": "meanx", "group": "Ungrouped variables", "definition": "mean(x)"}, "medianx": {"description": "", "templateType": "anything", "name": "medianx", "group": "Ungrouped variables", "definition": "median(x)"}, "a1": {"description": "

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

", "templateType": "anything", "name": "a1", "group": "Ungrouped variables", "definition": "repeat(random(0..8), 20)"}, "as": {"description": "

Sorted list.

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

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

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

The final list.

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

Mode as a vector.

", "templateType": "anything", "name": "mode", "group": "final list", "definition": "mode(a)"}, "s": {"description": "", "templateType": "anything", "name": "s", "group": "Ungrouped variables", "definition": "sort(x)"}, "modex": {"description": "", "templateType": "anything", "name": "modex", "group": "Ungrouped variables", "definition": "mode(x)"}}, "variable_groups": [{"name": "final list", "variables": ["a", "as", "mean", "median", "mode", "mode1", "range", "modetimes"]}], "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "name": "Michael's copy of Measures of central tendency from a list", "parts": [{"correctAnswerFraction": false, "mustBeReduced": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "precision": "2", "maxValue": "meanx", "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision.", "customMarkingAlgorithm": "", "precisionType": "dp", "allowFractions": false, "strictPrecision": false, "minValue": "meanx", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 1, "precisionPartialCredit": 0, "prompt": "

Find the mean number of tackles.

", "unitTests": [], "mustBeReducedPC": 0, "showFeedbackIcon": true, "correctAnswerStyle": "plain"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "prompt": "

Find the median number of tackles.

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

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

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

Find the range of the number of tackles.

", "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "marks": 1, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "unitTests": [], "maxValue": "rangex", "variableReplacements": [], "customMarkingAlgorithm": "", "mustBeReducedPC": 0, "showFeedbackIcon": true, "allowFractions": false, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "minValue": "rangex"}], "ungrouped_variables": ["modea1", "modea2", "a1", "a2", "a3", "mu", "sigm", "x", "modex", "meanx", "medianx", "rangex", "s"], "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{.}\\]

", "preamble": {"js": "", "css": ""}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"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/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"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/"}]}