// 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
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 \nSample 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.
\nSample mean = [[0]] (to one decimal place)
\nSample 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{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]}$ | \n$\\bar{x}=\\var{mean1}$ |
---|
For Software Engineering, their examination marks $y_1,...,y_{10}$ have been summarised as follows:
{exam2} | \n$\\sum y^2 = \\var{ssq2}$ | \n$\\bar{y} = \\var{mean2}$ | \n
---|
11/07/2012:
\nAdded tags.
\nSet new variable tol=0 for all numeric input so that answers have to be accurate to 1 decimal place.
\nTesting calculation not yet possible due to stats extension unavailability.
\n23/07/2012:
\nCorrected error in calculation of variance of Total Score. The variable scores was not used and so mean and variance were not correct.
\nChecked calculations. OK.
\nAdded description.
\n1/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n19/12/2012:
\nChanged stats functions to the ones from the new stats extension.
\nChecked calculations.
\nAdded tested1 tag.
\n21/12/2012:
\nChecked 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.
\nFor {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}}\\]
\nThe 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)\\]
\nwhere the $x_j$ are the exam scores for {exam1}, $n=\\var{n}$ the number of students and $\\bar{x}=\\var{mean1}$ the sample mean.
\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)}\\\\ &=& \\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:
\\[\\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.
\nThe Sample Standard Deviation is then the square root of the Sample Variance i.e.
\nSample Standard Deviation = $\\sqrt{\\var{var1}} = \\var{stdev1}$ to one decimal place.
\nIn 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/"}]}