// 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}.
\nA 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)
\nWe use the z tables to find the confidence interval since we know the population variance.
\nOur 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.
\nNote $\\sigma = \\sqrt{\\sigma^2}=\\sqrt{\\var{sd2}}$
\n\nThus 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\nHence:
\nLower 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.
\nUpper 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)
\nSince $\\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}
\nEnter 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