// Numbas version: exam_results_page_options {"name": "Confidence Interval Doctor's Surgery", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "sortAnswers": false, "prompt": "
Calculate the mean and standard deviation of the sample of patients visiting on Mondays.
\nEnter your answers to 2 decimal places.
\nMean: [[0]]
\nStandard Deviation: [[1]]
", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"mustBeReduced": false, "scripts": {}, "precisionPartialCredit": 0, "variableReplacements": [], "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "mustBeReducedPC": 0, "allowFractions": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "monday_mean", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "minValue": "monday_mean", "precision": "2", "variableReplacementStrategy": "originalfirst", "strictPrecision": false}, {"mustBeReduced": false, "scripts": {}, "precisionPartialCredit": 0, "variableReplacements": [], "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "mustBeReducedPC": 0, "allowFractions": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "monday_sd", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "minValue": "monday_sd", "precision": "2", "variableReplacementStrategy": "originalfirst", "strictPrecision": false}], "variableReplacements": [], "type": "gapfill", "customMarkingAlgorithm": "", "marks": 0}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "sortAnswers": false, "prompt": "Find the 95% confidence interval for the population mean $\\mu_m$ of the age of patients visiting on Monday, using the $t$-distribution with $\\var{num_monday-1}$ degrees of freedom.
\nEnter your answers to 2 decimal places.
\nLower limit: [[0]]
\nUpper limit: [[1]]
", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"mustBeReduced": false, "scripts": {}, "precisionPartialCredit": 0, "variableReplacements": [{"variable": "monday_mean", "part": "p0g0", "must_go_first": false}, {"variable": "monday_sd", "part": "p0g1", "must_go_first": false}], "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "mustBeReducedPC": 0, "allowFractions": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "monday_low", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "minValue": "monday_low", "precision": "2", "variableReplacementStrategy": "originalfirst", "strictPrecision": false}, {"mustBeReduced": false, "scripts": {}, "precisionPartialCredit": 0, "variableReplacements": [], "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "mustBeReducedPC": 0, "allowFractions": false, "customMarkingAlgorithm": "", "marks": 1, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "monday_high", "precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "minValue": "monday_high", "precision": "2", "variableReplacementStrategy": "originalfirst", "strictPrecision": false}], "variableReplacements": [], "type": "gapfill", "customMarkingAlgorithm": "", "marks": 0}], "variable_groups": [], "name": "Confidence Interval Doctor's Surgery", "statement": "The ages of a random sample of patients coming into a doctor's surgery during the school holidays are noted down on each Monday and Friday thoughout August.
\n{table([['Monday']+mon,['Friday']+fri],[])}
", "advice": "The mean of the sample of patients visiting on Mondays is
\n\\[ \\bar{x} = \\frac{1}{n}(\\sum x_i) = \\var{precround(monday_mean,2)} \\text{ (to 2 d.p.)} \\]
\nThe standard deviation is
\n\\[ s = \\sqrt{\\frac{1}{n-1}\\sum \\left(x_i-\\bar{x}\\right)^2} = \\var{precround(monday_sd,2)} \\text{ (to 2 d.p.)} \\]
\nThe sample mean $\\mu_m$ follows a $t$-distribution with $n-1 = \\var{num_monday-1}$ degrees of freedom centred on the population mean, with a standard error of $\\frac{s}{\\sqrt{n}} = \\simplify{{precround(monday_sd,2)}/sqrt({num_monday})} = \\var{precround(monday_se,2)}$.
\nThat means that the 95% confidence interval for the population mean is as follows:
\n\\begin{array}{lrcl}
&\\left[ \\bar{x} - s \\times t_{\\var{num_monday-1},0.975} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\bar{x} + s \\times t_{\\var{num_monday-1},0.975} \\right] \\\\
= & \\left[ \\simplify[]{{precround(monday_mean,2)} - {precround(monday_se,2)}*{precround(monday_t,2)}} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\simplify[]{{precround(monday_mean,2)} + {precround(monday_se,2)}*{precround(monday_t,2)}} \\right] \\\\
= & \\left[ \\var{precround(monday_low,2)} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\var{precround(monday_high,2)} \\right]
\\end{array}
Lower end of the confidence interval for Monday's mean
", "templateType": "anything"}, "friday_mean": {"definition": "mean(fri)", "group": "Ungrouped variables", "name": "friday_mean", "description": "", "templateType": "anything"}, "fri": {"definition": "repeat(friday_pop_mean+random(-friday_pop_range..friday_pop_range),num_monday)", "group": "Ungrouped variables", "name": "fri", "description": "Data for Friday
", "templateType": "anything"}, "friday_pop_mean": {"definition": "random(20..70)", "group": "Ungrouped variables", "name": "friday_pop_mean", "description": "", "templateType": "anything"}, "monday_sd": {"definition": "stdev(mon,true)", "group": "Ungrouped variables", "name": "monday_sd", "description": "", "templateType": "anything"}, "mon": {"definition": "repeat(monday_pop_mean+random(-monday_pop_range..monday_pop_range),num_monday)", "group": "Ungrouped variables", "name": "mon", "description": "Data for Monday
", "templateType": "anything"}, "friday_low": {"definition": "friday_mean-friday_t*friday_se", "group": "Ungrouped variables", "name": "friday_low", "description": "", "templateType": "anything"}, "monday_pop_range": {"definition": "20", "group": "Ungrouped variables", "name": "monday_pop_range", "description": "", "templateType": "anything"}, "no_overlap": {"definition": "friday_low > monday_high or friday_high < monday_low", "group": "Ungrouped variables", "name": "no_overlap", "description": "", "templateType": "anything"}, "friday_pop_range": {"definition": "20", "group": "Ungrouped variables", "name": "friday_pop_range", "description": "", "templateType": "anything"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Compute a 95% confidence interval for the population mean given a small sample, and compare it with a confidence interval for a different population.
"}, "extensions": ["stats"], "functions": {}, "rulesets": {}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}]}