// Numbas version: finer_feedback_settings {"name": "Simon's copy of Averages (frequency table)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"name": "Frequencies", "variables": ["f1", "f2", "f3", "f4", "f5", "f6"]}, {"name": "Cumulative", "variables": ["cf2", "cf3", "cf4", "cf5", "tot"]}, {"name": "Median calculations", "variables": ["a1", "a2", "a3", "a4", "a5", "mp5", "median"]}, {"name": "Mean calculations", "variables": ["sfx", "mn"]}], "statement": "
Calculate the mean, the median and the mode for the following frequency table:
\nClass | \n0 | \n1 | \n2 | \n3 | \n4 | \n5 | \n
Frequency | \n{f1} | \n{f2} | \n{f3} | \n{f4} | \n{f5} | \n{f6} | \n
Find the mean value, giving your answer to 2 d.p.
", "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "steps": [{"unitTests": [], "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "prompt": "To find the mean use the formula $\\frac{\\Sigma fx}{\\Sigma f}$
", "type": "information", "showFeedbackIcon": true}], "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "scripts": {}, "type": "numberentry", "showPrecisionHint": true, "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "minValue": "{mn}", "mustBeReduced": false, "correctAnswerFraction": false, "stepsPenalty": 0, "precisionType": "dp", "maxValue": "{mn}", "precision": "2", "variableReplacements": [], "mustBeReducedPC": 0, "showFeedbackIcon": true}, {"unitTests": [], "scripts": {}, "marks": "3", "showCorrectAnswer": true, "minValue": "{median}", "correctAnswerStyle": "plain", "showFeedbackIcon": true, "prompt": "What is the median value?
", "correctAnswerFraction": false, "stepsPenalty": "1", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "allowFractions": false, "steps": [{"unitTests": [], "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "prompt": "The median is the \"middle\" value.
\nIn a frequency table, the observations are already arranged in an ascending order. We can obtain the median by looking for the value in the middle position.
\nFirst add up the frequencies to find $n$.
\nCase 1. When the sum of the frequencies is odd, then the median is the value at the $\\frac{n+1}{2}^{th}$ position.
Case 2. When the sum of the frequencies is even, then the median is the average of values at the positions $\\frac{n}{2}^{th}$ and $\\frac{n+2}{2}^{th}$.
We need to add up the frequencies until we reach this value and then the class we land in is the median.
What is the mode?
", "correctAnswerFraction": false, "stepsPenalty": "1", "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "allowFractions": false, "steps": [{"unitTests": [], "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "prompt": "The mode is the number which occurs most often. In other words the class with the highest frequency.
", "type": "information", "showFeedbackIcon": true}], "customMarkingAlgorithm": "", "maxValue": "1", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "type": "numberentry"}], "metadata": {"description": "rebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "ungrouped_variables": ["a", "b"], "tags": [], "advice": "(a)
\nTo find the mean use the formula $\\frac{\\Sigma fx}{\\Sigma f}$
\nIn other words
\nIn other words $\\frac{(0\\times\\var{f1})+(1\\times \\var{f2})+(2\\times\\var{f3})+(3\\times\\var{f4}) +(4\\times\\var{f5})+(5\\times\\var{f6})}{\\var{f1}+\\var{f2}+\\var{f3}+\\var{f4}+\\var{f5}+\\var{f6}}$
\n$=\\frac{\\var{sfx}}{\\var{tot}}=\\var{precround(sfx/(tot),2)}$
\n\n\n(b)
\nThe median is the \"middle\" value.
\nIn a frequency table, the observations are already arranged in an ascending order. We can obtain the median by looking for the value in the middle position.
\nFirst add up the frequencies to find $n$.
\nCase 1. When the sum of the frequencies is odd, then the median is the value at the $\\frac{n+1}{2}^{th}$ position.
Case 2. When the sum of the frequencies is even, then the median is the mean of values at the positions $\\frac{n}{2}^{th}$ and $\\frac{n+2}{2}^{th}$.
We need to add up the frequencies until we reach this value and then the class we land in is the median.
In our example, $n=\\var{f1}+\\var{f2}+\\var{f3}+\\var{f4}+\\var{f5}+\\var{f6}=\\var{tot}$
\nSince $n$ is odd, the median is the value at the $\\frac{n+1}{2}=\\frac{\\var{tot}+1}{2}^{th}$ position, i.e. value number $\\var{(tot+1)/2}$
\nFrom our table, we can calculate the following cumulative frequencies:
\nClass | \n0 | \n1 | \n2 | \n3 | \n4 | \n5 | \n
Frequency | \n{f1} | \n{f2} | \n{f3} | \n{f4} | \n{f5} | \n{f6} | \n
Cum Freq | \n{f1} | \n{cf2} | \n{cf3} | \n{cf4} | \n{cf5} | \n{tot} | \n
And by looking at our cumulative frequencies we can see that value number $\\var{(tot+1)/2}$ occurs in class $\\var{median}$, which is therefore our median class.
\n\n(c)
\nThe mode is the number which occurs most often. In other words the class with the highest frequency.
\nIn this example, the mode is 1, since {f2} is the highest frequency.
\n", "name": "Simon's copy of Averages (frequency table)", "variables": {"cf5": {"name": "cf5", "group": "Cumulative", "definition": "cf4+f5", "description": "", "templateType": "anything"}, "cf4": {"name": "cf4", "group": "Cumulative", "definition": "cf3+f4", "description": "", "templateType": "anything"}, "mn": {"name": "mn", "group": "Mean calculations", "definition": "sfx/tot", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..f1-1)", "description": "", "templateType": "anything"}, "f3": {"name": "f3", "group": "Frequencies", "definition": "f1-1", "description": "", "templateType": "anything"}, "mp5": {"name": "mp5", "group": "Median calculations", "definition": "tot/2", "description": "", "templateType": "anything"}, "cf2": {"name": "cf2", "group": "Cumulative", "definition": "f1+f2", "description": "", "templateType": "anything"}, "a3": {"name": "a3", "group": "Median calculations", "definition": "switch(cf3