// Numbas version: exam_results_page_options {"name": "Confidence interval - marijuana survey", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Confidence interval - marijuana survey", "tags": [], "metadata": {"description": "
This question assesses learners' ability to:
- construct a confidence interval for a proportion given corresponding summarised data;
- predict the sample size required to limit the margin of error to a given value.
", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "statement": "In a recent survey, $\\var{n}$ UK adults were asked: \"Do you think the use of marijuana should be legalized?\"
\n$\\var{percentage}\\%$ of the respondents said it should.
", "advice": "For general background, see relevant textbook sections on Confidence Intervals (e.g., Chapter 5 in OpenIntro Statistics).
\na) The standard error for a proportion is $SE=\\sqrt{\\frac{p(1-p)}{n}}$, with $p$ the proportion (as a number between 0 and 1, not as a percentage), and $n$ the sample size.
\nThe margin of error is $MoE=z^\\star\\times SE$, with $z^\\star$ the appropriate z-value (e.g., $z^\\star = 1.96$ for a $95\\%$ confidence level).
\nThe confidence interval is: $(p-MoE, p+MoE)$.
\nb) To limit the MoE to $1\\%$, the sample size $n$ must satisfy this equation:
\n$1.96\\times\\sqrt{\\frac{p(1-p)}{n}}=0.01$
\nSolving for $n$ gives the required sample size.
\nStandard error
", "templateType": "anything", "can_override": false}, "CI_high": {"name": "CI_high", "group": "Ungrouped variables", "definition": "precround(100*(p+1.96*se),1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "percentage", "CI_low", "se", "p", "CI_high", "nMin", "MoE_limit"], "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": "Construct a $95\\%$ confidence interval for the proportion of UK adults who think marijuana should be legalized (rounding to 1 decimal place):
\n( [[0]]% , [[1]]% )
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "CI_low-1", "maxValue": "CI_low+1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "CI_high-1", "maxValue": "CI_high+1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What would be the sample size required to limit the margin of error of the $95\\%$ confidence interval to $\\var{100*MoE_limit}\\%$?
", "minValue": "nMin-5", "maxValue": "nMin+10", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}]}]}], "contributors": [{"name": "Mario Orsi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/427/"}]}