// Numbas version: finer_feedback_settings {"name": "Simon's copy of Find z-score for sample and calculate confidence interval", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "name": "Simon's copy of Find z-score for sample and calculate confidence interval", "parts": [{"scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "strictPrecision": false, "allowFractions": false, "customName": "", "mustBeReduced": false, "maxValue": "zscore", "marks": 2, "minValue": "zscore", "customMarkingAlgorithm": "", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionType": "dp", "precision": "3", "type": "numberentry", "precisionPartialCredit": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "prompt": "
What is the $z$-score for a score of $\\var{score}$?
\n", "correctAnswerFraction": false}, {"marks": 0, "scripts": {}, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "strictPrecision": false, "allowFractions": false, "customName": "", "mustBeReduced": false, "maxValue": "lowerbound", "marks": 1, "minValue": "lowerbound", "customMarkingAlgorithm": "", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionType": "dp", "precision": "3", "type": "numberentry", "precisionPartialCredit": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "correctAnswerFraction": false}, {"scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "strictPrecision": false, "allowFractions": false, "customName": "", "mustBeReduced": false, "maxValue": "upperbound", "marks": 1, "minValue": "upperbound", "customMarkingAlgorithm": "", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionType": "dp", "precision": "3", "type": "numberentry", "precisionPartialCredit": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "correctAnswerFraction": false}], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "prompt": "Calculate the $95$% confidence interval for the population mean $\\mu$:
\nLower bound: [[0]]
\nUpper bound: [[1]]
\n\n", "customMarkingAlgorithm": ""}], "functions": {}, "tags": [], "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["zscore", "lowerbound", "bottom", "this", "top", "upperbound", "samplemean", "these", "sstdev", "score", "samplesize", "expb", "expt"], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "\n\t\tGiven mean and sd of 1000 sample returns on a scale of 1 to 7 together with a given score, find the z-score.
\n\t\tAlso find the 95% confidence interval for the population mean.
\n\t\t"}, "advice": "(a)
\nThe $z$-score is given by
\n\\[z=\\frac{x- \\bar x}{\\sigma}=\\frac{\\var{score}-\\var{samplemean}}{\\var{sstdev}}=\\var{dpformat(zscore,3)}\\] (to 3 decimal places)
\n\n\n(b)
\nThe 95% confidence interval for the mean is given by:
\n$\\bar x \\pm z_{95\\%} \\frac{\\sigma}{\\sqrt{n}}$ where $z_{95 \\%} = 1.96$ for a two-sided confidence interval.
\n\nHence, the lower bound for the 95% confidence interval is given by:
\nLower bound = $\\displaystyle \\var{samplemean}-1.96 \\times \\frac{ \\var{sstdev}}{\\sqrt{\\var{samplesize}}}=\\var{lowerbound}$
\n\nUpper bound = $\\displaystyle \\var{samplemean}+1.96 \\times \\frac{ \\var{sstdev}}{\\sqrt{\\var{samplesize}}}=\\var{upperbound}$
\n\nHence for the population mean $\\mu$ we can say that $\\var{lowerbound} \\le\\mu \\le \\var{upperbound}$ with $95$% confidence.
", "statement": "\n\tA recent survey asked $\\var{samplesize}$ {these} to rate {this} on a scale from $\\var{bottom}$ ({expb}) to $\\var{top}$ ({expt}).
\n\tThe mean rating was $\\var{samplemean}$ with SD $\\var{sstdev}$.
\n\t \n\tEnter all values to 3 decimal places.
\n\t \n\t", "variables": {"lowerbound": {"definition": "precround(samplemean-1.96*sstdev/sqrt(samplesize),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "lowerbound", "description": ""}, "score": {"definition": "random(2..5#0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "score", "description": ""}, "upperbound": {"definition": "precround(samplemean+1.96*sstdev/sqrt(samplesize),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "upperbound", "description": ""}, "samplemean": {"definition": "random(4.5..6.5#0.01)", "templateType": "anything", "group": "Ungrouped variables", "name": "samplemean", "description": ""}, "bottom": {"definition": "1", "templateType": "anything", "group": "Ungrouped variables", "name": "bottom", "description": ""}, "this": {"definition": "'the importance of price when making food choice decisions'", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "zscore": {"definition": "precround((score-samplemean)/sstdev,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "zscore", "description": ""}, "samplesize": {"definition": "1000", "templateType": "anything", "group": "Ungrouped variables", "name": "samplesize", "description": ""}, "top": {"definition": "7", "templateType": "anything", "group": "Ungrouped variables", "name": "top", "description": ""}, "these": {"definition": "'UK shoppers'", "templateType": "anything", "group": "Ungrouped variables", "name": "these", "description": ""}, "sstdev": {"definition": "random(0.9..2.0#0.01)", "templateType": "anything", "group": "Ungrouped variables", "name": "sstdev", "description": ""}, "expt": {"definition": "'Extremely important'", "templateType": "anything", "group": "Ungrouped variables", "name": "expt", "description": ""}, "expb": {"definition": "'Not at all important'", "templateType": "anything", "group": "Ungrouped variables", "name": "expb", "description": ""}}, "variable_groups": [], "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/"}]}