// Numbas version: exam_results_page_options {"name": "Sample 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": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu,sig1)),n)", "description": "", "name": "r1"}, "mean2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r1)", "description": "", "name": "mean2"}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(9..15)", "description": "", "name": "sig1"}, "mean1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r0)", "description": "", "name": "mean1"}, "sig0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(6..12)", "description": "", "name": "sig0"}, "stdev1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r0,true),1)", "description": "", "name": "stdev1"}, "stdev2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r1,true),1)", "description": "", "name": "stdev2"}, "exam2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Cell Biology'", "description": "", "name": "exam2"}, "stdevoverall": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(sscores,true),1)", "description": "", "name": "stdevoverall"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "10", "description": "", "name": "n"}, "mu": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(55..65)", "description": "", "name": "mu"}, "total": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Total Score'", "description": "", "name": "total"}, "ssq2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r1))", "description": "", "name": "ssq2"}, "exam1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Anatomy'", "description": "", "name": "exam1"}, "var2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r1,true),3)", "description": "", "name": "var2"}, "sscores": {"templateType": "anything", "group": "Ungrouped variables", "definition": "map(r0[x]+r1[x],x,0..n-1)", "description": "", "name": "sscores"}, "overallvar": {"templateType": "anything", "group": "Ungrouped variables", "definition": "variance(sscores,true)", "description": "", "name": "overallvar"}, "ssq1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r0))", "description": "", "name": "ssq1"}, "s": {"templateType": "anything", "group": "Ungrouped variables", "definition": "2", "description": "", "name": "s"}, "overallmean": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(sscores)", "description": "", "name": "overallmean"}, "r0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalSample(mu,sig0)),n)", "description": "", "name": "r0"}, "var1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r0,true),3)", "description": "", "name": "var1"}}, "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"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Sample standard deviation", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{stdev1+tol}", "minValue": "{stdev1-tol}", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \n

{exam1}

\n \n \n \n

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

\n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{stdev2+tol}", "minValue": "{stdev2-tol}", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \n

{exam2}

\n \n \n \n

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

\n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{stdevoverall+tol}", "minValue": "{stdevoverall-tol}", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \n

{total}

\n \n \n \n

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

\n \n ", "showCorrectAnswer": true, "marks": 0}], "statement": "\n \n \n

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

\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 \n \n \n

Find the sample standard deviation for each of {exam1}, {exam2} and Total Score.

\n \n ", "tags": ["checked2015", "cr1", "data analysis", "elementary statistics", "mean ", "sample", "sample mean", "sample standard deviation", "sample variance", "standard deviation", "statistics", "stats", "tested1", "unused", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

11/07/2012:

\n

Added tags.

\n

Set new variable tol=0 for all numeric input so that answers have to be accurate to 1 decimal place.

\n

Testing calculation not yet possible due to stats extension unavailability.

\n

23/07/2012:

\n

Corrected error in calculation of variance of Total Score. The variable scores was not used and so mean and variance were not correct.

\n

Checked calculations. OK.

\n

Added description.

\n

1/08/2012:

\n

Added tags.

\n

Question appears to be working correctly.

\n

19/12/2012:

\n

Changed stats functions to the ones from the new stats extension.

\n

Checked calculations.

\n

Added tested1 tag.

\n

21/12/2012:

\n

Checked rounding, OK. Added cr1 tag.

", "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.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "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 ", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}