// Numbas version: finer_feedback_settings {"name": "Simon's copy of Find a confidence interval given the mean of a sample, ,", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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", "sd"], "name": "Simon's copy of Find a confidence interval given the mean of a sample, ,", "functions": {}, "variable_groups": [], "tags": [], "rulesets": {}, "statement": "\n

A company {sc[s]} {dothis[s]} $\\var{sd[s]}$ {units}.

\n

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

\n

 

\n ", "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.

"}, "advice": "

(a)

\n

We use the z tables to find the confidence interval since we know the population variance.

\n

Our confidence interval for the mean is given by $\\bar x \\pm z^* \\frac{\\sigma}{\\sqrt{n}}$ where $z^*$ is taken from standard normal distribution tables and depends on our confidence level.

\n

Note $\\sigma = \\sqrt{\\sigma^2}=\\sqrt{\\var{sd2}}$

\n

\n

Thus to calculate the two-sided $\\var{confl}$% confidence interval, we note that $z^* = z_{\\var{confl}}=\\var{zval}$ and so the confidence interval is given by:

\n

\\[\\bar x \\pm z_{\\var{confl}} \\frac{\\sigma}{\\sqrt{n}}= \\var{m[s]} \\pm \\var{zval}\\frac{\\sqrt{\\var{sd2}}}{\\sqrt{\\var{n}}}\\]

\n

\n

Hence:

\n

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

\n

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

\n

\n

(b)

\n

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

\n

 

", "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"marks": 0, "prompt": "\n

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

 

\n ", "customName": "", "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "showCorrectAnswer": true, "sortAnswers": false, "showFeedbackIcon": true, "gaps": [{"marks": 1, "strictPrecision": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "correctAnswerFraction": false, "mustBeReduced": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "mustBeReducedPC": 0, "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "showFeedbackIcon": true, "variableReplacements": [], "maxValue": "lci", "unitTests": [], "precision": "2", "type": "numberentry", "customName": "", "allowFractions": false, "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "useCustomName": false, "minValue": "lci", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": ""}, {"marks": 1, "strictPrecision": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "correctAnswerFraction": false, "mustBeReduced": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "mustBeReducedPC": 0, "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "showFeedbackIcon": true, "variableReplacements": [], "maxValue": "uci", "unitTests": [], "precision": "2", "type": "numberentry", "customName": "", "allowFractions": false, "precisionType": "dp", "extendBaseMarkingAlgorithm": true, "useCustomName": false, "minValue": "uci", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": ""}], "unitTests": [], "variableReplacementStrategy": "originalfirst", "type": "gapfill"}, {"marks": 0, "prompt": "\n

{howwell[s]}

\n

[[0]]

\n ", "customName": "", "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "showCorrectAnswer": true, "sortAnswers": false, "showFeedbackIcon": true, "gaps": [{"marks": 0, "matrix": "mm", "minMarks": 0, "maxMarks": 0, "customName": "", "displayType": "radiogroup", "customMarkingAlgorithm": "", "shuffleChoices": false, "scripts": {}, "variableReplacements": [], "extendBaseMarkingAlgorithm": true, "useCustomName": false, "displayColumns": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "showCellAnswerState": true, "choices": ["Yes", "No"], "unitTests": [], "variableReplacementStrategy": "originalfirst", "type": "1_n_2"}], "unitTests": [], "variableReplacementStrategy": "originalfirst", "type": "gapfill"}], "variables": {"units": {"definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "name": "units", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "dothis": {"definition": "\n [var1 + \" is\",\n \"with a \"+var2+\" of\",\n var3+ \" is\",\n \"knows that the population standard deviation for the wages of employees is\"]\n \n \n \n \n ", "name": "dothis", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "tuci": {"definition": "m[s]+zval*sqrt(sd1^2/n)", "name": "tuci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "confl": {"definition": "random(90,95,99)", "name": "confl", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "mm": {"definition": "[1-test,test]", "name": "mm", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "lci": {"definition": "precround(tlci,2)", "name": "lci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "doornot": {"definition": "if(test=0, \" \",\"does not\")", "name": "doornot", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "test": {"definition": "if(aim lci,0,1)", "name": "test", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sc2ch": {"definition": "random(\"bolts\",\"screws\")", "name": "sc2ch", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "uci": {"definition": "precround(tuci,2)", "name": "uci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "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", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "var3": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var3", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "s": {"definition": "random(0..abs(sc)-1)", "name": "s", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "correct": {"definition": "if(test=0, \"yes\", \"no\")", "name": "correct", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sc3ch": {"definition": "random(\"hot water.\",\"tea.\",\"coffee.\",\"hot chocolate.\",\"cappuccino.\")", "name": "sc3ch", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sd2": {"definition": "if(s=3,sd[s]^2,sd[s])", "name": "sd2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "t": {"definition": "\n [\"bags \",\n sc2ch,\n \"filled cups \",\n \"monthly wage slips \"]\n \n \n ", "name": "t", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "lies": {"definition": "if(test=0,\"lies\",\"lie\")", "name": "lies", "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": ""}, "m": {"definition": "\n [random(700..745),\n random(95..98),\n random(90..99),\n random(1000..2500#50)]\n \n \n ", "name": "m", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sd1": {"definition": "if(s=3,sd[s],sqrt(sd[s]))", "name": "sd1", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "aim": {"definition": "if(s=0,750,if(s=1,100,if(s=2,100,1500)))", "name": "aim", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "spec": {"definition": "if(s=2,\"the timecards of \", \" \")", "name": "spec", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "zval": {"definition": "if(confl=90,1.645,if(confl=95,1.96,2.576))", "name": "zval", "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 \"The company aims for an average salary of \u00a31500 per month per worker. Is the aim being met?\"]\n ", "name": "howwell", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sc4ch": {"definition": "random(\"supermarkets\",\"clothing retailers\",\"department stores\",\"fast food outlets\")", "name": "sc4ch", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sc": {"definition": "\n [\"packs sacks of \"+sc1ch,\n \"manufactures \"+sc2ch,\n \"produces vending machines which fill cups with \"+sc3ch,\n \"in charge of the accounts of a large chain of \"+sc4ch\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": ""}, "tlci": {"definition": "m[s]-zval*sqrt(sd1^2/n)", "name": "tlci", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "n": {"definition": "random(40..100)", "name": "n", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "sc1ch": {"definition": "random(\"flour.\",\"sugar.\",\"dried milk.\",\"instant coffee.\")", "name": "sc1ch", "group": "Ungrouped variables", "templateType": "anything", "description": ""}}, "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}