// 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": [{"name": "Confidence Interval Doctor's Surgery", "tags": [], "metadata": {"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.

", "licence": "Creative Commons Attribution 4.0 International"}, "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": "

a)

\n

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.)} \\]

\n

The 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.)} \\]

\n

b)

\n

The 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)}$.

\n

That 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}

\n

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"fri": {"name": "fri", "group": "Ungrouped variables", "definition": "repeat(friday_pop_mean+random(-friday_pop_range..friday_pop_range),num_monday)", "description": "

Data for Friday

", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,11)", "description": "", "templateType": "anything", "can_override": false}, "mon": {"name": "mon", "group": "Ungrouped variables", "definition": "repeat(monday_pop_mean+random(-monday_pop_range..monday_pop_range),num_monday)", "description": "

Data for Monday

", "templateType": "anything", "can_override": false}, "friday_t": {"name": "friday_t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,num_friday-1)", "description": "", "templateType": "anything", "can_override": false}, "monday_mean": {"name": "monday_mean", "group": "Ungrouped variables", "definition": "mean(mon)", "description": "", "templateType": "anything", "can_override": false}, "no_overlap": {"name": "no_overlap", "group": "Ungrouped variables", "definition": "friday_low > monday_high or friday_high < monday_low", "description": "", "templateType": "anything", "can_override": false}, "friday_se": {"name": "friday_se", "group": "Ungrouped variables", "definition": "stdev(fri,true)/sqrt(num_friday)", "description": "", "templateType": "anything", "can_override": false}, "num_friday": {"name": "num_friday", "group": "Ungrouped variables", "definition": "random(12..16)", "description": "", "templateType": "anything", "can_override": false}, "friday_pop_mean": {"name": "friday_pop_mean", "group": "Ungrouped variables", "definition": "random(20..70)", "description": "", "templateType": "anything", "can_override": false}, "num_monday": {"name": "num_monday", "group": "Ungrouped variables", "definition": "12", "description": "", "templateType": "anything", "can_override": false}, "monday_pop_range": {"name": "monday_pop_range", "group": "Ungrouped variables", "definition": "20", "description": "", "templateType": "anything", "can_override": false}, "friday_pop_range": {"name": "friday_pop_range", "group": "Ungrouped variables", "definition": "20", "description": "", "templateType": "anything", "can_override": false}, "monday_sd": {"name": "monday_sd", "group": "Ungrouped variables", "definition": "stdev(mon, true)", "description": "", "templateType": "anything", "can_override": false}, "monday_pop_mean": {"name": "monday_pop_mean", "group": "Ungrouped variables", "definition": "random(20..70)", "description": "", "templateType": "anything", "can_override": false}, "friday_high": {"name": "friday_high", "group": "Ungrouped variables", "definition": "friday_mean+friday_t*friday_se", "description": "", "templateType": "anything", "can_override": false}, "monday_t": {"name": "monday_t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,num_monday-1)", "description": "", "templateType": "anything", "can_override": false}, "friday_low": {"name": "friday_low", "group": "Ungrouped variables", "definition": "friday_mean-friday_t*friday_se", "description": "", "templateType": "anything", "can_override": false}, "friday_mean": {"name": "friday_mean", "group": "Ungrouped variables", "definition": "mean(fri)", "description": "", "templateType": "anything", "can_override": false}, "monday_high": {"name": "monday_high", "group": "Ungrouped variables", "definition": "monday_mean+monday_t*monday_se", "description": "", "templateType": "anything", "can_override": false}, "monday_low": {"name": "monday_low", "group": "Ungrouped variables", "definition": "monday_mean-monday_t*monday_se", "description": "

Lower end of the confidence interval for Monday's mean

", "templateType": "anything", "can_override": false}, "monday_se": {"name": "monday_se", "group": "Ungrouped variables", "definition": "monday_sd/sqrt(num_monday)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_monday", "monday_pop_mean", "monday_pop_range", "mon", "num_friday", "friday_pop_mean", "friday_pop_range", "fri", "monday_mean", "monday_sd", "monday_se", "monday_t", "monday_low", "monday_high", "t", "friday_mean", "friday_se", "friday_t", "friday_low", "friday_high", "no_overlap"], "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": "

Calculate the mean and standard deviation of the sample of patients visiting on Mondays.

\n

Enter your answers to 2 decimal places.

\n

Mean: [[0]]

\n

Standard Deviation: [[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": "monday_mean", "maxValue": "monday_mean", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "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": "monday_sd", "maxValue": "monday_sd", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "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": "

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.

\n

Enter your answers to 2 decimal places.

\n

Lower limit: [[0]]

\n

Upper limit: [[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": "monday_low-0.01", "maxValue": "monday_low+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "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": "monday_high-0.01", "maxValue": "monday_high+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}