// Numbas version: finer_feedback_settings {"name": "Find mean and standard deviation of differences between samples", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"mu2": {"group": "Ungrouped variables", "name": "mu2", "description": "", "templateType": "anything", "definition": "mu1+random(1..3#0.1)"}, "object": {"group": "Ungrouped variables", "name": "object", "description": "", "templateType": "anything", "definition": "'person'"}, "mu1": {"group": "Ungrouped variables", "name": "mu1", "description": "", "templateType": "anything", "definition": "random(16..20#0.5)"}, "meandiff": {"group": "Ungrouped variables", "name": "meandiff", "description": "", "templateType": "anything", "definition": "mean(d)"}, "sig1": {"group": "Ungrouped variables", "name": "sig1", "description": "", "templateType": "anything", "definition": "random(1.5..2.5#0.5)"}, "performing": {"group": "Ungrouped variables", "name": "performing", "description": "", "templateType": "anything", "definition": " 'working at $\\\\var{100}$ watts on an exercise machine' "}, "thismany": {"group": "Ungrouped variables", "name": "thismany", "description": "", "templateType": "anything", "definition": "5"}, "stdiff": {"group": "Ungrouped variables", "name": "stdiff", "description": "", "templateType": "anything", "definition": "precround(stdev(d,true),3)"}, "r1": {"group": "Ungrouped variables", "name": "r1", "description": "", "templateType": "anything", "definition": "repeat(round(normalsample(mu1,sig1)),5)"}, "something": {"group": "Ungrouped variables", "name": "something", "description": "", "templateType": "anything", "definition": "'Oxygen uptake values (mL/kg.min)'"}, "objects": {"group": "Ungrouped variables", "name": "objects", "description": "", "templateType": "anything", "definition": "'people'"}, "attempt": {"group": "Ungrouped variables", "name": "attempt", "description": "", "templateType": "anything", "definition": "'attempt'"}, "d": {"group": "Ungrouped variables", "name": "d", "description": "", "templateType": "anything", "definition": "list(vector(r2)-vector(r1))"}, "r2": {"group": "Ungrouped variables", "name": "r2", "description": "", "templateType": "anything", "definition": "repeat(round(normalsample(mu2,sig2)),5)"}, "sig2": {"group": "Ungrouped variables", "name": "sig2", "description": "", "templateType": "anything", "definition": "sig1+random(-0.5..-0.2#0.1)"}}, "extensions": ["stats"], "name": "Find mean and standard deviation of differences between samples", "preamble": {"css": "", "js": ""}, "parts": [{"variableReplacements": [], "showFeedbackIcon": true, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "
Find the mean and standard deviation of the difference between first and second {attempt}s.
\nCalculate differences for second {attempt} – first {attempt}.
\nMean of difference = [[0]] (input as an exact decimal)
\nStandard deviation of difference = [[1]] (input to 3 decimal places)
", "type": "gapfill", "gaps": [{"variableReplacements": [], "showFeedbackIcon": true, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "unitTests": [], "maxValue": "{meandiff}", "correctAnswerFraction": false, "showCorrectAnswer": true, "minValue": "{meandiff}", "marks": 0.5, "mustBeReducedPC": 0}, {"variableReplacements": [], "showFeedbackIcon": true, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "unitTests": [], "maxValue": "{stdiff}", "correctAnswerFraction": false, "showCorrectAnswer": true, "minValue": "{stdiff}", "marks": 0.5, "mustBeReducedPC": 0}], "scripts": {}, "variableReplacementStrategy": "originalfirst", "unitTests": [], "sortAnswers": false, "showCorrectAnswer": true, "marks": 0}], "metadata": {"description": "An experiment is performed twice, each with $5$ outcomes
\n$x_i,\\;y_i,\\;i=1,\\dots 5$ . Find mean and s.d. of their differences $y_i-x_i,\\;i=1,\\dots 5$.
", "licence": "Creative Commons Attribution 4.0 International"}, "advice": "The table of differences is given by:
\n{capitalise(object)} | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
First {attempt} | \n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n
Second {attempt} | \n$\\var{r2[0]}$ | \n$\\var{r2[1]}$ | \n$\\var{r2[2]}$ | \n$\\var{r2[3]}$ | \n$\\var{r2[4]}$ | \n
Differences | \n$\\var{d[0]}$ | \n$\\var{d[1]}$ | \n$\\var{d[2]}$ | \n$\\var{d[3]}$ | \n$\\var{d[4]}$ | \n
The mean of the differences is $\\var{meandiff}$.
\nThe variance $V$ of the differences is
\n\\begin{align}
V &= \\frac{1}{4}\\left(\\simplify[]{({d[0]}^2+{d[1]}^2+{d[2]}^2+{d[3]}^2+{d[4]}^2)}-5\\times \\var{meandiff}^2\\right) \\\\
&= \\var{variance(d,true)}
\\end{align}
Hence the standard deviation is $\\sqrt{V}=\\var{stdiff}$ to 3 decimal places.
", "tags": [], "ungrouped_variables": ["meandiff", "performing", "attempt", "r1", "objects", "mu2", "object", "sig1", "thismany", "stdiff", "sig2", "something", "r2", "mu1", "d"], "functions": {}, "variable_groups": [], "statement": "{Something} for $\\var{thismany}$ {objects} {performing} were sampled as follows:
\n{capitalise(object)} | \n1 | \n2 | \n3 | \n4 | \n5 | \n
---|---|---|---|---|---|
First {attempt} | \n{r1[0]} | \n{r1[1]} | \n{r1[2]} | \n{r1[3]} | \n{r1[4]} | \n
Second {attempt} | \n{r2[0]} | \n{r2[1]} | \n{r2[2]} | \n{r2[3]} | \n{r2[4]} | \n