// Numbas version: exam_results_page_options {"name": "Practice Quiz Calculate the standard deviation", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "variables": {"r1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu,sig1)),n)", "name": "r1"}, "mean2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r1)", "name": "mean2"}, "overallvar": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "variance(sscores,true)", "name": "overallvar"}, "sscores": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "map(r0[x]+r1[x],x,0..n-1)", "name": "sscores"}, "sig1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(9..15)", "name": "sig1"}, "ssq2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r1))", "name": "ssq2"}, "ssq1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r0))", "name": "ssq1"}, "mu": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(35..50)", "name": "mu"}, "overallmean": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(sscores)", "name": "overallmean"}, "stdevoverall": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(sscores,true),1)", "name": "stdevoverall"}, "mean1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r0)", "name": "mean1"}, "var1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r0,true),3)", "name": "var1"}, "var2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r1,true),3)", "name": "var2"}, "r0": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalSample(mu,sig0)),n)", "name": "r0"}, "stdev1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r0,true),1)", "name": "stdev1"}, "n": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "10", "name": "n"}, "s": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "2", "name": "s"}, "stdev2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r1,true),1)", "name": "stdev2"}, "total": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'Total Score'", "name": "total"}, "exam1": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'pilates'", "name": "exam1"}, "exam2": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "'circuits'", "name": "exam2"}, "sig0": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..12)", "name": "sig0"}, "tol": {"description": "", "templateType": "anything", "group": "Ungrouped variables", "definition": "0", "name": "tol"}}, "name": "Practice Quiz Calculate the standard deviation", "advice": "\n \n \n

The solution to the first part is here – the other parts can be done in the same way.

\n \n \n \n

For {exam1} we have the mean is:

\n \n \n \n

\\[\\simplify[]{({r0[0]} + {r0[1]} + {r0[2]} + {r0[3]} + {r0[4]} + {r0[5]} + {r0[6]} + {r0[7]} + {r0[8]} + {r0[9]}) / {n} = {mean1}}\\]

\n \n \n \n

The sample variance is given by the formula:

\n \n \n \n

\\[\\textrm{Sample Variance} = \\frac{1}{n-1}\\left(\\sum_{j=1}^{n}x_j^2 -n\\mu^2\\right)\\]

\n \n \n \n

where the $x_j$ are the exam scores for {exam1}, $n=\\var{n}$ the number of students and $\\mu=\\var{mean1}$ the sample mean.

\n \n \n \n

We find that
\\[\\begin{eqnarray*}\\sum_{j=1}^{n}x_j^2 &=& \\simplify[]{({r0[0]}^2 + {r0[1]}^2 + {r0[2]}^2 + {r0[3]}^2 + {r0[4]}^2 + {r0[5]}^2 + {r0[6]}^2 + {r0[7]}^2 + {r0[8]}^2 + {r0[9]}^2)}\\\\ \n \n &=& \\var{ssq1}\\\\\n \n \\\\\n \n \\\\\n \n n\\mu^2 &=&\\var{n} \\times\\var{mean1}^2\\\\\n \n &=& \\var{n*mean1^2}\n \n \\end{eqnarray*}\n \n \\]
Hence substituting these values into the formula we find that:

\n \n \n \n

\\[\\begin{eqnarray*}\n \n \\textrm{Sample Variance} &=& \\frac{1}{\\var{n-1}}\\left(\\var{ssq1}-\\var{n*mean1^2}\\right)\\\\\n \n &=& \\var{var1}\n \n \\end{eqnarray*}\n \n \\] to 3 decimal places.

\n \n \n \n

The Sample Standard Deviation is then the square root of the Sample Variance i.e.

\n \n \n \n

Sample Standard Deviation = $\\sqrt{\\var{var1}} = \\var{stdev1}$ to one decimal place.

\n \n ", "statement": "

The following table gives the number of participants in two gym classes; {exam1} and {exam2}, and the total attendance for both classes over each week ($n=\\var{n}$).

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Week 1Week 2Week 3Week 4Week 5Week 6Week 7Week 8Week 9Week 10
Pilates$\\var{r0[0]}$$\\var{r0[1]}$$\\var{r0[2]}$$\\var{r0[3]}$$\\var{r0[4]}$$\\var{r0[5]}$$\\var{r0[6]}$$\\var{r0[7]}$$\\var{r0[8]}$$\\var{r0[9]}$Mean = $\\var{mean1}$
Circuits$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$Mean = $\\var{mean2}$
{total}$\\var{sscores[0]}$$\\var{sscores[1]}$$\\var{sscores[2]}$$\\var{sscores[3]}$$\\var{sscores[4]}$$\\var{sscores[5]}$$\\var{sscores[6]}$$\\var{sscores[7]}$$\\var{sscores[8]}$$\\var{sscores[9]}$Mean = $\\var{overallmean}$
\n

Find the sample standard deviation for each of Pilates, Circuits and Total Score.

", "variable_groups": [], "metadata": {"description": "

Two ordered data sets, each with 10 numbers. Find the sample standard deviation for each and for their sum.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": "3", "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdev1-tol}", "maxValue": "{stdev1+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "

Pilates

\n

Sample Standard Deviation = [[0]] (to one decimal place)

"}, {"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": "3", "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdev2-tol}", "maxValue": "{stdev2+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "

Circuits

\n

Sample Standard Deviation = [[0]] (to one decimal place)

"}, {"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "gaps": [{"showCorrectAnswer": true, "marks": "3", "customMarkingAlgorithm": "", "correctAnswerStyle": "plain", "minValue": "{stdevoverall-tol}", "maxValue": "{stdevoverall+tol}", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "allowFractions": false, "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "correctAnswerFraction": false}], "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "prompt": "

Total Attendance

\n

Sample Standard Deviation = [[0]] (to one decimal place)

"}], "ungrouped_variables": ["overallmean", "mean1", "mean2", "overallvar", "ssq1", "ssq2", "total", "exam2", "tol", "exam1", "stdev1", "stdev2", "var1", "var2", "sig1", "sig0", "stdevoverall", "r0", "r1", "n", "mu", "s", "sscores"], "preamble": {"js": "", "css": ""}, "functions": {}, "extensions": ["stats"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Paul Finley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2232/"}, {"name": "Charlie Earle", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3054/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Paul Finley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2232/"}, {"name": "Charlie Earle", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3054/"}]}