// Numbas version: exam_results_page_options {"name": "Confidence Interval", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Confidence Interval", "tags": [], "metadata": {"description": "

Calculate 95% CI given, mean, sd and sample size.

", "licence": "None specified"}, "statement": "

A sample of size $n = \\var{n}$ produced a sample mean of $\\bar{x} = \\var{xbar}$.

Assuming the population standard deviation $\\sigma = \\var{sigma}$, compute a 95% confidence interval for the population mean, $\\mu$.

Give your answers correct to 2dp.

", "advice": "

A 95% confidence interval for $\\mu$ is 

\\[ \\big[ \\bar{x} - z_{\\alpha/2} \\frac{\\sigma}{\\sqrt{n}} , \\bar{x} + z_{\\alpha/2} \\frac{\\sigma}{\\sqrt{n}} \\big] \\]

\n

Where $\\alpha = 0.05$, (because $95\\% = 0.95$ and $1-0.95 = 0.05)$, is the probability of a value lying outside the confidence interval and $z_{\\alpha/2}$ is the lower bound z-value for the confidence interval, i.e. $P(Z < z_{\\alpha/2}) = 0.975$.

\n

We know that:

\n

$z_{{\\alpha}/2} = z_{0.025} = 1.96$ (from the table of Normal distribution),

\n

Therefore, the 95% confidence interval for µ will be:

\n

\\[ \\big[ \\var{xbar} - 1.96 \\times \\frac{\\var{sigma}}{\\sqrt{\\var{n}}} ,\\var{xbar} + 1.96 \\times \\frac{\\var{sigma}}{\\sqrt{\\var{n}}} \\big] \\]

\n

\\[ [ \\var{ci_lower} , \\var{ci_upper} ] \\]

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "random(10..200)", "description": "", "templateType": "anything", "can_override": false}, "xbar": {"name": "xbar", "group": "Ungrouped variables", "definition": "random(0.99*mu..1.01*mu)", "description": "", "templateType": "anything", "can_override": false}, "sigma": {"name": "sigma", "group": "Ungrouped variables", "definition": "random(0.5..10 #0.1)", "description": "", "templateType": "anything", "can_override": false}, "ci_percent": {"name": "ci_percent", "group": "Ungrouped variables", "definition": "95", "description": "", "templateType": "anything", "can_override": false}, "alp": {"name": "alp", "group": "Ungrouped variables", "definition": "((100-ci_percent)/2)/100", "description": "", "templateType": "anything", "can_override": false}, "mu": {"name": "mu", "group": "Ungrouped variables", "definition": "random(2..100 #0.1)", "description": "", "templateType": "anything", "can_override": false}, "ci_lower": {"name": "ci_lower", "group": "Ungrouped variables", "definition": "precround(xbar - 1.96*sigma/sqrt(n),2)", "description": "", "templateType": "anything", "can_override": false}, "ci_upper": {"name": "ci_upper", "group": "Ungrouped variables", "definition": "precround(xbar + 1.96*sigma/sqrt(n),2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "xbar", "sigma", "ci_percent", "alp", "mu", "ci_lower", "ci_upper"], "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": "

[[[0]], [[1]]]

", "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": "precround(ci_lower,2)", "maxValue": "precround(ci_lower,2)", "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": "precround(ci_upper,2)", "maxValue": "precround(ci_upper,2)", "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": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}]}], "contributors": [{"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}