// Numbas version: exam_results_page_options {"name": "Confidence intervals for the mean and standard deviation of a protein in infant formula adaptive marking", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Confidence intervals for the mean and standard deviation of a protein in infant formula adaptive marking", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

The amount of protein in a particular brand of infant formula is to be determined. {n} replicate samples weighing 100 grams were selected at random and the amount of protein (grams) measured for each replicate is shown below.

\n

  

\n

   {data}

\n

                    

\n

(i) Produce a {percentage}% confidence interval for the mean amount of protein per 100 grams 

\n

(ii) Produce a {percentage}% confidence interval for the variance of the amount of protein per 100 grams.  

\n

", "advice": "

The sample mean $\\bar{x}=\\var{mean}$

\n

The sample standard deviation $s=\\var{s}$

\n

The sample variance is $s^2=\\var{sample_var}$

\n

\n

The sample mean $\\mu_m$ follows a $t$-distribution with $n-1 = \\var{n-1}$ degrees of freedom centred on the population mean, with a standard error of $\\frac{s}{\\sqrt{n}} = \\simplify{{precround(s,2)}/sqrt({n})} = \\var{precround(standard_error,2)}$

\n

That means that the {percentage}% confidence interval for the population mean is as follows:

\n

$a=\\bar{x}-t_{\\frac{\\alpha}{2},n-1}\\times\\frac{s}{\\sqrt{n}}$

\n

$a=\\var{mean}-t_{\\frac{\\var{alpha}}{2},\\var{n-1}}\\times\\frac{\\var{s}}{\\sqrt{\\var{n}}}=\\var{a}$

\n

$a=\\bar{x}+t_{\\frac{\\alpha}{2},n-1}\\times\\frac{s}{\\sqrt{n}}$

\n

$b=\\var{mean}+t_{\\frac{\\var{alpha}}{2},\\var{n-1}}\\times\\frac{\\var{s}}{\\sqrt{\\var{n}}}=\\var{b}$

\n

\n

The {percentage}% confidence interval for the population variance $\\sigma^2$ is:

\n

\n

$a=\\frac{(n-1)\\times s^2}{\\chi^2_{upper,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{\\simplify{1-{alpha/2}},\\var{n-1}}}=\\var{lower}$

\n

\n

$b=\\frac{(n-1)\\times s^2}{\\chi^2_{lower,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{\\simplify{{alpha/2}},\\var{n-1}}}=\\var{upper}$

\n

\n

The {percentage}% confidence interval for the population standard deviation $\\sigma$ is:

\n

\n

$a=\\sqrt{\\var{lower}}=\\var{lower_sd}$

\n

$a=\\sqrt{\\var{upper}}=\\var{upper_sd}$

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"sample_var": {"name": "sample_var", "group": "Ungrouped variables", "definition": "precround(variance(data,true),4)", "description": "", "templateType": "anything", "can_override": false}, "chi_lower": {"name": "chi_lower", "group": "Ungrouped variables", "definition": " precround(chisquareinv(alpha,(n-1)),2)", "description": "", "templateType": "anything", "can_override": false}, "chi_upper": {"name": "chi_upper", "group": "Ungrouped variables", "definition": "precround(chisquareinv(1-alpha,(n-1)),2)", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "precround(s^2*(n-1)/chi_upper,4)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "precround(s^2*(n-1)/chi_lower,4)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(6..9#1)", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "shuffle(13.6..14.7#0.1)[0..n]\n", "description": "", "templateType": "anything", "can_override": false}, "lower_sd": {"name": "lower_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(lower),3)", "description": "", "templateType": "anything", "can_override": false}, "upper_sd": {"name": "upper_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(upper),3)", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "perc[Index]", "description": "", "templateType": "anything", "can_override": false}, "perc": {"name": "perc", "group": "Ungrouped variables", "definition": "[95,99]", "description": "", "templateType": "anything", "can_override": false}, "Index": {"name": "Index", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}, "mean": {"name": "mean", "group": "Ungrouped variables", "definition": "precround(mean(data),3)", "description": "", "templateType": "anything", "can_override": false}, "standard_error": {"name": "standard_error", "group": "Ungrouped variables", "definition": "precround(s/sqrt(n),3)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "'grams'", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "precround((mean-t*standard_error),3)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "precround((mean+t*standard_error),3)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "precround(studenttinv((1-alpha),(n-1)),3)", "description": "", "templateType": "anything", "can_override": false}, "alpha_comp": {"name": "alpha_comp", "group": "Ungrouped variables", "definition": "1-alpha", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "precround(sqrt(sample_var),3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sample_var", "chi_lower", "chi_upper", "lower", "n", "data", "lower_sd", "upper", "upper_sd", "percentage", "perc", "Index", "alpha", "mean", "standard_error", "units", "a", "b", "t", "alpha_comp", "s"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers to three decimal places.

\n

The sample mean is  [[0]]

\n

The sample standard deviation is [[1]]

\n

The standard error is [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "mean-0.001", "maxValue": "mean+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "sample_var", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "s-0.001", "maxValue": "s+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "standard_error-0.001", "maxValue": "standard_error+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers correct to 3 decimal places.

\n

What is the critical t-value associated with a sample of size $\\var{n}$ and $\\frac{\\alpha}{2}=\\var{alpha}$?

\n

tcrit =[[0]]

\n

Calculate a  $\\var{percentage}$% confidence interval $(a,b)$ for the population mean:

\n

\n

$a=$ [[1]]

\n

$b=$ [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t-0.001", "maxValue": "t+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "mean", "part": "p0g0", "must_go_first": false}, {"variable": "standard_error", "part": "p0g2", "must_go_first": false}, {"variable": "t", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "a-0.002", "maxValue": "a+0.002", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "mean", "part": "p0g0", "must_go_first": false}, {"variable": "standard_error", "part": "p0g2", "must_go_first": false}, {"variable": "t", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "b-0.002", "maxValue": "b+0.002", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers correct to two decimal places.

\n

What is the critical $\\chi^2$-value associated with a sample of size $\\var{n}$ and $1-\\frac{\\alpha}{2}=\\var{alpha_comp}$?

\n

[[0]]

\n

\n

What is the critical $\\chi^2$-value associated with a sample of size $\\var{n}$ and $\\frac{\\alpha}{2}=\\var{alpha}$?

\n

[[1]]

\n

\n

Calculate a  $\\var{percentage}$% confidence interval $(a,b)$ for the population variance:

\n

$a=\\;$  [[2]]

\n

$b=\\;$  [[3]]

\n

Calculate a  $\\var{percentage}$% confidence interval $(a,b)$ for the population standard deviation:

\n

$a=\\;$  [[4]]

\n

$b=\\;$  [[5]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_upper-0.001", "maxValue": "chi_upper+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_lower-0.001", "maxValue": "chi_lower+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_upper", "part": "p2g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower-0.01", "maxValue": "lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_lower", "part": "p2g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper-0.01", "maxValue": "upper+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_upper", "part": "p2g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower_sd-0.01", "maxValue": "lower_sd+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_lower", "part": "p2g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper_sd-0.01", "maxValue": "upper_sd+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}]}], "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}