// Numbas version: exam_results_page_options {"name": "Harry's copy of 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": [{"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 \nFor {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 \nThe 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 \nwhere 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 \nWe 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:
\\[\\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 \nThe Sample Standard Deviation is then the square root of the Sample Variance i.e.
\n \n \n \nSample Standard Deviation = $\\sqrt{\\var{var1}} = \\var{stdev1}$ to one decimal place.
\n \n ", "functions": {}, "preamble": {"css": "", "js": ""}, "parts": [{"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReduced": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "{stdev1+tol}", "correctAnswerFraction": false, "minValue": "{stdev1-tol}"}], "showFeedbackIcon": true, "sortAnswers": false, "prompt": "\n \n \nSample Standard Deviation = [[0]] (to one decimal place)
\n \n ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReduced": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "{stdev2+tol}", "correctAnswerFraction": false, "minValue": "{stdev2-tol}"}], "showFeedbackIcon": true, "sortAnswers": false, "prompt": "\n \n \nSample Standard Deviation = [[0]] (to one decimal place)
\n \n ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReduced": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "{stdevoverall+tol}", "correctAnswerFraction": false, "minValue": "{stdevoverall-tol}"}], "showFeedbackIcon": true, "sortAnswers": false, "prompt": "\n \n \nSample Standard Deviation = [[0]] (to one decimal place)
\n \n ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "tags": [], "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{exam1} | \n$\\var{r0[0]}$ | \n$\\var{r0[1]}$ | \n$\\var{r0[2]}$ | \n$\\var{r0[3]}$ | \n$\\var{r0[4]}$ | \n$\\var{r0[5]}$ | \n$\\var{r0[6]}$ | \n$\\var{r0[7]}$ | \n$\\var{r0[8]}$ | \n$\\var{r0[9]}$ | \nMean = $\\var{mean1}$ | \n
---|---|---|---|---|---|---|---|---|---|---|---|
{exam2} | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \nMean = $\\var{mean2}$ | \n
{total} | \n$\\var{sscores[0]}$ | \n$\\var{sscores[1]}$ | \n$\\var{sscores[2]}$ | \n$\\var{sscores[3]}$ | \n$\\var{sscores[4]}$ | \n$\\var{sscores[5]}$ | \n$\\var{sscores[6]}$ | \n$\\var{sscores[7]}$ | \n$\\var{sscores[8]}$ | \n$\\var{sscores[9]}$ | \nMean = $\\var{overallmean}$ | \n
Find the sample standard deviation for each of {exam1}, {exam2} and Total Score.
", "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "variables": {"sig1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(9..15)", "name": "sig1"}, "s": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "2", "name": "s"}, "var1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(variance(r0,true),3)", "name": "var1"}, "mu": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(55..65)", "name": "mu"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "10", "name": "n"}, "overallvar": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "variance(sscores,true)", "name": "overallvar"}, "exam2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "'Cell Biology'", "name": "exam2"}, "exam1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "'Anatomy'", "name": "exam1"}, "sig0": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(6..12)", "name": "sig0"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "repeat(round(normalsample(mu,sig1)),n)", "name": "r1"}, "var2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(variance(r1,true),3)", "name": "var2"}, "overallmean": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "mean(sscores)", "name": "overallmean"}, "ssq1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "sum(map(x^2,x,r0))", "name": "ssq1"}, "total": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "'Total Score'", "name": "total"}, "ssq2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "sum(map(x^2,x,r1))", "name": "ssq2"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "0", "name": "tol"}, "stdev2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(stdev(r1,true),1)", "name": "stdev2"}, "mean2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "mean(r1)", "name": "mean2"}, "stdevoverall": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(stdev(sscores,true),1)", "name": "stdevoverall"}, "sscores": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "map(r0[x]+r1[x],x,0..n-1)", "name": "sscores"}, "stdev1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(stdev(r0,true),1)", "name": "stdev1"}, "r0": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "repeat(round(normalSample(mu,sig0)),n)", "name": "r0"}, "mean1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "mean(r0)", "name": "mean1"}}, "extensions": ["stats"], "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"], "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"}, "name": "Harry's copy of STAT7008 Sample standard deviation", "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/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "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/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}