// Numbas version: exam_results_page_options {"name": "STAT7008 Sample 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}, "parts": [{"customMarkingAlgorithm": "", "scripts": {}, "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "gaps": [{"customMarkingAlgorithm": "", "scripts": {}, "maxValue": "{stdev1+tol}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "numberentry", "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerFraction": false, "marks": 1, "mustBeReduced": false, "minValue": "{stdev1-tol}", "unitTests": [], "correctAnswerStyle": "plain"}], "prompt": "\n \n \n

{exam1}

\n \n \n \n

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

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

{exam2}

\n \n \n \n

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

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

{total}

\n \n \n \n

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

\n \n ", "variableReplacements": [], "showCorrectAnswer": true, "marks": 0, "unitTests": []}], "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 ", "extensions": ["stats"], "preamble": {"js": "", "css": ""}, "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "functions": {}, "tags": [], "name": "STAT7008 Sample standard deviation", "variables": {"stdevoverall": {"group": "Ungrouped variables", "name": "stdevoverall", "templateType": "anything", "definition": "precround(stdev(sscores,true),1)", "description": ""}, "exam2": {"group": "Ungrouped variables", "name": "exam2", "templateType": "anything", "definition": "'Cell Biology'", "description": ""}, "mean2": {"group": "Ungrouped variables", "name": "mean2", "templateType": "anything", "definition": "mean(r1)", "description": ""}, "stdev2": {"group": "Ungrouped variables", "name": "stdev2", "templateType": "anything", "definition": "precround(stdev(r1,true),1)", "description": ""}, "sig0": {"group": "Ungrouped variables", "name": "sig0", "templateType": "anything", "definition": "random(6..12)", "description": ""}, "total": {"group": "Ungrouped variables", "name": "total", "templateType": "anything", "definition": "'Total Score'", "description": ""}, "tol": {"group": "Ungrouped variables", "name": "tol", "templateType": "anything", "definition": "0", "description": ""}, "exam1": {"group": "Ungrouped variables", "name": "exam1", "templateType": "anything", "definition": "'Anatomy'", "description": ""}, "ssq1": {"group": "Ungrouped variables", "name": "ssq1", "templateType": "anything", "definition": "sum(map(x^2,x,r0))", "description": ""}, "var2": {"group": "Ungrouped variables", "name": "var2", "templateType": "anything", "definition": "precround(variance(r1,true),3)", "description": ""}, "s": {"group": "Ungrouped variables", "name": "s", "templateType": "anything", "definition": "2", "description": ""}, "sscores": {"group": "Ungrouped variables", "name": "sscores", "templateType": "anything", "definition": "map(r0[x]+r1[x],x,0..n-1)", "description": ""}, "ssq2": {"group": "Ungrouped variables", "name": "ssq2", "templateType": "anything", "definition": "sum(map(x^2,x,r1))", "description": ""}, "stdev1": {"group": "Ungrouped variables", "name": "stdev1", "templateType": "anything", "definition": "precround(stdev(r0,true),1)", "description": ""}, "n": {"group": "Ungrouped variables", "name": "n", "templateType": "anything", "definition": "10", "description": ""}, "overallmean": {"group": "Ungrouped variables", "name": "overallmean", "templateType": "anything", "definition": "mean(sscores)", "description": ""}, "mu": {"group": "Ungrouped variables", "name": "mu", "templateType": "anything", "definition": "random(55..65)", "description": ""}, "var1": {"group": "Ungrouped variables", "name": "var1", "templateType": "anything", "definition": "precround(variance(r0,true),3)", "description": ""}, "sig1": {"group": "Ungrouped variables", "name": "sig1", "templateType": "anything", "definition": "random(9..15)", "description": ""}, "mean1": {"group": "Ungrouped variables", "name": "mean1", "templateType": "anything", "definition": "mean(r0)", "description": ""}, "overallvar": {"group": "Ungrouped variables", "name": "overallvar", "templateType": "anything", "definition": "variance(sscores,true)", "description": ""}, "r0": {"group": "Ungrouped variables", "name": "r0", "templateType": "anything", "definition": "repeat(round(normalSample(mu,sig0)),n)", "description": ""}, "r1": {"group": "Ungrouped variables", "name": "r1", "templateType": "anything", "definition": "repeat(round(normalsample(mu,sig1)),n)", "description": ""}}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "statement": "

The following table gives the examination marks in {exam1} and in {exam2} and their total for a sample 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
{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.

", "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"], "type": "question", "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}