// Numbas version: exam_results_page_options {"name": "Charlie's copy of 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": [{"variable_groups": [], "variables": {"tol": {"name": "tol", "definition": "0", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "exam1": {"name": "exam1", "definition": "'Anatomy'", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "sig0": {"name": "sig0", "definition": "random(6..12)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "overallmean": {"name": "overallmean", "definition": "mean(sscores)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "stdev2": {"name": "stdev2", "definition": "precround(stdev(r1,true),1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "ssq2": {"name": "ssq2", "definition": "sum(map(x^2,x,r1))", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "s": {"name": "s", "definition": "2", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "overallvar": {"name": "overallvar", "definition": "variance(sscores,true)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "stdevoverall": {"name": "stdevoverall", "definition": "precround(stdev(sscores,true),1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "sig1": {"name": "sig1", "definition": "random(9..15)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "exam2": {"name": "exam2", "definition": "'Cell Biology'", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "mu": {"name": "mu", "definition": "random(55..65)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "mean1": {"name": "mean1", "definition": "mean(r0)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "mean2": {"name": "mean2", "definition": "mean(r1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "total": {"name": "total", "definition": "'Total Score'", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "ssq1": {"name": "ssq1", "definition": "sum(map(x^2,x,r0))", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "var2": {"name": "var2", "definition": "precround(variance(r1,true),3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r0": {"name": "r0", "definition": "repeat(round(normalSample(mu,sig0)),n)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r1": {"name": "r1", "definition": "repeat(round(normalsample(mu,sig1)),n)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "n": {"name": "n", "definition": "10", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "stdev1": {"name": "stdev1", "definition": "precround(stdev(r0,true),1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "var1": {"name": "var1", "definition": "precround(variance(r0,true),3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "sscores": {"name": "sscores", "definition": "map(r0[x]+r1[x],x,0..n-1)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}}, "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"], "variablesTest": {"condition": "", "maxRuns": 100}, "extensions": ["stats"], "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"}, "tags": [], "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 ", "preamble": {"js": "", "css": ""}, "parts": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": 0, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "unitTests": [], "gaps": [{"correctAnswerFraction": false, "showFeedbackIcon": true, "variableReplacements": [], "mustBeReduced": false, "maxValue": "{stdev1+tol}", "scripts": {}, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "customMarkingAlgorithm": "", "marks": 1, "type": "numberentry", "variableReplacementStrategy": "originalfirst", "unitTests": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "minValue": "{stdev1-tol}", "showCorrectAnswer": true}], "prompt": "\n \n \n

{exam1}

\n \n \n \n

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

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

{exam2}

\n \n \n \n

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

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

{total}

\n \n \n \n

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

\n \n ", "sortAnswers": false}], "functions": {}, "name": "Charlie's copy of Calculate the standard deviation", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "statement": "

The following table gives the examination marks in '{exam1}' and in '{exam2}' and the total for a group of $n=\\var{n}$ students.

\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
S1S2S3S4S5S6S7S8S9S10
{exam1}$\\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}$
{exam2}$\\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 {exam1}, {exam2} and Total Score.

", "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/"}]}