// Numbas version: finer_feedback_settings {"name": "Find sample standard deviations of two samples", "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": "'Software Engineering'", "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": "'Programming'", "description": "", "name": "exam1"}, "var2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(variance(r1,true),3)", "description": "", "name": "var2"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "name": "m"}, "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(random(25..100-m),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", "m"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Find sample standard deviations of two samples", "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": "{mean2+m+tol}", "minValue": "{mean2+m-tol}", "correctAnswerFraction": false, "marks": "0.5", "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "stdev2+tol", "minValue": "stdev2-tol", "correctAnswerFraction": false, "marks": "0.5", "showPrecisionHint": false}], "type": "gapfill", "prompt": "

Suppose that each student is awarded an extra $\\var{m}$ marks  for Software Engineering. Find the new values for the sample mean and sample standard deviation.

\n

Sample mean = [[0]] (to one decimal place)

\n

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

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

For a group of $n=10$ students, the following table gives the examination marks in Programming, $x_1,\\ldots, x_{10}$

\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]}$ $\\bar{x}=\\var{mean1}$
\n

For Software Engineering, their examination marks $y_1,...,y_{10}$ have been summarised as follows:

\n\n\n\n\n\n\n\n
{exam2}$\\sum y^2 = \\var{ssq2}$$\\bar{y} = \\var{mean2}$
", "tags": ["checked2015", "cr1", "data analysis", "elementary statistics", "MAS8380", "mean", "mean ", "sample", "sample mean", "sample standard deviation", "sample variance", "standard deviation", "statistics", "stats", "tested1", "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": "

The solution to (a) is given below; (b) can be done in the same way.

\n

For {exam1} we have the mean is:

\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

The sample variance is given by the formula:

\n

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

\n

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

\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)}\\\\ &=& \\var{ssq1}\\\\ \\\\ \\\\ n\\bar{x}^2 &=&\\var{n} \\times\\var{mean1}^2\\\\ &=& \\var{n*mean1^2} \\end{eqnarray*} \\]
Hence substituting these values into the formula we find that:

\n

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

\n

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

\n

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

\n

In part (c), adding a constant, $\\var{m}$, to each score shifts the mean by the same constant. The spread of the data is unaffected and so the sample standard deviation remains unchanged.

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