// Numbas version: finer_feedback_settings {"name": "STAT7009 Tutorial 2 Sampling and Confidence Intervals", "metadata": {"description": "

Financial Mathematics  

", "licence": "Creative Commons Attribution 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", "", "", "", "", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], [], [], [], [], [], [], [], [], []], "questions": [{"name": "Population vs sample", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "shuffleAnswers": true, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["$\\mu$", "$\\bar x$", "$\\sigma$", "$\\sigma^2$", "$s^2$", "$s$", "$p$", "$\\hat p$"], "matrix": [["1", 0, 0, 0, 0, 0, 0, 0], ["0", "1", 0, 0, 0, 0, 0, 0], [0, 0, "1", 0, 0, 0, 0, 0], [0, 0, 0, "1", 0, 0, 0, 0], [0, 0, 0, 0, "1", 0, 0, 0], [0, 0, 0, 0, 0, "1", 0, 0], [0, 0, 0, 0, 0, 0, "1", 0], [0, 0, 0, 0, 0, 0, 0, "1"]], "layout": {"type": "all", "expression": ""}, "answers": ["represents the population mean", "represents the sample mean", "represents the population standard deviation", "represents the population variance", "represents the sample variance", "represents the sample standard deviation", "represents the population proportion", "represents the sample proportion"]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "STAT8013 Sample standard deviation", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "tags": [], "metadata": {"description": "

Two ordered data sets, each with 10 numbers. Find the sample standard deviation for each and for their sum.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The following table gives the examination marks in {exam1} and in {exam2} and their total for a sample of $n=\\var{n}$ students.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{exam1}$\\var{r0[0]}$$\\var{r0[1]}$$\\var{r0[2]}$$\\var{r0[3]}$$\\var{r0[4]}$$\\var{r0[5]}$$\\var{r0[6]}$$\\var{r0[7]}$$\\var{r0[8]}$$\\var{r0[9]}$Mean = $\\var{mean1}$
{exam2}$\\var{r1[0]}$$\\var{r1[1]}$$\\var{r1[2]}$$\\var{r1[3]}$$\\var{r1[4]}$$\\var{r1[5]}$$\\var{r1[6]}$$\\var{r1[7]}$$\\var{r1[8]}$$\\var{r1[9]}$Mean = $\\var{mean2}$
{total}$\\var{sscores[0]}$$\\var{sscores[1]}$$\\var{sscores[2]}$$\\var{sscores[3]}$$\\var{sscores[4]}$$\\var{sscores[5]}$$\\var{sscores[6]}$$\\var{sscores[7]}$$\\var{sscores[8]}$$\\var{sscores[9]}$Mean = $\\var{overallmean}$
\n

Find the sample standard deviation for each of {exam1}, {exam2} and Total Score.

", "advice": "

The solution to the first part is here – the other parts can be done in the same way. Note that in practice we use statistical software such as Minitab.

\n

For {exam1} we have the mean is:

\n

\\[\\simplify[]{({r0[0]} + {r0[1]} + {r0[2]} + {r0[3]} + {r0[4]} + {r0[5]} + {r0[6]} + {r0[7]} + {r0[8]} + {r0[9]}) / {n} = {mean1}}\\]

\n

The sample variance is given by the formula:

\n

\\[\\textrm{Sample Variance} = \\frac{1}{n-1}\\left(\\sum_{j=1}^{n}x_j^2 -n\\mu^2\\right)\\]

\n

where the $x_j$ are the exam scores for {exam1}, $n=\\var{n}$ the number of students and $\\mu=\\var{mean1}$ the sample mean.

\n

We find that
\\[\\begin{eqnarray*}\\sum_{j=1}^{n}x_j^2 &=& \\simplify[]{({r0[0]}^2 + {r0[1]}^2 + {r0[2]}^2 + {r0[3]}^2 + {r0[4]}^2 + {r0[5]}^2 + {r0[6]}^2 + {r0[7]}^2 + {r0[8]}^2 + {r0[9]}^2)}\\\\ &=& \\var{ssq1}\\\\ \\\\ \\\\ n\\mu^2 &=&\\var{n} \\times\\var{mean1}^2\\\\ &=& \\var{n*mean1^2} \\end{eqnarray*} \\]
Hence substituting these values into the formula we find that:

\n

\\[\\begin{eqnarray*} \\textrm{Sample Variance} &=& \\frac{1}{\\var{n-1}}\\left(\\var{ssq1}-\\var{n*mean1^2}\\right)\\\\ &=& \\var{var1} \\end{eqnarray*} \\] to 3 decimal places.

\n

The Sample Standard Deviation is then the square root of the Sample Variance i.e.

\n

Sample Standard Deviation = $\\sqrt{\\var{var1}} = \\var{stdev1}$ to one decimal place.

\n

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"stdevoverall": {"name": "stdevoverall", "group": "Ungrouped variables", "definition": "precround(stdev(sscores,true),1)", "description": "", "templateType": "anything", "can_override": false}, "exam2": {"name": "exam2", "group": "Ungrouped variables", "definition": "'Cell Biology'", "description": "", "templateType": "anything", "can_override": false}, "mean2": {"name": "mean2", "group": "Ungrouped variables", "definition": "mean(r1)", "description": "", "templateType": "anything", "can_override": false}, "stdev2": {"name": "stdev2", "group": "Ungrouped variables", "definition": "precround(stdev(r1,true),1)", "description": "", "templateType": "anything", "can_override": false}, "sig0": {"name": "sig0", "group": "Ungrouped variables", "definition": "random(6..12)", "description": "", "templateType": "anything", "can_override": false}, "total": {"name": "total", "group": "Ungrouped variables", "definition": "'Total Score'", "description": "", "templateType": "anything", "can_override": false}, "tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "exam1": {"name": "exam1", "group": "Ungrouped variables", "definition": "'Analytic Chemistry'", "description": "", "templateType": "anything", "can_override": false}, "ssq1": {"name": "ssq1", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r0))", "description": "", "templateType": "anything", "can_override": false}, "var2": {"name": "var2", "group": "Ungrouped variables", "definition": "precround(variance(r1,true),3)", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "sscores": {"name": "sscores", "group": "Ungrouped variables", "definition": "map(r0[x]+r1[x],x,0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "ssq2": {"name": "ssq2", "group": "Ungrouped variables", "definition": "sum(map(x^2,x,r1))", "description": "", "templateType": "anything", "can_override": false}, "stdev1": {"name": "stdev1", "group": "Ungrouped variables", "definition": "precround(stdev(r0,true),1)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "10", "description": "", "templateType": "anything", "can_override": false}, "overallmean": {"name": "overallmean", "group": "Ungrouped variables", "definition": "mean(sscores)", "description": "", "templateType": "anything", "can_override": false}, "mu": {"name": "mu", "group": "Ungrouped variables", "definition": "random(55..65)", "description": "", "templateType": "anything", "can_override": false}, "var1": {"name": "var1", "group": "Ungrouped variables", "definition": "precround(variance(r0,true),3)", "description": "", "templateType": "anything", "can_override": false}, "sig1": {"name": "sig1", "group": "Ungrouped variables", "definition": "random(9..15)", "description": "", "templateType": "anything", "can_override": false}, "mean1": {"name": "mean1", "group": "Ungrouped variables", "definition": "mean(r0)", "description": "", "templateType": "anything", "can_override": false}, "overallvar": {"name": "overallvar", "group": "Ungrouped variables", "definition": "variance(sscores,true)", "description": "", "templateType": "anything", "can_override": false}, "r0": {"name": "r0", "group": "Ungrouped variables", "definition": "repeat(round(normalSample(mu,sig0)),n)", "description": "", "templateType": "anything", "can_override": false}, "r1": {"name": "r1", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu,sig1)),n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["overallmean", "mean1", "mean2", "overallvar", "ssq1", "ssq2", "total", "exam2", "tol", "exam1", "stdev1", "stdev2", "var1", "var2", "sig1", "sig0", "stdevoverall", "r0", "r1", "n", "mu", "s", "sscores"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n \n \n

{exam1}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n ", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{stdev1-tol}", "maxValue": "{stdev1+tol}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n \n \n

{exam2}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n ", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{stdev2-tol}", "maxValue": "{stdev2+tol}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\n \n \n

{total}

\n \n \n \n

Sample Standard Deviation = [[0]] (to one decimal place)

\n \n ", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{stdevoverall-tol}", "maxValue": "{stdevoverall+tol}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Sample mean, standard deviation and standard error", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}], "tags": [], "metadata": {"description": "

Compute a 95% confidence interval for the population mean given a small sample, and compare it with a confidence interval for a different population.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The amount of sugar in a particular brand of breakfast cereal is to be determined. $\\var {num_monday}$ replicate samples weighing 10 grams were selected at random and the amount of sugar (grams) measured for each replicate is shown in the table below.

\n

{table([['Sugar (g)']+mon],[])}

", "advice": "

a)

\n

The mean of the sample is: 

\n

\\[ \\bar{x} = \\frac{1}{n}(\\sum x_i) = \\var{precround(monday_mean,2)} \\text{ (to 2 d.p.)} \\]

\n

The standard deviation is:

\n

\\[ s = \\sqrt{\\frac{1}{n-1}\\sum \\left(x_i-\\bar{x}\\right)^2} = \\var{precround(monday_sd,2)} \\text{ (to 2 d.p.)} \\]

\n

The standard error is :

\n

\n

$\\frac{s}{\\sqrt {n}}=\\frac{\\var{precround(monday_sd,2)}}{\\sqrt{\\var{num_monday}}}=\\var{precround(monday_se,2)}$ 

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"mon": {"name": "mon", "group": "Ungrouped variables", "definition": "repeat(pop_mean+random(0.1..0.8#0.1),num_monday)", "description": "

Data for Monday

", "templateType": "anything", "can_override": false}, "monday_mean": {"name": "monday_mean", "group": "Ungrouped variables", "definition": "mean(mon)", "description": "", "templateType": "anything", "can_override": false}, "num_monday": {"name": "num_monday", "group": "Ungrouped variables", "definition": "random(8..15#1)", "description": "", "templateType": "anything", "can_override": false}, "monday_sd": {"name": "monday_sd", "group": "Ungrouped variables", "definition": "stdev(mon, true)", "description": "", "templateType": "anything", "can_override": false}, "monday_se": {"name": "monday_se", "group": "Ungrouped variables", "definition": "monday_sd/sqrt(num_monday)", "description": "", "templateType": "anything", "can_override": false}, "pop_mean": {"name": "pop_mean", "group": "Ungrouped variables", "definition": "random(0.5..2.5#0.1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_monday", "mon", "monday_mean", "monday_sd", "monday_se", "pop_mean"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the mean and standard deviation of the sample.

\n

Enter your answers to 2 decimal places.

\n

Mean: [[0]]

\n

Standard Deviation: [[1]]

\n

Standard Error: [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "monday_mean-0.01", "maxValue": "monday_mean+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "monday_sd-0.01", "maxValue": "monday_sd+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "monday_se-0.01", "maxValue": "monday_se+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "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}, "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/"}], "tags": [], "metadata": {"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.

", "licence": "Creative Commons Attribution 4.0 International"}, "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

 

", "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

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"lci": {"name": "lci", "group": "Ungrouped variables", "definition": "precround(tlci,2)", "description": "", "templateType": "anything", "can_override": false}, "aim": {"name": "aim", "group": "Ungrouped variables", "definition": "if(s=0,750,if(s=1,100,if(s=2,100,1500)))", "description": "", "templateType": "anything", "can_override": false}, "test": {"name": "test", "group": "Ungrouped variables", "definition": "if(aim lci,0,1)", "description": "", "templateType": "anything", "can_override": false}, "lies": {"name": "lies", "group": "Ungrouped variables", "definition": "if(test=0,\"lies\",\"lie\")", "description": "", "templateType": "anything", "can_override": false}, "var1": {"name": "var1", "group": "Ungrouped variables", "definition": "random(\"The variance of the filling process \",\"The process variance \")", "description": "", "templateType": "anything", "can_override": false}, "zval": {"name": "zval", "group": "Ungrouped variables", "definition": "if(confl=90,1.645,if(confl=95,1.96,2.576))", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(20..100)", "description": "", "templateType": "anything", "can_override": false}, "sc3ch": {"name": "sc3ch", "group": "Ungrouped variables", "definition": "random(\"hot water.\",\"tea.\",\"coffee.\",\"hot chocolate.\",\"cappuccino.\")", "description": "", "templateType": "anything", "can_override": false}, "dothis": {"name": "dothis", "group": "Ungrouped variables", "definition": "\n [var1 + \" is\",\n \"with a \"+var2+\" of\",\n var3+ \" is\"]\n \n \n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "sc1ch": {"name": "sc1ch", "group": "Ungrouped variables", "definition": "random(\"flour.\",\"sugar.\",\"dried milk.\",\"instant coffee.\")", "description": "", "templateType": "anything", "can_override": false}, "correct": {"name": "correct", "group": "Ungrouped variables", "definition": "if(test=0, \"yes\", \"no\")", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(0..abs(sc)-1)", "description": "", "templateType": "anything", "can_override": false}, "sd2": {"name": "sd2", "group": "Ungrouped variables", "definition": "if(s=3,sd[s]^2,sd[s])", "description": "", "templateType": "anything", "can_override": false}, "howwell": {"name": "howwell", "group": "Ungrouped variables", "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 ", "description": "", "templateType": "anything", "can_override": false}, "mm": {"name": "mm", "group": "Ungrouped variables", "definition": "[1-test,test]", "description": "", "templateType": "anything", "can_override": false}, "tuci": {"name": "tuci", "group": "Ungrouped variables", "definition": "m[s]+zval*standard_error", "description": "", "templateType": "anything", "can_override": false}, "tlci": {"name": "tlci", "group": "Ungrouped variables", "definition": "m[s]-zval*standard_error", "description": "", "templateType": "anything", "can_override": false}, "sd": {"name": "sd", "group": "Ungrouped variables", "definition": "\n [random(800..1400#20),\n random(1200..1800#20),\n random(300..600#20),\n random(100..200#0.1)]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "con": {"name": "con", "group": "Ungrouped variables", "definition": "(100+confl)/200", "description": "", "templateType": "anything", "can_override": false}, "doornot": {"name": "doornot", "group": "Ungrouped variables", "definition": "if(test=0, \" \",\"does not\")", "description": "", "templateType": "anything", "can_override": false}, "sc4ch": {"name": "sc4ch", "group": "Ungrouped variables", "definition": "random(\"supermarkets\",\"clothing retailers\",\"department stores\",\"fast food outlets\")", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "\n [\"bags \",\n sc2ch,\n \"filled cups \"\n]\n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "\n [random(700..745),\n random(95..98),\n random(90..99)]\n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "sd1": {"name": "sd1", "group": "Ungrouped variables", "definition": "if(s=3,sd[s],sqrt(sd[s]))", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "description": "", "templateType": "anything", "can_override": false}, "var2": {"name": "var2", "group": "Ungrouped variables", "definition": "random(\"process variance \",\"population variance \")", "description": "", "templateType": "anything", "can_override": false}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "\n [\"packs sacks of \"+sc1ch,\n \"manufactures \"+sc2ch,\n \"produces vending machines which fill cups with \"+sc3ch\n\n ]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "uci": {"name": "uci", "group": "Ungrouped variables", "definition": "precround(tuci,2)", "description": "", "templateType": "anything", "can_override": false}, "var3": {"name": "var3", "group": "Ungrouped variables", "definition": "random(\"The variance of the filling process \",\"The process variance \")", "description": "", "templateType": "anything", "can_override": false}, "sc2ch": {"name": "sc2ch", "group": "Ungrouped variables", "definition": "random(\"bolts\",\"screws\")", "description": "", "templateType": "anything", "can_override": false}, "confl": {"name": "confl", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "", "templateType": "anything", "can_override": false}, "spec": {"name": "spec", "group": "Ungrouped variables", "definition": "if(s=2,\"the timecards of \", \" \")", "description": "", "templateType": "anything", "can_override": false}, "standard_error": {"name": "standard_error", "group": "Ungrouped variables", "definition": "sqrt(sd1^2/n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "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", "standard_error"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Does the sample mean follow a Z-distribution or a t-distribution?

\n

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Z-distribution", "t-distribution"], "matrix": ["1", 0], "distractors": ["", ""]}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The standard error is  [[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "standard_error", "maxValue": "standard_error", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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

 

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lci-0.05", "maxValue": "lci+0.05", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "uci-0.05", "maxValue": "uci+0.05", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Practise using the t-Distribution Tables", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "

\n

Given a random variable $X$  normally distributed as $\\operatorname{N}(m,\\sigma^2)$ find probabilities $P(X \\gt a),\\; a \\gt m;\\;\\;P(X \\lt b),\\;b \\lt m$.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Use the t-distribution to answer the questions below. You must give your answers correct to 3 decimal places.

\n

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n4": {"name": "n4", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t4": {"name": "t4", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.995,df4),3)", "description": "", "templateType": "anything", "can_override": false}, "df1": {"name": "df1", "group": "Ungrouped variables", "definition": "random(4..18#1)", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t3": {"name": "t3", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.995,df3),3)", "description": "", "templateType": "anything", "can_override": false}, "t5": {"name": "t5", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.975,n1-1),3)", "description": "", "templateType": "anything", "can_override": false}, "t8": {"name": "t8", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.995,n4-1),3)", "description": "", "templateType": "anything", "can_override": false}, "n2": {"name": "n2", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "df3": {"name": "df3", "group": "Ungrouped variables", "definition": "random(4..18#1)", "description": "", "templateType": "anything", "can_override": false}, "t2": {"name": "t2", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.975,df2),3)", "description": "", "templateType": "anything", "can_override": false}, "df4": {"name": "df4", "group": "Ungrouped variables", "definition": "random(4..18#1 except df3)", "description": "", "templateType": "anything", "can_override": false}, "t1": {"name": "t1", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.975,df1),3)", "description": "", "templateType": "anything", "can_override": false}, "df2": {"name": "df2", "group": "Ungrouped variables", "definition": "random(4..18#1 except df1)", "description": "", "templateType": "anything", "can_override": false}, "t6": {"name": "t6", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.99,n2-1),3)", "description": "", "templateType": "anything", "can_override": false}, "n3": {"name": "n3", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t7": {"name": "t7", "group": "Ungrouped variables", "definition": "precround(studenttinv(0.975,n3-1),3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["df1", "df2", "df3", "df4", "n1", "n2", "n3", "n4", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

\n

What are the values of tlow and thigh which between them contain the central 95% of values in the t- distribution, with:

\n

(i) $\\var{df1}$ degrees of freedom

\n

tlow =[[0]]

\n

thigh =[[1]]

\n

(ii) $\\var{df2}$ degrees of freedom

\n

tlow =[[2]]

\n

thigh =[[3]]

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

\n

What are the values of tlow and thigh which between them contain the central 99% of values in the t- distribution, with

\n

(i) $\\var{df3}$ degrees of freedom

\n

tlow =[[0]]

\n

thigh =[[1]]

\n

(ii) $\\var{df4}$ degrees of freedom

\n

tlow =[[2]]

\n

thigh =[[3]]

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

i) What is the critical t-value associated with a sample of size $\\var{n1}$ and a significance level of 0.05 for a two-tailed distribution?

\n

tcrit =[[0]]

\n

ii) What is the critical t-value associated with a sample of size $\\var{n2}$ and a significance level of 0.01 for a one-tailed distribution?

\n

tcrit =[[1]]

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

i) What is the value of  $t_{{\\frac{\\alpha}{2},}{n-1}}$ where $n = \\var{n3}$ and ${\\alpha} = 0.05$?

\n

$t_{{\\frac{\\alpha}{2},}{n-1}}$ = [[0]]

\n

\n

ii) What is the value of  $t_{{\\frac{\\alpha}{2},}{n-1}}$ where $n = \\var{n4}$ and ${\\alpha} = 0.01$?

\n

$t_{{\\frac{\\alpha}{2},}{n-1}}$ = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t7", "maxValue": "t7", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t8", "maxValue": "t8", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Find a confidence interval for the population mean with variance unknown. Sample mean and sample standard deviation given. ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "tags": [], "metadata": {"description": "

Finding the confidence interval at either 90%, 95% or 99% for the mean given the mean and standard deviation of a sample. The population variance is not given and so the t test has to be used. Various scenarios are included.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The management of {sc[s]} wants to {dothis[s]}.

\n

A random sample of {spec} $\\var{n}$ {t[s]} gave a mean and standard deviation of {p}$\\var{m[s]}$ {units} and {p}$\\var{sd[s]}${units} respectively.

", "advice": "

1.

\n

The population variance is unknown. So we have to use the t tables to find the confidence interval.

\n

2.

\n

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

\n

As we have $\\var{n}-1=\\var{n-1}$ degrees of freedom, the interval is given by:

\n

\\[ \\var{m[s]} \\pm t_{\\var{n-1}}\\sqrt{\\frac{\\var{sd[s]}^2}{\\var{n}}}\\]

\n

Looking up the t tables for $\\var{confl}$% we see that $t_{\\var{n-1}}=\\var{invt}$ to 3 decimal places.

\n

Hence:

\n

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

\n

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

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"tlci": {"name": "tlci", "group": "Ungrouped variables", "definition": "m[s]-invt*standard_error", "description": "", "templateType": "anything", "can_override": false}, "dothis": {"name": "dothis", "group": "Ungrouped variables", "definition": "\n [\"estimate the mean cost per room of repairing damage caused by its customers during a bank holiday weekend\",\n \"estimate the mean monthly sales of all of its outlets\",\n \"estimate the mean hours worked per week of all its employees\",\n \"estimate the mean cost of a ticket on its most popular route\",\n \"estimate the mean weight of \"+sc5ch+\" inside bars of its most popular product\",\n \"estimate the mean amount of saturated fat in its \"+ sc6ch]\n \n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "invt": {"name": "invt", "group": "Ungrouped variables", "definition": "precround(tinvt,3)", "description": "", "templateType": "anything", "can_override": false}, "sc2ch": {"name": "sc2ch", "group": "Ungrouped variables", "definition": "random(\"local\",\"national\")", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(10..30)", "description": "", "templateType": "anything", "can_override": false}, "sc1ch": {"name": "sc1ch", "group": "Ungrouped variables", "definition": "random(\"hotels\",\"motels\", \"Bed and Breakfasts\",\"budget hotels\")", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(0..abs(sc)-1)", "description": "", "templateType": "anything", "can_override": false}, "sc6ch": {"name": "sc6ch", "group": "Ungrouped variables", "definition": "random(\"Cornish pasties\",\"sausage rolls\",\"chicken pies\",\"minced beef pasties\")", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "\n [\"vacated rooms was inspected by the management and this\",\n \"clothing outlets \",\n \"workers\",\n \"tickets \",\n \"chocolate bars \",\n sc6ch+\" \"]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "\n [\"a national chain of \"+ sc1ch,\n \"a \"+sc2ch + \" chain of clothing shops \",\n \" a large factory \",\n \" a regional passenger airline in \"+sc4ch,\n \"Choclastic!, a company producing a variety of chocolate bars \",\n \" a large bakery \"]\n ", "description": "", "templateType": "anything", "can_override": false}, "sc5ch": {"name": "sc5ch", "group": "Ungrouped variables", "definition": "random(\"caramel\",\"Turkish delight\",\"honeycomb\",\"nuts\")", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "switch(s=2,\"hours\",s=4,\"g\",s=5,\"g per 100g\",\" \")", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "\n [random(30..100#0.01),\n random(40000..80000#500),\n random(34..48#0.01),\n random(100..300#0.01),\n random(10..20#0.01),\n random(3.5..6#0.01)]\n \n ", "description": "", "templateType": "anything", "can_override": false}, "lci": {"name": "lci", "group": "Ungrouped variables", "definition": "precround(tlci,2)", "description": "", "templateType": "anything", "can_override": false}, "tuci": {"name": "tuci", "group": "Ungrouped variables", "definition": "m[s]+invt*standard_error", "description": "", "templateType": "anything", "can_override": false}, "tinvt": {"name": "tinvt", "group": "Ungrouped variables", "definition": "studenttinv((confl+100)/200,n-1)", "description": "", "templateType": "anything", "can_override": false}, "confl": {"name": "confl", "group": "Ungrouped variables", "definition": "random(90,95,99)", "description": "", "templateType": "anything", "can_override": false}, "spec": {"name": "spec", "group": "Ungrouped variables", "definition": "if(s=2,\"the timecards of \", \" \")", "description": "", "templateType": "anything", "can_override": false}, "sc4ch": {"name": "sc4ch", "group": "Ungrouped variables", "definition": "random(\"the Caribbean\",\"the Mediterranean\",\"North East Ireland\",\"South West Ireand\",\"California\")", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "switch(s=0 or s=1 or s=3,'\u00a3',' ')", "description": "", "templateType": "anything", "can_override": false}, "uci": {"name": "uci", "group": "Ungrouped variables", "definition": "precround(tuci,2)", "description": "", "templateType": "anything", "can_override": false}, "sd": {"name": "sd", "group": "Ungrouped variables", "definition": "\n [random(3..10#0.01),\n random(500..4000#0.5),\n random(2..5#0.01),\n random(10..40#0.01),\n random(1..3#0.01),\n random(0.5..1#0.01)]\n ", "description": "", "templateType": "anything", "can_override": false}, "standard_error": {"name": "standard_error", "group": "Ungrouped variables", "definition": "precround(sqrt(sd[s]^2/n),3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["m", "uci", "invt", "units", "lci", "spec", "sc2ch", "sc1ch", "tinvt", "confl", "tuci", "dothis", "sc4ch", "sc6ch", "n", "p", "s", "tlci", "t", "sc", "sc5ch", "sd", "standard_error"], "variable_groups": [], "functions": {"pounds": {"parameters": [["n", "number"]], "type": "number", "language": "javascript", "definition": "return Numbas.util.currency(n,'\u00a3','p');"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is the population variance known or unknown?

\n

[[0]]

\n

\n

Which distribution does the sample mean follow?

\n

[[1]]

\n

\n

The standard error of the mean is estimated to be:

\n

[[4]]

\n

Enter to 3 decimal places.

\n

\n

For a $\\var{confl}$% confidence interval, the critical t- value is

\n

[[5]]

\n

Enter to 3 decimal places.

\n

\n

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

\n

$a=\\;${p}[[2]]{units}          $b=\\;${p}[[3]]{units}

\n

Enter both to 2 decimal places.

", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Known", "Unknown"], "matrix": [0, 1], "distractors": ["", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Z distribution", "t distribution"], "matrix": ["0", "1"], "distractors": ["", ""]}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lci-0.01", "maxValue": "lci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "uci-0.01", "maxValue": "uci+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "standard_error-0.001", "maxValue": "standard_error+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "invt-0.001", "maxValue": "invt+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Calculate confidence interval for the mean, standard deviation unknown", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "

\n

Calculate confidence interval for the mean, sample variance adaptive marking

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{scenario1[Index]} {sample_size} {scenario2[Index]}  {m[Index]} {units1[Index]} with a standard deviation of {s[Index]} {units1[Index]}.

\n

\n

 

", "advice": "

\n

 

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"sample_size": {"name": "sample_size", "group": "Unnamed group", "definition": "random(18..30#1)", "description": "", "templateType": "anything", "can_override": false}, "stuff": {"name": "stuff", "group": "Ungrouped variables", "definition": "[\"assembly time\", \"amount spent on books\"]", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "m[Index]+Z[Index]*(s[Index]/sqrt(sample_size))", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "[\"95\",\"99\"]", "description": "", "templateType": "anything", "can_override": false}, "amount": {"name": "amount", "group": "Ungrouped variables", "definition": "[\"number of grams\", \"volume (in ml)\"]", "description": "", "templateType": "anything", "can_override": false}, "scenario1": {"name": "scenario1", "group": "Unnamed group", "definition": "[\"The operations manager of a large production plant would like to estimate the mean\namount of time a worker takes to assemble a new electronic component. After observing\",\"Suppose we would like to estimate the mean amount of money spent on books by CIT students in a semester. A sample of\"]\n\n", "description": "", "templateType": "anything", "can_override": false}, "scenario3": {"name": "scenario3", "group": "Unnamed group", "definition": "[\"minutes with a standard deviation of\", \"\u20ac with a standard deviation of\"]", "description": "", "templateType": "anything", "can_override": false}, "Index": {"name": "Index", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "scenario2": {"name": "scenario2", "group": "Unnamed group", "definition": "[\"workers assembling similar devices, the manager noticed that their average time was\", \"randomly chosen students was found to spend an average of\"]", "description": "", "templateType": "anything", "can_override": false}, "units1": {"name": "units1", "group": "Ungrouped variables", "definition": "[\"minutes\", \"\u20ac\"]", "description": "", "templateType": "anything", "can_override": false}, "tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.01", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "[random(14..18#0.2),random(80..200#5)]", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "[random(3.2..4#0.1), random(15..20#1)]", "description": "", "templateType": "anything", "can_override": false}, "Z": {"name": "Z", "group": "Ungrouped variables", "definition": "[precround(normalinv(0.975,0,1),2),precround(normalinv(0.995,0,1),2)]", "description": "", "templateType": "anything", "can_override": false}, "standard_error": {"name": "standard_error", "group": "Ungrouped variables", "definition": "precround(s[Index]/sqrt(sample_size),3)", "description": "", "templateType": "anything", "can_override": false}, "lower_t": {"name": "lower_t", "group": "Unnamed group", "definition": "precround(m[Index]-t_used*standard_error,2)", "description": "", "templateType": "anything", "can_override": false}, "upper_t": {"name": "upper_t", "group": "Unnamed group", "definition": "precround(m[Index]+t_used*standard_error,2)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Unnamed group", "definition": "[precround(studenttinv(0.975,sample_size-1),3),precround(studenttinv(0.995,sample_size-1),3)]", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Unnamed group", "definition": "m[Index]-Z[Index]*(s[Index]/sqrt(sample_size))", "description": "", "templateType": "anything", "can_override": false}, "t_used": {"name": "t_used", "group": "Unnamed group", "definition": "t[Index]", "description": "

t

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["units1", "upper", "m", "s", "amount", "tol", "stuff", "Index", "percentage", "Z", "standard_error"], "variable_groups": [{"name": "Unnamed group", "variables": ["scenario1", "scenario2", "sample_size", "scenario3", "lower_t", "upper_t", "t", "lower", "t_used"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is the population standard deviation $\\sigma$ known or unknown?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["Known", "Unknown"], "matrix": [0, "1"], "distractors": ["", ""]}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which distribution does the sample mean follow?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["z-distribution", "t-distribution"], "matrix": [0, "1"], "distractors": ["", ""]}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The standard error of the mean is estimated to be [[0]]

\n

Enter to 3 decimal places.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "standard_error-0.001", "maxValue": "standard_error+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

For a {percentage[Index]}% confidence interval, the critical t- value is [[0]]

\n

Enter to 3 decimal places.

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t[Index]-0.001", "maxValue": "t[Index]+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Construct a {percentage[Index]}% confidence interval for the mean {stuff[Index]}.

\n

Lower limit = [[0]]

\n

Upper limit = [[1]]

\n

Enter to 2 decimal places.

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower_t-0.01", "maxValue": "lower_t+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper_t-0.01", "maxValue": "upper_t+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Confidence Interval Doctor's Surgery", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Hayley Moore", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/495/"}], "tags": [], "metadata": {"description": "

Compute a 95% confidence interval for the population mean given a small sample, and compare it with a confidence interval for a different population.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The ages of a random sample of patients coming into a doctor's surgery during the school holidays are noted down on each Monday and Friday thoughout August.

\n

{table([['Monday']+mon,['Friday']+fri],[])}

", "advice": "

a)

\n

The mean of the sample of patients visiting on Mondays is 

\n

\\[ \\bar{x} = \\frac{1}{n}(\\sum x_i) = \\var{precround(monday_mean,2)} \\text{ (to 2 d.p.)} \\]

\n

The standard deviation is

\n

\\[ s = \\sqrt{\\frac{1}{n-1}\\sum \\left(x_i-\\bar{x}\\right)^2} = \\var{precround(monday_sd,2)} \\text{ (to 2 d.p.)} \\]

\n

b)

\n

The sample mean $\\mu_m$ follows a $t$-distribution with $n-1 = \\var{num_monday-1}$ degrees of freedom centred on the population mean, with a standard error of $\\frac{s}{\\sqrt{n}} = \\simplify{{precround(monday_sd,2)}/sqrt({num_monday})} = \\var{precround(monday_se,2)}$.

\n

That means that the 95% confidence interval for the population mean is as follows:

\n

\\begin{array}{lrcl}
&\\left[ \\bar{x} - s \\times t_{\\var{num_monday-1},0.975} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\bar{x} + s \\times t_{\\var{num_monday-1},0.975} \\right] \\\\
= & \\left[ \\simplify[]{{precround(monday_mean,2)} - {precround(monday_se,2)}*{precround(monday_t,2)}} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\simplify[]{{precround(monday_mean,2)} + {precround(monday_se,2)}*{precround(monday_t,2)}} \\right] \\\\
= & \\left[ \\var{precround(monday_low,2)} \\right. \\kern{-0.5em}&,&\\kern{-0.5em} \\left. \\var{precround(monday_high,2)} \\right]
\\end{array}

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"fri": {"name": "fri", "group": "Ungrouped variables", "definition": "repeat(friday_pop_mean+random(-friday_pop_range..friday_pop_range),num_monday)", "description": "

Data for Friday

", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,11)", "description": "", "templateType": "anything", "can_override": false}, "mon": {"name": "mon", "group": "Ungrouped variables", "definition": "repeat(monday_pop_mean+random(-monday_pop_range..monday_pop_range),num_monday)", "description": "

Data for Monday

", "templateType": "anything", "can_override": false}, "friday_t": {"name": "friday_t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,num_friday-1)", "description": "", "templateType": "anything", "can_override": false}, "monday_mean": {"name": "monday_mean", "group": "Ungrouped variables", "definition": "mean(mon)", "description": "", "templateType": "anything", "can_override": false}, "no_overlap": {"name": "no_overlap", "group": "Ungrouped variables", "definition": "friday_low > monday_high or friday_high < monday_low", "description": "", "templateType": "anything", "can_override": false}, "friday_se": {"name": "friday_se", "group": "Ungrouped variables", "definition": "stdev(fri,true)/sqrt(num_friday)", "description": "", "templateType": "anything", "can_override": false}, "num_friday": {"name": "num_friday", "group": "Ungrouped variables", "definition": "random(12..16)", "description": "", "templateType": "anything", "can_override": false}, "friday_pop_mean": {"name": "friday_pop_mean", "group": "Ungrouped variables", "definition": "random(20..70)", "description": "", "templateType": "anything", "can_override": false}, "num_monday": {"name": "num_monday", "group": "Ungrouped variables", "definition": "12", "description": "", "templateType": "anything", "can_override": false}, "monday_pop_range": {"name": "monday_pop_range", "group": "Ungrouped variables", "definition": "20", "description": "", "templateType": "anything", "can_override": false}, "friday_pop_range": {"name": "friday_pop_range", "group": "Ungrouped variables", "definition": "20", "description": "", "templateType": "anything", "can_override": false}, "monday_sd": {"name": "monday_sd", "group": "Ungrouped variables", "definition": "stdev(mon, true)", "description": "", "templateType": "anything", "can_override": false}, "monday_pop_mean": {"name": "monday_pop_mean", "group": "Ungrouped variables", "definition": "random(20..70)", "description": "", "templateType": "anything", "can_override": false}, "friday_high": {"name": "friday_high", "group": "Ungrouped variables", "definition": "friday_mean+friday_t*friday_se", "description": "", "templateType": "anything", "can_override": false}, "monday_t": {"name": "monday_t", "group": "Ungrouped variables", "definition": "studenttinv(0.975,num_monday-1)", "description": "", "templateType": "anything", "can_override": false}, "friday_low": {"name": "friday_low", "group": "Ungrouped variables", "definition": "friday_mean-friday_t*friday_se", "description": "", "templateType": "anything", "can_override": false}, "friday_mean": {"name": "friday_mean", "group": "Ungrouped variables", "definition": "mean(fri)", "description": "", "templateType": "anything", "can_override": false}, "monday_high": {"name": "monday_high", "group": "Ungrouped variables", "definition": "monday_mean+monday_t*monday_se", "description": "", "templateType": "anything", "can_override": false}, "monday_low": {"name": "monday_low", "group": "Ungrouped variables", "definition": "monday_mean-monday_t*monday_se", "description": "

Lower end of the confidence interval for Monday's mean

", "templateType": "anything", "can_override": false}, "monday_se": {"name": "monday_se", "group": "Ungrouped variables", "definition": "monday_sd/sqrt(num_monday)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["num_monday", "monday_pop_mean", "monday_pop_range", "mon", "num_friday", "friday_pop_mean", "friday_pop_range", "fri", "monday_mean", "monday_sd", "monday_se", "monday_t", "monday_low", "monday_high", "t", "friday_mean", "friday_se", "friday_t", "friday_low", "friday_high", "no_overlap"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the mean and standard deviation of the sample of patients visiting on Mondays.

\n

Enter your answers to 2 decimal places.

\n

Mean: [[0]]

\n

Standard Deviation: [[1]]

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

Find the 95% confidence interval for the population mean $\\mu_m$ of the age of patients visiting on Monday, using the $t$-distribution with $\\var{num_monday-1}$ degrees of freedom.

\n

Enter your answers to 2 decimal places.

\n

Lower limit: [[0]]

\n

Upper limit: [[1]] 

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "monday_low-0.01", "maxValue": "monday_low+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "monday_high-0.01", "maxValue": "monday_high+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Calculate confidence interval for the proportion", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "

\n

Calculate confidence interval for the mean, sample variance n>30

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{scenario1[Index]} {n1[Index]} {scenario2[Index]} {prop1[Index]} {scenario3[Index]} {percentage}%  {scenario4[Index]}.

\n

", "advice": "

\n

The estimate for the population proportion is $\\hat{p} =\\frac{{\\var{prop1[Index]}}}{\\var{n1[Index]}}=\\var{precround(p_hat,3)}$

\n

\n

The estimate for the standard error associated with $\\hat{p}$ is  $=\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{n}}=\\sqrt{\\frac{\\var{precround(p_hat,3)}\\times (1-\\var{precround(p_hat,3)})}{\\var{n1[Index]}}}=\\var{se}$

\n

 

\n

To construct a $\\var{percentage}$% confidence interval, $Z_\\frac{\\alpha}{2}=Z_\\frac{\\var{alpha2}}{2} = \\var{Z}$

\n

\n

Putting this information together, the lower bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} -Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1[Index]}}}=\\var{precround(p_hat,3)} -\\var{Z}\\times \\var{se}=\\var{precround(lower,2)}$

\n

The upper bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} +Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1[Index]}}}=\\var{precround(p_hat,3)} +\\var{Z}\\times \\var{se}=\\var{precround(upper,2)}$

\n

\n

\n

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p_hat": {"name": "p_hat", "group": "Unnamed group", "definition": "prop1[Index]/n1[Index]", "description": "", "templateType": "anything", "can_override": false}, "scenario2": {"name": "scenario2", "group": "Unnamed group", "definition": "[\"newly employed graduates from CIT found that\", \"machines is taken and\"]\n", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Unnamed group", "definition": "[random(100..120#10),random(180..250#10)]", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "p_hat+Z*sqrt((p_hat*(1-p_hat))/n1[Index])", "description": "", "templateType": "anything", "can_override": false}, "alpha2": {"name": "alpha2", "group": "Unnamed group", "definition": "alpha*2", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "random([95,99])", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "p_hat-Z*sqrt((p_hat*(1-p_hat))/n1[Index])", "description": "", "templateType": "anything", "can_override": false}, "se": {"name": "se", "group": "Ungrouped variables", "definition": "precround(sqrt((p_hat*(1-p_hat))/n1[Index]),4)", "description": "", "templateType": "anything", "can_override": false}, "prop1": {"name": "prop1", "group": "Unnamed group", "definition": "[random(75..80#1),random(30..50#2)]", "description": "", "templateType": "anything", "can_override": false}, "scenario1": {"name": "scenario1", "group": "Unnamed group", "definition": "[\"A survey of\",\"A manufacturer would like to estimate the proportion of X-ray machines that malfunction and produce excess radiation. A random sample of\"]\n\n", "description": "", "templateType": "anything", "can_override": false}, "Z": {"name": "Z", "group": "Ungrouped variables", "definition": "precround(normalinv(1-alpha,0,1),2)", "description": "", "templateType": "anything", "can_override": false}, "scenario3": {"name": "scenario3", "group": "Unnamed group", "definition": "[\"of the graduates surveyed used statistics in their new roles. Calculate a\" , \"of the machines malfunction. Calculate a\"]", "description": "", "templateType": "anything", "can_override": false}, "Index": {"name": "Index", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}, "scenario4": {"name": "scenario4", "group": "Unnamed group", "definition": "[\"confidence interval for the proportion of CIT graduates who use statistics in their place of work.\", \"confidence interval for the proportion of X-ray machines that malfunction in the population.\"]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["upper", "Index", "percentage", "Z", "alpha", "lower", "se"], "variable_groups": [{"name": "Unnamed group", "variables": ["scenario1", "scenario2", "prop1", "scenario3", "p_hat", "n1", "scenario4", "alpha2"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Lower limit = [[0]]

\n

Upper limit = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower", "maxValue": "lower", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper", "maxValue": "upper", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Calculate confidence interval for the proportion Diagnostic Kit", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "

\n

Calculate confidence interval for the proportion

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

A company manufacturing a diagnostic kit sent {n1} samples of the kit to an independent laboratory to be analysed. The number of diagnostic kits that met industry standards was {prop1}.

\n

\n

", "advice": "

\n

The estimate for the population proportion is $\\hat{p} =\\frac{{\\var{prop1}}}{\\var{n1}}=\\var{precround(p_hat,3)}$

\n

\n

The estimate for the standard error associated with $\\hat{p}$ is  $=\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{n}}=\\sqrt{\\frac{\\var{precround(p_hat,3)}\\times (1-\\var{precround(p_hat,3)})}{\\var{n1}}}=\\var{se}$

\n

 

\n

To construct a $\\var{percentage}$% confidence interval, $Z_\\frac{\\alpha}{2}=Z_\\frac{\\var{alpha2}}{2} = \\var{Z}$

\n

\n

Putting this information together, the lower bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} -Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1}}}=\\var{precround(p_hat,3)} -\\var{Z}\\times \\var{se}=\\var{precround(lower,2)}$

\n

The upper bound of the $\\var{percentage}$% confidence interval is: 

\n

$\\hat{p} +Z_\\frac{\\alpha}{2}\\times\\sqrt{\\frac{\\hat{p}(1-\\hat{p})}{\\var{n1}}}=\\var{precround(p_hat,3)} +\\var{Z}\\times \\var{se}=\\var{precround(upper,2)}$

\n

\n

\n

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p_hat": {"name": "p_hat", "group": "Unnamed group", "definition": "prop1/n1", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Unnamed group", "definition": "random(800..1000#50)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "p_hat+Z*sqrt((p_hat*(1-p_hat))/n1)", "description": "", "templateType": "anything", "can_override": false}, "alpha2": {"name": "alpha2", "group": "Unnamed group", "definition": "alpha*2", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "random([95,99])", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "p_hat-Z*sqrt((p_hat*(1-p_hat))/n1)", "description": "", "templateType": "anything", "can_override": false}, "se": {"name": "se", "group": "Ungrouped variables", "definition": "precround(sqrt((p_hat*(1-p_hat))/n1),4)", "description": "", "templateType": "anything", "can_override": false}, "prop1": {"name": "prop1", "group": "Unnamed group", "definition": "random(730..788#1)", "description": "", "templateType": "anything", "can_override": false}, "Z": {"name": "Z", "group": "Ungrouped variables", "definition": "precround(normalinv(1-alpha,0,1),2)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["upper", "percentage", "Z", "alpha", "lower", "se"], "variable_groups": [{"name": "Unnamed group", "variables": ["prop1", "p_hat", "n1", "alpha2"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The sample proportion $\\hat{p}$ is [[0]]

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

The standard error of the sample proportion is [[0]]

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

Calculate a {percentage}% confidence interval for the proportion of diagnostic kits that meet idustry standards.

\n

\n

Lower limit = [[0]]

\n

Upper limit = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower-0.01", "maxValue": "lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper-0.01", "maxValue": "upper+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Practise using the chi-squared-Distribution Tables", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "

\n

Given a random variable $X$  normally distributed as $\\operatorname{N}(m,\\sigma^2)$ find probabilities $P(X \\gt a),\\; a \\gt m;\\;\\;P(X \\lt b),\\;b \\lt m$.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Use the $\\chi^2$-distribution to answer the questions below. You must give your answers correct to 2 decimal places.

\n

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n4": {"name": "n4", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t4": {"name": "t4", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.975,df2),3)", "description": "", "templateType": "anything", "can_override": false}, "df1": {"name": "df1", "group": "Ungrouped variables", "definition": "random(4..18#1)", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t3": {"name": "t3", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.025,df2),3)", "description": "", "templateType": "anything", "can_override": false}, "t5": {"name": "t5", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.005,df3),3)", "description": "", "templateType": "anything", "can_override": false}, "t8": {"name": "t8", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.975,n3-1),3)", "description": "", "templateType": "anything", "can_override": false}, "n2": {"name": "n2", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "df3": {"name": "df3", "group": "Ungrouped variables", "definition": "random(4..18#1)", "description": "", "templateType": "anything", "can_override": false}, "t2": {"name": "t2", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.975,df1),3)", "description": "", "templateType": "anything", "can_override": false}, "df4": {"name": "df4", "group": "Ungrouped variables", "definition": "random(4..18#1 except df3)", "description": "", "templateType": "anything", "can_override": false}, "t1": {"name": "t1", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.025,df1),3)", "description": "", "templateType": "anything", "can_override": false}, "df2": {"name": "df2", "group": "Ungrouped variables", "definition": "random(4..18#1 except df1)", "description": "", "templateType": "anything", "can_override": false}, "t6": {"name": "t6", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.995,df3),3)", "description": "", "templateType": "anything", "can_override": false}, "n3": {"name": "n3", "group": "Ungrouped variables", "definition": "random(5..20#1)", "description": "", "templateType": "anything", "can_override": false}, "t7": {"name": "t7", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.025,n3-1),3)", "description": "", "templateType": "anything", "can_override": false}, "t9": {"name": "t9", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.005,n4-1),3)", "description": "", "templateType": "anything", "can_override": false}, "t10": {"name": "t10", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.995,n4-1),3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["df1", "df2", "df3", "df4", "n1", "n2", "n3", "n4", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What are the values of $\\chi^2$low and $\\chi^2$high which between them contain the central 95% of values in the $\\chi^2$- distribution, with:

\n

(i) $\\var{df1}$ degrees of freedom

\n

$\\chi^2$low =[[0]]

\n

$\\chi^2$high =[[1]]

\n

(ii) $\\var{df2}$ degrees of freedom

\n

$\\chi^2$low =[[2]]

\n

$\\chi^2$high =[[3]]

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

What are the values of $\\chi^2$low and $\\chi^2$high which between them contain the central 99% of values in the $\\chi^2$- distribution, with $\\var{df3}$ degrees of freedom.

\n

$\\chi^2$low =[[0]]

\n

$\\chi^2$high =[[1]]

\n

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

(i) What are the values of  $\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ and $\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ where $n = \\var{n3}$ and ${\\alpha} = 0.05$?

\n

$\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ = [[0]]

\n

$\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ = [[1]]

\n

(ii) What is the value of $\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ and $\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ where $n = \\var{n4}$ and ${\\alpha} = 0.01$?

\n

$\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ =[[2]]

\n

$\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ = [[3]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t7", "maxValue": "t7", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t8", "maxValue": "t8", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t9", "maxValue": "t9", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t10", "maxValue": "t10", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "2", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Confidence interval for the variance folic acid", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

The folic acid content ( g per 100g) of 8 samples of a particular brand of breakfast cereal are shown below:

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{d1}{d2}{d3}{d4}{d5}{d6}{d7}{d8}
\n

            

\n

The variance of the folic acid content samples was calculated to be $\\var{sample_var}$.

\n

\n

Calculate a 95% confidence interval for the variance of the folic acid content.

\n

", "advice": "

The $95$% confidence interval for the population variance $\\sigma^2$ is:

\n

\n

$a=\\frac{(n-1)\\times s^2}{\\chi^2_{upper,n-1}}=\\frac{(8-1)\\times \\var{s}^2}{\\chi^2_{0.975,7}}=\\var{lower}$

\n

\n

$b=\\frac{(n-1)\\times s^2}{\\chi^2_{lower,n-1}}=\\frac{(8-1)\\times \\var{s}^2}{\\chi^2_{0.025,7}}=\\var{upper}$

\n

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"d1": {"name": "d1", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d2": {"name": "d2", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d3": {"name": "d3", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d4": {"name": "d4", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d5": {"name": "d5", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d6": {"name": "d6", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "

random(160..179#1)

", "templateType": "anything", "can_override": false}, "d7": {"name": "d7", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "d8": {"name": "d8", "group": "Ungrouped variables", "definition": "random(160..179#1)", "description": "", "templateType": "anything", "can_override": false}, "sample_var": {"name": "sample_var", "group": "Ungrouped variables", "definition": "precround(variance([d1,d2,d3,d4,d5,d6,d7,d8],true),3)", "description": "", "templateType": "anything", "can_override": false}, "chi_lower": {"name": "chi_lower", "group": "Ungrouped variables", "definition": " precround(chisquareinv(0.025,7),3)", "description": "", "templateType": "anything", "can_override": false}, "chi_upper": {"name": "chi_upper", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.975,7),3)", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "precround(sample_var*7/chi_upper,2)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "precround(sample_var*7/chi_lower,2)", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "precround(sqrt(sample_var),4)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "sample_var", "chi_lower", "chi_upper", "lower", "upper", "s"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "d1", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers to two decimal places.

\n

What are the values of  $\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ and $\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$?

\n

$\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ = [[0]]

\n

$\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_lower-0.01", "maxValue": "chi_lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_upper-0.01", "maxValue": "chi_upper+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answer to one decimal place.

\n

The lower limit is [[0]]

\n

The upper limit is [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [{"variable": "chi_lower", "part": "p0g0", "must_go_first": false}, {"variable": "chi_upper", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower-0.1", "maxValue": "lower+0.1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "chi_lower", "part": "p0g0", "must_go_first": false}, {"variable": "chi_upper", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper-0.1", "maxValue": "upper+0.1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Confidence interval for the standard deviation of a sodium solution adaptive marking", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

To determine the average sodium concentration of a solution, {n} replicate samples were taken and the sodium content of each sample (mg/L) was recorded:

\n

 

\n

   {data}

\n

The variance of the sodium concentration in the samples was calculated to be $\\var{sample_var}$.                 

\n

Produce a 99% confidence interval for the standard deviation of the sodium concentration.  

\n

", "advice": "

The 99% confidence interval for the population variance $\\sigma^2$ is:

\n

\n

$lower=\\frac{(n-1)\\times s^2}{\\chi^2_{upper,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{0.995,\\var{n-1}}}=\\var{lower}$

\n

\n

$upper=\\frac{(n-1)\\times s^2}{\\chi^2_{lower,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{0.005,\\var{n-1}}}=\\var{upper}$

\n

\n

The 99% confidence interval for the population standard deviation $\\sigma$ is:

\n

\n

$lower=\\sqrt{\\var{lower}}=\\var{lower_sd}$

\n

$upper=\\sqrt{\\var{upper}}=\\var{upper_sd}$

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"sample_var": {"name": "sample_var", "group": "Ungrouped variables", "definition": "precround(variance(data,true),4)", "description": "", "templateType": "anything", "can_override": false}, "chi_lower": {"name": "chi_lower", "group": "Ungrouped variables", "definition": " precround(chisquareinv(0.005,(n-1)),3)", "description": "", "templateType": "anything", "can_override": false}, "chi_upper": {"name": "chi_upper", "group": "Ungrouped variables", "definition": "precround(chisquareinv(0.995,(n-1)),3)", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "precround(sample_var*(n-1)/chi_upper,4)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "precround(sample_var*(n-1)/chi_lower,4)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(6..10#1)", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "shuffle(5.3..5.8#0.01)[0..n]\n", "description": "", "templateType": "anything", "can_override": false}, "lower_sd": {"name": "lower_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(lower),3)", "description": "", "templateType": "anything", "can_override": false}, "upper_sd": {"name": "upper_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(upper),3)", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "precround(sqrt(sample_var),5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sample_var", "chi_lower", "chi_upper", "lower", "n", "data", "lower_sd", "upper", "upper_sd", "s"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answer to two decimal places.

\n

What are the values of  $\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ and $\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$?

\n

$\\chi^2_{{\\frac{\\alpha}{2},}{n-1}}$ = [[0]]

\n

$\\chi^2_{1-{\\frac{\\alpha}{2},}{n-1}}$ = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_lower-0.01", "maxValue": "chi_lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_upper-0.001", "maxValue": "chi_upper+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answer to three decimal places.

\n

The lower limit is [[0]]

\n

The upper limit is [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [{"variable": "chi_lower", "part": "p0g0", "must_go_first": false}, {"variable": "chi_upper", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

The question asked for a confidence interval for the standard deviation which is the square root of the variance.

", "useAlternativeFeedback": false, "minValue": "precround(lower,3)-0.001", "maxValue": "precround(lower,3)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "lower_sd-0.001", "maxValue": "lower_sd+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "chi_lower", "part": "p0g0", "must_go_first": false}, {"variable": "chi_upper", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

The question asked for a confidence interval for the standard deviation which is the square root of the variance.

", "useAlternativeFeedback": false, "minValue": "precround(upper,3)-0.001", "maxValue": "precround(upper,3)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "minValue": "upper_sd-0.001", "maxValue": "upper_sd+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Confidence intervals for the mean and standard deviation of a protein in infant formula adaptive marking", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

The amount of protein in a particular brand of infant formula is to be determined. {n} replicate samples weighing 100 grams were selected at random and the amount of protein (grams) measured for each replicate is shown below.

\n

  

\n

   {data}

\n

                    

\n

(i) Produce a {percentage}% confidence interval for the mean amount of protein per 100 grams 

\n

(ii) Produce a {percentage}% confidence interval for the variance of the amount of protein per 100 grams.  

\n

", "advice": "

The sample mean $\\bar{x}=\\var{mean}$

\n

The sample standard deviation $s=\\var{s}$

\n

The sample variance is $s^2=\\var{sample_var}$

\n

\n

The sample mean $\\mu_m$ follows a $t$-distribution with $n-1 = \\var{n-1}$ degrees of freedom centred on the population mean, with a standard error of $\\frac{s}{\\sqrt{n}} = \\simplify{{precround(s,2)}/sqrt({n})} = \\var{precround(standard_error,2)}$

\n

That means that the {percentage}% confidence interval for the population mean is as follows:

\n

$a=\\bar{x}-t_{\\frac{\\alpha}{2},n-1}\\times\\frac{s}{\\sqrt{n}}$

\n

$a=\\var{mean}-t_{\\frac{\\var{alpha}}{2},\\var{n-1}}\\times\\frac{\\var{s}}{\\sqrt{\\var{n}}}=\\var{a}$

\n

$a=\\bar{x}+t_{\\frac{\\alpha}{2},n-1}\\times\\frac{s}{\\sqrt{n}}$

\n

$b=\\var{mean}+t_{\\frac{\\var{alpha}}{2},\\var{n-1}}\\times\\frac{\\var{s}}{\\sqrt{\\var{n}}}=\\var{b}$

\n

\n

The {percentage}% confidence interval for the population variance $\\sigma^2$ is:

\n

\n

$a=\\frac{(n-1)\\times s^2}{\\chi^2_{upper,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{\\simplify{1-{alpha/2}},\\var{n-1}}}=\\var{lower}$

\n

\n

$b=\\frac{(n-1)\\times s^2}{\\chi^2_{lower,n-1}}=\\frac{(\\var{n}-1)\\times \\var{s}^2}{\\chi^2_{\\simplify{{alpha/2}},\\var{n-1}}}=\\var{upper}$

\n

\n

The {percentage}% confidence interval for the population standard deviation $\\sigma$ is:

\n

\n

$a=\\sqrt{\\var{lower}}=\\var{lower_sd}$

\n

$a=\\sqrt{\\var{upper}}=\\var{upper_sd}$

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"sample_var": {"name": "sample_var", "group": "Ungrouped variables", "definition": "precround(variance(data,true),4)", "description": "", "templateType": "anything", "can_override": false}, "chi_lower": {"name": "chi_lower", "group": "Ungrouped variables", "definition": " precround(chisquareinv(alpha,(n-1)),2)", "description": "", "templateType": "anything", "can_override": false}, "chi_upper": {"name": "chi_upper", "group": "Ungrouped variables", "definition": "precround(chisquareinv(1-alpha,(n-1)),2)", "description": "", "templateType": "anything", "can_override": false}, "lower": {"name": "lower", "group": "Ungrouped variables", "definition": "precround(s^2*(n-1)/chi_upper,4)", "description": "", "templateType": "anything", "can_override": false}, "upper": {"name": "upper", "group": "Ungrouped variables", "definition": "precround(s^2*(n-1)/chi_lower,4)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(6..9#1)", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "shuffle(13.6..14.7#0.1)[0..n]\n", "description": "", "templateType": "anything", "can_override": false}, "lower_sd": {"name": "lower_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(lower),3)", "description": "", "templateType": "anything", "can_override": false}, "upper_sd": {"name": "upper_sd", "group": "Ungrouped variables", "definition": "precround(sqrt(upper),3)", "description": "", "templateType": "anything", "can_override": false}, "percentage": {"name": "percentage", "group": "Ungrouped variables", "definition": "perc[Index]", "description": "", "templateType": "anything", "can_override": false}, "perc": {"name": "perc", "group": "Ungrouped variables", "definition": "[95,99]", "description": "", "templateType": "anything", "can_override": false}, "Index": {"name": "Index", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "(100-percentage)/200", "description": "", "templateType": "anything", "can_override": false}, "mean": {"name": "mean", "group": "Ungrouped variables", "definition": "precround(mean(data),3)", "description": "", "templateType": "anything", "can_override": false}, "standard_error": {"name": "standard_error", "group": "Ungrouped variables", "definition": "precround(s/sqrt(n),3)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "'grams'", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "precround((mean-t*standard_error),3)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "precround((mean+t*standard_error),3)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "precround(studenttinv((1-alpha),(n-1)),3)", "description": "", "templateType": "anything", "can_override": false}, "alpha_comp": {"name": "alpha_comp", "group": "Ungrouped variables", "definition": "1-alpha", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "precround(sqrt(sample_var),3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["sample_var", "chi_lower", "chi_upper", "lower", "n", "data", "lower_sd", "upper", "upper_sd", "percentage", "perc", "Index", "alpha", "mean", "standard_error", "units", "a", "b", "t", "alpha_comp", "s"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers to three decimal places.

\n

The sample mean is  [[0]]

\n

The sample standard deviation is [[1]]

\n

The standard error is [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "mean-0.001", "maxValue": "mean+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "sample_var", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "s-0.001", "maxValue": "s+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "standard_error-0.001", "maxValue": "standard_error+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers correct to 3 decimal places.

\n

What is the critical t-value associated with a sample of size $\\var{n}$ and $\\frac{\\alpha}{2}=\\var{alpha}$?

\n

tcrit =[[0]]

\n

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

\n

\n

$a=$ [[1]]

\n

$b=$ [[2]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "t-0.001", "maxValue": "t+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "mean", "part": "p0g0", "must_go_first": false}, {"variable": "standard_error", "part": "p0g2", "must_go_first": false}, {"variable": "t", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "a-0.002", "maxValue": "a+0.002", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "mean", "part": "p0g0", "must_go_first": false}, {"variable": "standard_error", "part": "p0g2", "must_go_first": false}, {"variable": "t", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "b-0.002", "maxValue": "b+0.002", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Please give your answers correct to two decimal places.

\n

What is the critical $\\chi^2$-value associated with a sample of size $\\var{n}$ and $1-\\frac{\\alpha}{2}=\\var{alpha_comp}$?

\n

[[0]]

\n

\n

What is the critical $\\chi^2$-value associated with a sample of size $\\var{n}$ and $\\frac{\\alpha}{2}=\\var{alpha}$?

\n

[[1]]

\n

\n

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

\n

$a=\\;$  [[2]]

\n

$b=\\;$  [[3]]

\n

Calculate a  $\\var{percentage}$% confidence interval $(a,b)$ for the population standard deviation:

\n

$a=\\;$  [[4]]

\n

$b=\\;$  [[5]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_upper-0.001", "maxValue": "chi_upper+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "chi_lower-0.001", "maxValue": "chi_lower+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_upper", "part": "p2g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower-0.01", "maxValue": "lower+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_lower", "part": "p2g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper-0.01", "maxValue": "upper+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_upper", "part": "p2g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lower_sd-0.01", "maxValue": "lower_sd+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "s", "part": "p0g1", "must_go_first": false}, {"variable": "chi_lower", "part": "p2g1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "upper_sd-0.01", "maxValue": "upper_sd+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}