// 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": [{"variable_groups": [], "variables": {"r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu1,sig1)),5)", "description": "", "name": "r1"}, "thismany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "5", "description": "", "name": "thismany"}, "sig1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1.5..2.5#0.5)", "description": "", "name": "sig1"}, "performing": {"templateType": "anything", "group": "Ungrouped variables", "definition": " 'working at $\\\\var{100}$ watts on an exercise machine' ", "description": "", "name": "performing"}, "r2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu2,sig2)),5)", "description": "", "name": "r2"}, "attempt": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'attempt'", "description": "", "name": "attempt"}, "meandiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(d)", "description": "", "name": "meandiff"}, "objects": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'people'", "description": "", "name": "objects"}, "mu1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(16..20#0.5)", "description": "", "name": "mu1"}, "sig2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sig1+random(-0.5..-0.2#0.1)", "description": "", "name": "sig2"}, "mu2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mu1+random(1..3#0.1)", "description": "", "name": "mu2"}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "list(vector(r2)-vector(r1))", "description": "", "name": "d"}, "stdiff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(d,true),3)", "description": "", "name": "stdiff"}, "object": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'person'", "description": "", "name": "object"}, "something": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'Oxygen uptake values (mL/kg.min)'", "description": "", "name": "something"}}, "ungrouped_variables": ["meandiff", "performing", "attempt", "r1", "objects", "mu2", "object", "sig1", "thismany", "stdiff", "sig2", "something", "r2", "mu1", "d"], "name": "Find mean and standard deviation of differences between samples", "functions": {}, "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "

Find the mean and standard deviation of the difference between first and second {attempt}s.

\n

Calculate differences for second {attempt} – first {attempt}.

\n

Mean of difference = [[0]] (input as an exact decimal)

\n

Standard deviation of difference = [[1]] (input to 3 decimal places)

", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{meandiff}", "maxValue": "{meandiff}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "mustBeReducedPC": 0}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "{stdiff}", "maxValue": "{stdiff}", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0.5, "mustBeReducedPC": 0}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "

{Something} for $\\var{thismany}$ {objects} {performing} were:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{capitalise(object)}12345
First {attempt}$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$
Second {attempt}$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$
", "tags": ["checked2015", "cr1", "data analysis", "differences", "elementary statistics", "mean", "mean of differences", "standard deviation", "standard deviation of differences", "statistics", "stats", "tested1", "variance"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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$.

"}, "type": "question", "extensions": ["stats"], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

The table of differences is given by:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{capitalise(object)}12345
First {attempt}$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$
Second {attempt}$\\var{r2[0]}$$\\var{r2[1]}$$\\var{r2[2]}$$\\var{r2[3]}$$\\var{r2[4]}$
Differences$\\var{d[0]}$$\\var{d[1]}$$\\var{d[2]}$$\\var{d[3]}$$\\var{d[4]}$
\n

The mean of the differences is $\\var{meandiff}$.

\n

The 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}

\n

Hence the standard deviation is $\\sqrt{V}=\\var{stdiff}$ to 3 decimal places.

", "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}