// Numbas version: finer_feedback_settings {"name": "Averages (frequency table)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "b"], "name": "Averages (frequency table)", "tags": ["average", "frequency table", "REBEL", "rebel", "Rebel", "rebelmaths", "teame"], "preamble": {"css": "", "js": ""}, "advice": "

See \"show steps\" within this question for more help.

", "rulesets": {}, "parts": [{"stepsPenalty": "1", "vsetrangepoints": 5, "prompt": "

What is the mean value (correct to 2 decimal places)?

", "expectedvariablenames": [], "checkingaccuracy": "2", "vsetrange": [0, 1], "showpreview": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

To find the mean use the formula $\\frac{\\Sigma fx}{\\Sigma f}$

\n

In 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}}$

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "showCorrectAnswer": true, "scripts": {}, "answer": "{mn}", "marks": "4", "checkvariablenames": false, "checkingtype": "dp", "type": "jme"}, {"stepsPenalty": "1", "prompt": "

What is the median value?

", "allowFractions": false, "variableReplacements": [], "maxValue": "{median}", "minValue": "{median}", "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

The median is the \"middle\" value. 

\n

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

\n

First add up the frequencies to find $n$.

\n

Case 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+1}{2}^{th}$.

\n


We need to add up the frequencies until we reach this value and then the class we land in is the median.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": "3", "type": "numberentry", "showPrecisionHint": false}, {"stepsPenalty": "1", "prompt": "

What is the mode? (If it is undefined, enter \"0\".)

", "allowFractions": false, "variableReplacements": [], "maxValue": "1", "minValue": "1", "variableReplacementStrategy": "originalfirst", "steps": [{"prompt": "

The mode is the number which occurs most often. In other words the class with the  highest frequency.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": "3", "type": "numberentry", "showPrecisionHint": false}], "extensions": [], "statement": "

Calculate the mean, the median and the mode for the following frequency table:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Class012345
Frequency{f1}{f2}{f3}{f4}{f5}{f6}
", "variable_groups": [{"variables": ["f1", "f2", "f3", "f4", "f5", "f6"], "name": "Frequencies"}, {"variables": ["cf2", "cf3", "cf4", "cf5", "tot"], "name": "Cumulative"}, {"variables": ["a1", "a2", "a3", "a4", "a5", "mp5", "median"], "name": "Median calculations"}, {"variables": ["sfx", "mn"], "name": "Mean calculations"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"f1": {"definition": "random(5..20)", "templateType": "anything", "group": "Frequencies", "name": "f1", "description": ""}, "f2": {"definition": "f1+a", "templateType": "anything", "group": "Frequencies", "name": "f2", "description": ""}, "f3": {"definition": "f1-1", "templateType": "anything", "group": "Frequencies", "name": "f3", "description": ""}, "f4": {"definition": "f1-a", "templateType": "anything", "group": "Frequencies", "name": "f4", "description": ""}, "f5": {"definition": "f1-b", "templateType": "anything", "group": "Frequencies", "name": "f5", "description": ""}, "f6": {"definition": "a", "templateType": "anything", "group": "Frequencies", "name": "f6", "description": ""}, "mp5": {"definition": "tot/2", "templateType": "anything", "group": "Median calculations", "name": "mp5", "description": ""}, "tot": {"definition": "cf5+f6", "templateType": "anything", "group": "Cumulative", "name": "tot", "description": ""}, "sfx": {"definition": "0*f1+1*f2+2*f3+3*f4+4*f5+5*f6", "templateType": "anything", "group": "Mean calculations", "name": "sfx", "description": ""}, "a1": {"definition": "switch(f1mp5,0)", "templateType": "anything", "group": "Median calculations", "name": "a1", "description": ""}, "a3": {"definition": "switch(cf3mp5,0)", "templateType": "anything", "group": "Median calculations", "name": "a3", "description": ""}, "a2": {"definition": "switch(cf2mp5,0)", "templateType": "anything", "group": "Median calculations", "name": "a2", "description": ""}, "a5": {"definition": "switch(cf5mp5,0)", "templateType": "anything", "group": "Median calculations", "name": "a5", "description": ""}, "a4": {"definition": "switch(cf4mp5,0)", "templateType": "anything", "group": "Median calculations", "name": "a4", "description": ""}, "cf4": {"definition": "cf3+f4", "templateType": "anything", "group": "Cumulative", "name": "cf4", "description": ""}, "cf5": {"definition": "cf4+f5", "templateType": "anything", "group": "Cumulative", "name": "cf5", "description": ""}, "cf2": {"definition": "f1+f2", "templateType": "anything", "group": "Cumulative", "name": "cf2", "description": ""}, "cf3": {"definition": "cf2+f3", "templateType": "anything", "group": "Cumulative", "name": "cf3", "description": ""}, "a": {"definition": "random(1..f1-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "b": {"definition": "random(a..f1)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "mn": {"definition": "sfx/tot", "templateType": "anything", "group": "Mean calculations", "name": "mn", "description": ""}, "median": {"definition": "a1+a2+a3+a4+a5", "templateType": "anything", "group": "Median calculations", "name": "median", "description": ""}}, "metadata": {"description": "

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}