// Numbas version: exam_results_page_options {"name": "Descriptive Statistics (Psychology)", "duration": 0, "metadata": {"notes": "", "description": "

Some questions on descriptive statistics: mean, mode, median, range, variance, standard error.

", "licence": "Creative Commons Attribution 4.0 International"}, "allQuestions": true, "shuffleQuestions": false, "percentPass": 0, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "pickQuestions": 0, "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "feedback": {"showtotalmark": true, "advicethreshold": 0, "showanswerstate": true, "showactualmark": true, "allowrevealanswer": true}, "type": "exam", "questions": [], "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Descriptive Statistics (P): Mean", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "functions": {}, "ungrouped_variables": ["a", "b", "c", "d", "f"], "tags": [], "advice": "

a)

\n

To find the mean you first need to sum the numbers, i.e.:

\n

\\[ \\simplify[]{{a}+{b}+{c}} = \\var{a+b+c} \\]

\n

Then divide through by the number of values being summed:

\n

\\[ \\text{Mean} = \\simplify{{a+b+c}/3} \\]

\n

b)

\n

The mean is

\n

\\[ \\simplify[]{({a}+{b}+{f}+{c}+{d})/5} = \\simplify[fractionnumbers]{{(a+b+f+c+d)/5}} \\]

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

$\\var{a}, \\var{b}, \\var{c}$

", "allowFractions": true, "variableReplacements": [], "maxValue": "(a+b+c)/3", "minValue": "(a+b+c)/3", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"prompt": "

$\\var{a},\\var{b},\\var{f},\\var{c},\\var{d}$

", "allowFractions": true, "variableReplacements": [], "maxValue": "(a+b+c+f+d)/5", "minValue": "(a+b+c+f+d)/5", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "statement": "

Find the means of the following sets of numbers. Enter your answers as whole numbers or fractions, not decimals.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "random(11..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "f": {"definition": "random(11..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}}, "metadata": {"notes": "", "description": "

Compute the means of two small samples.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Descriptive Statistics (P): Median", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "functions": {}, "ungrouped_variables": ["v_less_9a", "v_less_9b", "v_more_11a", "v_more_11b", "v_between_9_11", "v_less_4a", "v_less_4b", "v_between_5_10", "v_more_10a", "v_more_10b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

First, put the elements in increasing order, i.e.

\n

\\[ \\var{latex(join(sort([v_less_9a,v_more_11a,v_less_9b,v_between_9_11,v_more_11b]),','))} \\]

\n

The median of the set is the middle value in the sorted list. In this case, it's $\\var{v_between_9_11}$.

\n

b)

\n

First, put the elements in increasing order, i.e.

\n

\\[ \\var{latex(join(sort([v_less_4a,v_less_4b,v_between_5_10,v_more_10a,v_more_10b]),','))} \\]

\n

The median of the set is the middle value in the sorted list. In this case, it's $\\var{v_between_5_10}$.

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

$\\var{v_less_9a},\\var{v_more_11a},\\var{v_less_9b},\\var{v_between_9_11},\\var{v_more_11b}$.

", "allowFractions": false, "variableReplacements": [], "maxValue": "v_between_9_11", "minValue": "v_between_9_11", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"prompt": "

$\\var{v_less_4a}, \\var{v_less_4b}, \\var{v_between_5_10},\\var{v_more_10a}, \\var{v_more_10b}$

", "allowFractions": false, "variableReplacements": [], "maxValue": "v_between_5_10", "minValue": "v_between_5_10", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "statement": "

Find the medians of the following sets of numbers. Enter your answers as whole numbers or fractions, not decimals.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"v_more_11b": {"definition": "random(12..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_11b", "description": ""}, "v_more_11a": {"definition": "random(12..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_11a", "description": ""}, "v_between_5_10": {"definition": "random(5..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_between_5_10", "description": ""}, "v_less_9b": {"definition": "random(1..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_9b", "description": ""}, "v_less_9a": {"definition": "random(1..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_9a", "description": ""}, "v_more_10a": {"definition": "random(10..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_10a", "description": ""}, "v_between_9_11": {"definition": "random(9..11)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_between_9_11", "description": ""}, "v_more_10b": {"definition": "random(10..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_more_10b", "description": ""}, "v_less_4a": {"definition": "random(1..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_4a", "description": ""}, "v_less_4b": {"definition": "random(1..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "v_less_4b", "description": ""}}, "metadata": {"notes": "", "description": "

Find the medians of two sets of data.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Descriptive Stats (P): Mode", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "functions": {}, "ungrouped_variables": [], "tags": [], "advice": "

a)

\n

The mode is the value which appears the most often in the data set.

\n

It can help to put the values in order:

\n

{table([sort(show_values1)],[])}

\n

The mode of these numbers is $\\var{mode1}$.

\n

b)

\n

Similarly, it can help to first put the values in order:

\n

{table([sort(show_values2)],[])}

\n

The mode of these numbers is $\\var{mode2}$.

\n

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

{table([show_values1],[])}

", "allowFractions": false, "variableReplacements": [], "maxValue": "mode1", "minValue": "mode1", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"prompt": "

{table([show_values2],[])}

", "allowFractions": false, "variableReplacements": [], "maxValue": "mode2", "minValue": "mode2", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "statement": "

Find the mode of each list of numbers.

", "variable_groups": [{"variables": ["values1", "mode1", "show_values1"], "name": "Part a"}, {"variables": ["values2", "mode2", "show_values2"], "name": "Part b"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"values1": {"definition": "repeat(random(1..20),5)", "templateType": "anything", "group": "Part a", "name": "values1", "description": "

A random set of data

"}, "values2": {"definition": "repeat(random(1..20),8)", "templateType": "anything", "group": "Part b", "name": "values2", "description": ""}, "mode2": {"definition": "shuffle(mode(values2))[0]", "templateType": "anything", "group": "Part b", "name": "mode2", "description": ""}, "show_values1": {"definition": "shuffle(values1+[mode1])", "templateType": "anything", "group": "Part a", "name": "show_values1", "description": "

Values shown to the student.

\n

Make sure the mode is unique by picking one possible mode, and adding another copy of it to the list.

"}, "show_values2": {"definition": "shuffle(values2+[mode2])", "templateType": "anything", "group": "Part b", "name": "show_values2", "description": ""}, "mode1": {"definition": "shuffle(mode(values1))[0]", "templateType": "anything", "group": "Part a", "name": "mode1", "description": "

A mode of the random set of data. There will be more than one if two values appear the same (maximal) number of times

"}}, "metadata": {"notes": "", "description": "

Find the modes of two small samples.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Descriptive Stats (P): Range", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "functions": {}, "ungrouped_variables": ["max_drugs", "range_drugs", "min_bottles", "shipment"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

The range of a set of data is defined to be the difference between the greatest value and the least value.

\n

E.g. the set $2, 3, 4, 4, 7$ has a range of 5 since $7-2=5$.

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

The amount of drugs the doctor prescribed this month has a maximum weight of $\\var{max_drugs}$g and has a range of $\\var{range_drugs}$g. What is the minimum weight the doctor prescribed this month?

\n

[[0]]g

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"integerPartialCredit": 0, "integerAnswer": true, "allowFractions": false, "variableReplacements": [], "maxValue": "max_drugs - range_drugs", "minValue": "max_drugs - range_drugs", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "

A pharmacy has a variable amount of Dittany in stock at any one point. When the stock gets down to $\\var{min_bottles}$ they must order more. Each order comes with $\\var{shipment}$ bottles. What is the range of the number of bottles of Dittany in stock?

\n

Range: [[0]] bottles.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "shipment", "minValue": "shipment", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

Using the definition of the range to answer the following questions

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"range_drugs": {"definition": "random(200..(max_drugs-100))", "templateType": "anything", "group": "Ungrouped variables", "name": "range_drugs", "description": ""}, "min_bottles": {"definition": "random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "min_bottles", "description": ""}, "shipment": {"definition": "random(15..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "shipment", "description": ""}, "max_drugs": {"definition": "random(1500..1800)", "templateType": "anything", "group": "Ungrouped variables", "name": "max_drugs", "description": ""}}, "metadata": {"notes": "", "description": "

Use the range as a measure of spread.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Descriptive Stats (P): Standard Error", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "functions": {}, "ungrouped_variables": ["people", "average", "sd", "se"], "tags": [], "advice": "

The standard error of the sample mean is given by 

\n

\\[ \\text{Standard error} = \\frac{s}{\\sqrt{n}} \\]

\n

where $s$ is the sample standard deviation, and $n$ is the size of the sample.

\n

In this case, the standard error is

\n

\\[ \\simplify{{sd}/sqrt({people})} = \\var{dpformat(se,3)} \\text{ (to 3 d.p.)} \\]

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

What is the standard error of the sample mean? Round your answer to 3 decimal places.

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "3", "maxValue": "se", "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": 1, "minValue": "se", "type": "numberentry", "showPrecisionHint": false}], "statement": "

A recent survey asked people \"How long do you spend relaxing each day? For example wating TV, reading, or listening to the radio.\"

\n

The survey received $\\var{people}$ responses with a mean of $\\var{average}$ hours and a standard deviation of $\\var{sd}$ hours.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"average": {"definition": "random(2..4#0.01)", "templateType": "anything", "group": "Ungrouped variables", "name": "average", "description": ""}, "sd": {"definition": "random(1.9..(average-0.1)#0.01)", "templateType": "anything", "group": "Ungrouped variables", "name": "sd", "description": ""}, "se": {"definition": "sd/sqrt(people)", "templateType": "anything", "group": "Ungrouped variables", "name": "se", "description": ""}, "people": {"definition": "random(1000..2000)", "templateType": "anything", "group": "Ungrouped variables", "name": "people", "description": ""}}, "metadata": {"notes": "", "description": "

Compute the standard error of a sample mean, given the sample size and standard deviation.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"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}, "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/"}], "functions": {}, "ungrouped_variables": ["Mon", "Tues", "Wed", "Thurs", "Fri", "Sat", "Sun", "data", "range", "variance", "mean"], "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": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}