// Numbas version: finer_feedback_settings {"name": "Descriptive Stats (P): find sample mean, range and variance", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "preamble": {"js": "", "css": ""}, "tags": [], "ungrouped_variables": ["Mon", "Tues", "Wed", "Thurs", "Fri", "Sat", "Sun", "data", "range", "variance", "mean"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0, "name": ""}], "advice": "
The mean of a set of data is the sum of the data, divided by the number of values in the set. In this case, the mean is
\n\\[ \\simplify[]{({mon}+{tues}+{wed}+{thurs}+{fri}+{sat}+{sun})/7} = \\var{precround(mean,2)} \\text{ (to 2 d.p.)}\\]
\nThe range of a set of data is the difference between the greatest and least values in the set. In this case, the range is
\n\\[ \\simplify[]{{max(data)}-{min(data)} = {range}} \\]
\nThe variance of a sample $x_1,x_2, \\dots, x_n$ is given by the following formula:
\n\\[ \\text{Variance} = \\sum \\frac{(x_i-\\mu)^2}{n}\\]
\n{table([['\\$x_i\\$']+data,['\\$x_i-\\\\mu\\$']+map(x-mean,x,data),['\\$(x_i-\\\\mu)^2\\$']+map((x-mean)^2,x,data)],[])}
\nNow,
\n\\[ \\text{Variance} = \\frac{1}{7} \\sum (x_i-\\mu)^2 = \\var{precround(variance,2)} \\text{ (to 2 d.p.)} \\]
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"scripts": {}, "variableReplacements": [], "prompt": "Mean: [[0]]
", "variableReplacementStrategy": "originalfirst", "gaps": [{"correctAnswerFraction": false, "precision": "2", "precisionMessage": "You have not given your answer to the correct precision.", "type": "numberentry", "precisionPartialCredit": 0, "scripts": {}, "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "minValue": "mean", "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionType": "dp", "showCorrectAnswer": true, "marks": 1, "maxValue": "mean"}], "showCorrectAnswer": true, "marks": 0, "type": "gapfill"}, {"scripts": {}, "variableReplacements": [], "prompt": "Range: [[0]]
", "variableReplacementStrategy": "originalfirst", "gaps": [{"correctAnswerFraction": false, "precision": "2", "precisionMessage": "You have not given your answer to the correct precision.", "type": "numberentry", "precisionPartialCredit": 0, "scripts": {}, "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "minValue": "range", "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionType": "dp", "showCorrectAnswer": true, "marks": 1, "maxValue": "range"}], "showCorrectAnswer": true, "marks": 0, "type": "gapfill"}, {"scripts": {}, "variableReplacements": [], "prompt": "Variance: [[0]]
", "variableReplacementStrategy": "originalfirst", "gaps": [{"correctAnswerFraction": false, "precision": "2", "precisionMessage": "You have not given your answer to the correct precision.", "type": "numberentry", "precisionPartialCredit": "90", "scripts": {}, "showPrecisionHint": false, "allowFractions": false, "variableReplacements": [], "minValue": "variance", "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionType": "dp", "showCorrectAnswer": true, "marks": 1, "maxValue": "variance"}], "showCorrectAnswer": true, "marks": 0, "type": "gapfill"}], "showQuestionGroupNames": false, "statement": "Joe makes a variable number of visits to the toilet each day. He recorded his activities as follows:
\n{table([data],['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])}
\nCompute the following descriptive statistics of the data. Round your answers to 2 decimal places.
", "variables": {"Wed": {"description": "", "group": "Ungrouped variables", "name": "Wed", "definition": "random(1..6)", "templateType": "anything"}, "Sat": {"description": "", "group": "Ungrouped variables", "name": "Sat", "definition": "random(1..5)", "templateType": "anything"}, "Tues": {"description": "", "group": "Ungrouped variables", "name": "Tues", "definition": "random(1..4)", "templateType": "anything"}, "variance": {"description": "", "group": "Ungrouped variables", "name": "variance", "definition": "variance(data)", "templateType": "anything"}, "range": {"description": "", "group": "Ungrouped variables", "name": "range", "definition": "max(data)-min(data)", "templateType": "anything"}, "data": {"description": "", "group": "Ungrouped variables", "name": "data", "definition": "[mon,tues,wed,thurs,fri,sat,sun]", "templateType": "anything"}, "Fri": {"description": "", "group": "Ungrouped variables", "name": "Fri", "definition": "random(1..4)", "templateType": "anything"}, "Sun": {"description": "", "group": "Ungrouped variables", "name": "Sun", "definition": "random(1..6)", "templateType": "anything"}, "Thurs": {"description": "", "group": "Ungrouped variables", "name": "Thurs", "definition": "random(1..6)", "templateType": "anything"}, "Mon": {"description": "", "group": "Ungrouped variables", "name": "Mon", "definition": "random(1..4)", "templateType": "anything"}, "mean": {"description": "", "group": "Ungrouped variables", "name": "mean", "definition": "mean(data)", "templateType": "anything"}}, "metadata": {"description": "Calculate the mean, range, and variance of a small sample.
", "notes": "", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {}, "name": "Descriptive Stats (P): find sample mean, range and variance", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}