// Numbas version: exam_results_page_options {"name": "Assessment version: 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": "Assessment version: 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$.

\n

A random sample of $\\var{n}$ {t[s]} gives a mean  of $\\var{m[s]}$ {units}. 

\n

 

", "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"], "tags": [], "extensions": ["stats"], "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", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "var2": {"definition": "random(\"process variance \",\"population variance \")", "name": "var2", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "doornot": {"definition": "if(test=0, \" \",\"does not\")", "name": "doornot", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "correct": {"definition": "if(test=0, \"yes\", \"no\")", "name": "correct", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "m": {"definition": "\n [random(700..745),\n random(95..98),\n random(90..99)]\n \n \n ", "name": "m", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "tuci": {"definition": "m[s]+zval*sqrt(sd1^2/n)", "name": "tuci", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "var1": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var1", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "t": {"definition": "\n [\"bags \",\n sc2ch,\n \"filled cups \"\n]\n \n \n ", "name": "t", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "tlci": {"definition": "m[s]-zval*sqrt(sd1^2/n)", "name": "tlci", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "dothis": {"definition": "\n [var1 + \" is\",\n \"with a \"+var2+\" of\",\n var3+ \" is\"]\n \n \n \n \n ", "name": "dothis", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "units": {"definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "name": "units", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "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", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "spec": {"definition": "if(s=2,\"the timecards of \", \" \")", "name": "spec", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "uci": {"definition": "precround(tuci,2)", "name": "uci", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "test": {"definition": "if(aim lci,0,1)", "name": "test", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "n": {"definition": "random(20..100)", "name": "n", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "confl": {"definition": "random(90,95,99)", "name": "confl", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sc1ch": {"definition": "random(\"flour.\",\"sugar.\",\"dried milk.\",\"instant coffee.\")", "name": "sc1ch", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "lci": {"definition": "precround(tlci,2)", "name": "lci", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "aim": {"definition": "if(s=0,750,if(s=1,100,if(s=2,100,1500)))", "name": "aim", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "zval": {"definition": "if(confl=90,1.645,if(confl=95,1.96,2.576))", "name": "zval", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "var3": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var3", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sc4ch": {"definition": "random(\"supermarkets\",\"clothing retailers\",\"department stores\",\"fast food outlets\")", "name": "sc4ch", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "mm": {"definition": "[1-test,test]", "name": "mm", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "lies": {"definition": "if(test=0,\"lies\",\"lie\")", "name": "lies", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sd2": {"definition": "if(s=3,sd[s]^2,sd[s])", "name": "sd2", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sd1": {"definition": "if(s=3,sd[s],sqrt(sd[s]))", "name": "sd1", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "s": {"definition": "random(0..abs(sc)-1)", "name": "s", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sc2ch": {"definition": "random(\"bolts\",\"screws\")", "name": "sc2ch", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "con": {"definition": "(100+confl)/200", "name": "con", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sc3ch": {"definition": "random(\"hot water.\",\"tea.\",\"coffee.\",\"hot chocolate.\",\"cappuccino.\")", "name": "sc3ch", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "sd": {"definition": "\n [random(800..1400#20),\n random(1200..1800#20),\n random(300..600#20),\n random(100..200#0.1)]\n \n ", "name": "sd", "description": "", "templateType": "anything", "group": "Ungrouped variables"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "

a)

\n

We use the standard normal distribution (rather than the t-distribution) to find the confidence interval as we know the population variance.

\n

We now calculate the $\\var{confl}$% confidence interval.

\n

Note 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}}}\\]

\n

Hence:

\n

Lower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{lci}${units} to 2 decimal places.

\n

Upper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{uci}${units} to 2 decimal places.

\n

b)

\n

Since $\\var{aim}$ {doornot} {lies} in the confidence interval the answer is {Correct}.

\n

 

", "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, "unitTests": [], "displayColumns": 0, "maxMarks": 0, "showCellAnswerState": true, "matrix": ["1", 0], "customMarkingAlgorithm": "", "variableReplacements": [], "displayType": "radiogroup"}, {"variableReplacementStrategy": "originalfirst", "type": "gapfill", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "prompt": "

Calculate a  $\\var{confl}$% confidence interval $(a,b)$ for the population mean:

\n

$a=\\;$[[0]]{units}          $b=\\;$[[1]]{units}

\n

Enter both to 2 decimal places.

\n

 

", "showFeedbackIcon": true, "sortAnswers": false, "scripts": {}, "marks": 0, "unitTests": [], "gaps": [{"variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "maxValue": "lci+0.05", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showFeedbackIcon": true, "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "unitTests": [], "minValue": "lci-0.05", "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "variableReplacements": []}, {"variableReplacementStrategy": "originalfirst", "type": "numberentry", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "maxValue": "uci+0.05", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "showFeedbackIcon": true, "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "unitTests": [], "minValue": "uci-0.05", "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "variableReplacements": []}], "customMarkingAlgorithm": "", "variableReplacements": []}], "preamble": {"css": "", "js": ""}, "rulesets": {}, "functions": {}, "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/"}]}