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

", "preamble": {"css": "", "js": ""}, "parts": [{"type": "gapfill", "scripts": {}, "variableReplacements": [], "marks": 0, "gaps": [{"type": "numberentry", "allowFractions": false, "marks": "2", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "correctAnswerFraction": false, "scripts": {}, "variableReplacements": [], "maxValue": "{meandiff}", "notationStyles": ["plain", "en", "si-en"], "minValue": "{meandiff}", "correctAnswerStyle": "plain", "showCorrectAnswer": true}, {"type": "numberentry", "allowFractions": false, "marks": "2", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "correctAnswerFraction": false, "scripts": {}, "variableReplacements": [], "maxValue": "{stdiff}", "notationStyles": ["plain", "en", "si-en"], "minValue": "{stdiff}", "correctAnswerStyle": "plain", "showCorrectAnswer": true}], "variableReplacementStrategy": "originalfirst", "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)

", "showCorrectAnswer": true, "showFeedbackIcon": true}], "type": "question", "contributors": [{"name": "Nigel Atkins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/275/"}]}]}], "contributors": [{"name": "Nigel Atkins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/275/"}]}