// Numbas version: finer_feedback_settings {"name": "Catherine's copy of Find a confidence interval given the mean of a sample, population variance known", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Catherine's copy of Find a confidence interval given the mean of a sample, population variance known", "statement": "
A company {sc[s]} {dothis[s]} $\\var{sd[s]}$ $\\var{units}^2$.
\nA random sample of $\\var{n}$ {t[s]} gives a mean of $\\var{m[s]}$ {units}.
\n", "extensions": ["stats"], "tags": [], "ungrouped_variables": ["sd1", "sd2", "howwell", "n", "doornot", "uci", "test", "confl", "spec", "var1", "var3", "var2", "sc2ch", "units", "zval", "sc1ch", "lci", "tuci", "lies", "mm", "dothis", "sc4ch", "m", "correct", "aim", "sc3ch", "s", "tlci", "t", "sc", "con", "sd"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Finding the confidence interval at either 90%, 95% or 99% for the mean given the mean of a sample. The population variance is given and so the z values are used. Various scenarios are included.
"}, "variable_groups": [], "variables": {"sc": {"definition": "\n [\"packs sacks of \"+sc1ch,\n \"manufactures \"+sc2ch,\n \"produces vending machines which fill cups with \"+sc3ch\n\n ]\n \n ", "name": "sc", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "var2": {"definition": "random(\"process variance \",\"population variance \")", "name": "var2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "doornot": {"definition": "if(test=0, \" \",\"does not\")", "name": "doornot", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "correct": {"definition": "if(test=0, \"yes\", \"no\")", "name": "correct", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "m": {"definition": "\n [random(700..745),\n random(95..98),\n random(90..99)]\n \n \n ", "name": "m", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tuci": {"definition": "m[s]+zval*sqrt(sd1^2/n)", "name": "tuci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sd2": {"definition": "if(s=3,sd[s]^2,sd[s])", "name": "sd2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "var1": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var1", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "lci": {"definition": "precround(tlci,2)", "name": "lci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tlci": {"definition": "m[s]-zval*sqrt(sd1^2/n)", "name": "tlci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "n": {"definition": "random(20..100)", "name": "n", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "units": {"definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "name": "units", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "howwell": {"definition": "\n [\"On average, is the company reaching its target of 750g per bag?\",\n \"The bolts are designed to be 100mm long. Is the process satisfactory?\",\n \"The vending machines are supposed to fill 100ml cups. Is the machine working satisfactorily?\"\n ]\n ", "name": "howwell", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "s": {"definition": "random(0..abs(sc)-1)", "name": "s", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "uci": {"definition": "precround(tuci,2)", "name": "uci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "test": {"definition": "if(aima)
\nWe use the standard normal distribution (rather than the t-distribution) to find the confidence interval as we know the population variance.
\nWe now calculate the $\\var{confl}$% confidence interval.
\nNote that $z_{\\var{con}}=\\var{zval}$ and the confidence interval is given by:
\n\\[ \\var{m[s]} \\pm z_{\\var{con}}\\sqrt{\\frac{\\var{sd2}}{\\var{n}}}\\]
\nHence:
\nLower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{lci}${units} to 2 decimal places.
\nUpper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{uci}${units} to 2 decimal places.
\nb)
\nSince $\\var{aim}$ {doornot} {lies} in the confidence interval the answer is {Correct}.
\n", "preamble": {"css": "", "js": ""}, "rulesets": {}, "parts": [{"choices": ["Z-distribution", "t-distribution"], "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "minMarks": 0, "prompt": "
Does the sample mean follow a Z-distribution or a t-distribution?
\n", "shuffleChoices": false, "showFeedbackIcon": true, "distractors": ["", ""], "scripts": {}, "marks": 0, "maxMarks": 0, "displayColumns": 0, "matrix": ["1", 0], "customMarkingAlgorithm": "", "unitTests": [], "variableReplacements": [], "displayType": "radiogroup"}, {"variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "prompt": "Calculate a $\\var{confl}$% confidence interval $(a,b)$ for the population mean:
\n$a=\\;$[[0]]{units} $b=\\;$[[1]]{units}
\nEnter both to 2 decimal places.
\n", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showFeedbackIcon": true, "scripts": {}, "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "minValue": "lci-0.05", "variableReplacements": [], "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "maxValue": "lci+0.05"}, {"variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showFeedbackIcon": true, "scripts": {}, "allowFractions": false, "correctAnswerStyle": "plain", "unitTests": [], "minValue": "uci-0.05", "variableReplacements": [], "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "maxValue": "uci+0.05"}], "unitTests": [], "variableReplacements": []}], "type": "question", "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}