// Numbas version: exam_results_page_options {"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": [{"functions": {}, "ungrouped_variables": ["Mon", "Tues", "Wed", "Thurs", "Fri", "Sat", "Sun", "data", "range", "variance", "mean"], "name": "Descriptive Stats (P): find sample mean, range and variance", "tags": [], "advice": "

a)

\n

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.)}\\]

\n

b)

\n

The 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}} \\]

\n

c)

\n

The 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)],[])}

\n

Now,

\n

\\[ \\text{Variance} = \\frac{1}{7} \\sum (x_i-\\mu)^2 = \\var{precround(variance,2)} \\text{ (to 2 d.p.)} \\]

", "rulesets": {}, "parts": [{"prompt": "

Mean: [[0]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "maxValue": "mean", "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": 1, "minValue": "mean", "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "

Range: [[0]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "maxValue": "range", "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": 1, "minValue": "range", "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "

Variance: [[0]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "maxValue": "variance", "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": "90", "scripts": {}, "marks": 1, "minValue": "variance", "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "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'])}

\n

Compute the following descriptive statistics of the data. Round your answers to 2 decimal places.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"Wed": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "Wed", "description": ""}, "Sun": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "Sun", "description": ""}, "Fri": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "Fri", "description": ""}, "Thurs": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "Thurs", "description": ""}, "Tues": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "Tues", "description": ""}, "range": {"definition": "max(data)-min(data)", "templateType": "anything", "group": "Ungrouped variables", "name": "range", "description": ""}, "Mon": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "Mon", "description": ""}, "variance": {"definition": "variance(data)", "templateType": "anything", "group": "Ungrouped variables", "name": "variance", "description": ""}, "Sat": {"definition": "random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "Sat", "description": ""}, "data": {"definition": "[mon,tues,wed,thurs,fri,sat,sun]", "templateType": "anything", "group": "Ungrouped variables", "name": "data", "description": ""}, "mean": {"definition": "mean(data)", "templateType": "anything", "group": "Ungrouped variables", "name": "mean", "description": ""}}, "metadata": {"notes": "", "description": "

Calculate the mean, range, and variance of a small sample.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "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/"}]}]}], "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/"}]}