// Numbas version: finer_feedback_settings {"name": "mathcentre: Business Statistics 4", "metadata": {"notes": "", "description": "
5 questions on confidence intervals and hypothesis testing. Population variance given, z-test. Not given, t-test.
"}, "duration": 0.0, "percentpass": 0.0, "shufflequestions": false, "navigation": {"allowregen": true, "reverse": true, "browse": true, "showfrontpage": true, "onleave": {"action": "none", "message": ""}, "preventleave": true, "showresultspage": "never"}, "timing": {"timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0.0, "enterreviewmodeimmediately": false, "showexpectedanswerswhen": "never", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "type": "exam", "questions": [], "allQuestions": true, "pickQuestions": 0, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "BS4.1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["confidence interval for the mean", "confidence intervals", "mean", "sample", "sampling", "sc", "standard deviation", "statistics", "student t test", "t tables", "t test"], "advice": "1.
\nThe population variance is unknown. So we have to use the t tables to find the confidence interval.
\n2.
\nWe now calculate the $\\var{confl}$% confidence interval:
\nAs 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}}}\\]
\nLooking up the t tables for $\\var{confl}$% we see that $t_{\\var{n-1}}=\\var{invt}$ to 3 decimal places.
\nHence:
\nLower 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.
\nUpper 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.
\n", "rulesets": {}, "parts": [{"prompt": "
Is the population variance known or unknown?
\n[[0]]
\nCalculate a $\\var{confl}$% confidence interval $(a,b)$ for the population mean:
\n$a=\\;${p}[[1]]{units} $b=\\;${p}[[2]]{units}
\nEnter both to 2 decimal places.
\n", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": [0.0, 1.0], "shufflechoices": true, "minanswers": 0.0, "choices": ["Known", "Unknown"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"minvalue": "lci-0.01", "type": "numberentry", "maxvalue": "lci+0.01", "marks": 1.0, "showPrecisionHint": false}, {"minvalue": "uci-0.01", "type": "numberentry", "maxvalue": "uci+0.01", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}], "statement": "
The management of {sc[s]} wants to {dothis[s]}.
\nA 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.
\n\n
", "variable_groups": [], "progress": "testing", "type": "question", "variables": {"m": {"definition": "\n [random(30..100#0.10),\n random(40000..80000#0500),\n random(34..48#0.5),\n random(100..300#0.5),\n random(10..20#0.5),\n random(3.5..6#0.5)]\n \n ", "name": "m"}, "uci": {"definition": "precround(tuci,2)", "name": "uci"}, "invt": {"definition": "precround(tinvt,3)", "name": "invt"}, "units": {"definition": "switch(s=2,\"hours\",s=4,\"g\",s=5,\"g per 100g\",\" \")", "name": "units"}, "lci": {"definition": "precround(tlci,2)", "name": "lci"}, "spec": {"definition": "if(s=2,\"the timecards of \", \" \")", "name": "spec"}, "sc2ch": {"definition": "random(\"local\",\"national\")", "name": "sc2ch"}, "sc1ch": {"definition": "random(\"hotels\",\"motels\", \"Bed and Breakfasts\",\"budget hotels\")", "name": "sc1ch"}, "tinvt": {"definition": "studenttinv((confl+100)/200,n-1)", "name": "tinvt"}, "confl": {"definition": "random(90,95,99)", "name": "confl"}, "tuci": {"definition": "m[s]+invt*sqrt(sd[s]^2/n)", "name": "tuci"}, "dothis": {"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 ", "name": "dothis"}, "sc4ch": {"definition": "random(\"the Caribbean\",\"the Mediterranean\",\"North East England\",\"South West England\",\"California\")", "name": "sc4ch"}, "sc6ch": {"definition": "random(\"Cornish pasties\",\"sausage rolls\",\"chicken pies\",\"minced beef pasties\")", "name": "sc6ch"}, "n": {"definition": "random(10..30)", "name": "n"}, "p": {"definition": "switch(s=0 or s=1 or s=3,'\u00a3',' ')", "name": "p"}, "s": {"definition": "random(0..abs(sc)-1)", "name": "s"}, "tlci": {"definition": "m[s]-invt*sqrt(sd[s]^2/n)", "name": "tlci"}, "t": {"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 ", "name": "t"}, "sc": {"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 ", "name": "sc"}, "sc5ch": {"definition": "random(\"caramel\",\"Turkish delight\",\"honeycomb\",\"nuts\")", "name": "sc5ch"}, "sd": {"definition": "\n [random(3..10#0.10),\n random(500..4000#0.5),\n random(2..5#0.5),\n random(10..40#0.5),\n random(1..3#0.5),\n random(0.5..1#0.1)]\n ", "name": "sd"}}, "metadata": {"notes": "
1/01/2013:
\nUses the statistical extension which includes the necessary t statistic functions. There are string variables giving various scenarios and these can be added to by the author - except has to add values to arrays m and sd etc as well. Added tag sc.
\n6/01/2013:
\nImproved display of units.
", "description": "\n \t\tFinding 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.
\n \t\t\n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS4.2", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["confidence interval for the mean", "confidence intervals", "mean", "population variance", "sample", "sampling", "sc", "standard deviation", "statistics", "variance known", "z score"], "advice": "\n
a)
\nWe use the z tables to find the confidence interval as we know the population variance.
\nWe now calculate the $\\var{confl}$% confidence interval.
\nNote that $z_{\\var{confl}}=\\var{zval}$ and the confidence interval is given by:
\n\\[ \\var{m[s]} \\pm z_{\\var{confl}}\\sqrt{\\frac{\\var{sd2}}{\\var{n}}}\\]
\nHence:
\nLower value of the confidence interval $=\\;\\displaystyle \\var{m[s]} -\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{lci}${units} to 2 decimal places.
\nUpper value of the confidence interval $=\\;\\displaystyle \\var{m[s]} +\\var{zval} \\sqrt{\\frac{\\var{sd2}} {\\var{n}}} = \\var{uci}${units} to 2 decimal places.
\nb)
\nSince $\\var{aim}$ {doornot} {lies} in the confidence interval the answer is {Correct}.
\n\n ", "rulesets": {}, "parts": [{"prompt": "\n
Calculate a $\\var{confl}$% confidence interval $(a,b)$ for the population mean:
\n$a=\\;$[[0]]{units} $b=\\;$[[1]]{units}
\nEnter both to 2 decimal places.
\n\n ", "gaps": [{"minvalue": "lci-0.01", "type": "numberentry", "maxvalue": "lci+0.01", "marks": 1.0, "showPrecisionHint": false}, {"minvalue": "uci-0.01", "type": "numberentry", "maxvalue": "uci+0.01", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\n
{howwell[s]}
\n[[0]]
\n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["Yes", "No"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}], "statement": "\nA company {sc[s]} {dothis[s]} $\\var{sd[s]}$ {units}.
\nA random sample of $\\var{n}$ {t[s]} gives a mean of $\\var{m[s]}$ {units}.
\n\n ", "variable_groups": [], "progress": "testing", "type": "question", "variables": {"correct": {"definition": "if(test=0, \"yes\", \"no\")", "name": "correct"}, "sd1": {"definition": "if(s=3,sd[s],sqrt(sd[s]))", "name": "sd1"}, "sd2": {"definition": "if(s=3,sd[s]^2,sd[s])", "name": "sd2"}, "howwell": {"definition": "\n [\"On average, is the company reaching its target of 750g per bag?\",\n \"The bolts are designed to be 100mm long. Is the process satisfactory?\",\n \"The vending machines are supposed to fill 100ml cups. Is the machine working satisfactorily?\",\n \"The company aims for an average salary of \u00a31500 per month per worker. Is the aim being met?\"]\n ", "name": "howwell"}, "doornot": {"definition": "if(test=0, \" \",\"does not\")", "name": "doornot"}, "uci": {"definition": "precround(tuci,2)", "name": "uci"}, "units": {"definition": "switch(s=0,\"g\",s=1,\"mm\",s=2,\"ml\",\"pounds\")", "name": "units"}, "confl": {"definition": "random(90,95,99)", "name": "confl"}, "spec": {"definition": "if(s=2,\"the timecards of \", \" \")", "name": "spec"}, "var1": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var1"}, "var3": {"definition": "random(\"The variance of the filling process \",\"The process variance \")", "name": "var3"}, "var2": {"definition": "random(\"process variance \",\"population variance \")", "name": "var2"}, "sc2ch": {"definition": "random(\"bolts\",\"screws\")", "name": "sc2ch"}, "test": {"definition": "if(aim
1/01/2013:
\n \t\tUses the statistical extension which includes the necessary statistic functions. There are string variables giving various scenarios and these can be added to by the author - except has to add values to arrays m and sd etc as well. Added tag sc.
\n \t\t", "description": "\n \t\tFinding 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.
\n \t\t\n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS4.3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["Probability", "accept null hypothesis", "alternative hypothesis", "critical value", "decision", "degree of freedom", "diagram", "evidence", "hypothesis testing", "null hypothesis", "p value", "population variance", "probability", "random sample", "reject null hypothesis", "sample mean", "sample standard deviation", "sampling", "sc", "statistics", "t tables", "t test", "test statistic", "two-tailed test"], "advice": "\n
a)
\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thisamount}$
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$
\nb)
\nWe should use the t statistic as the population variance is unknown.
\nThe test statistic:
\n\\[t =\\frac{ |\\var{m} -\\var{thisamount}|} {\\sqrt{\\frac{\\var{stand} ^ 2 }{\\var{n}}}} = \\var{tval}\\]
\nto 3 decimal places.
\nc)
\nAs $n=\\var{n}$ we use the $t_{\\var{n-1}}$ tables. We have the following data from the tables:
\n{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}
\nWe see that the $p$ value {pm[pval]}.
\n
d)
Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}
\n ", "rulesets": {}, "parts": [{"prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;$[[1]]
\n ", "gaps": [{"minvalue": "thisamount", "type": "numberentry", "maxvalue": "thisamount", "marks": 0.5, "showPrecisionHint": false}, {"minvalue": "thisamount", "type": "numberentry", "maxvalue": "thisamount", "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 3: Test statistic
\nShould we use the z or t test statistic? [[0]] (enter z or t)
\nNow calculate the test statistic = ? [[1]] (to 3 decimal places)
\n ", "gaps": [{"checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "t", "type": "jme"}, {"minvalue": "tval-tol", "type": "numberentry", "maxvalue": "tval+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 4: p-value
\nUse tables to find a range for your $p$-value.
\nChoose the correct range here for $p$ : [[0]]
\n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 5: Conclusion
\n\n
Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour Decision:
\n[[1]]
\n\n
Conclusion:
\n[[2]]
\n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "dmm", "shufflechoices": false, "minanswers": 0.0, "choices": ["Retain", "Reject"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": [1.0, 0.0], "shufflechoices": true, "minanswers": 0.0, "choices": ["{Correctc}", "{Fac}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}], "statement": "\n{this}
\n{claim}
\n{test}
\nA sample of {n} {things}
\n{resultis} £{m} with a standard deviation of £{stand}.
\nPerform an appropriate hypothesis test to see if the claim made by the online flight company is substantiated (use a two-tailed test).
\n ", "variable_groups": [], "progress": "testing", "type": "question", "variables": {"claim": {"definition": "\"The average cost of a flight with us to \"+ here + \" is just \u00a3\" + {thisamount} + \" (including all taxes and charges!)\"", "name": "claim"}, "pval": {"definition": "switch(tval2/01/2012:
\n \t\tAdded tag sc as has string variables in order to generate other scenarios.
\n \t\tThe jstat function studenttinv(critvalue,n-1) gives the critical p values correctly.
\n \t\tAdded tag diagram as the i-assess question advice has a nice graphic of the p-value and the appropriate decision.
\n \t\t", "description": "Provided with information on a sample with sample mean and standard deviation, but no information on the population variance, use the t test to either accept or reject a given null hypothesis.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS4.4", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["Probability", "accept null hypothesis", "alternative hypothesis", "critical value", "decision", "diagram", "evidence", "hypothesis testing", "known population variance", "null hypothesis", "one-tailed test", "p value", "population variance", "probability", "reject null hypothesis", "sample mean", "sampling", "sc", "statistics", "test statistic", "z test"], "advice": "\na)
\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thismuch}$
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\lt\\;\\var{thismuch}$
\nb)
\nWe should use the z statistic as the population variance is known.
\nThe test statistic:
\n\\[z =\\frac{ |\\var{m} -\\var{thismuch}|} {\\sqrt{\\frac{\\var{thisvar}}{\\var{n}}}} = \\var{zval}\\]
\nto 3 decimal places.
\nc)
\n{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}
\nWe see that the $p$ value {pm[pval]}.
\n
d)
Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}
\n ", "rulesets": {}, "parts": [{"prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\lt\\;$[[1]]
\n ", "gaps": [{"minvalue": "thismuch", "type": "numberentry", "maxvalue": "thismuch", "marks": 0.5, "showPrecisionHint": false}, {"minvalue": "thismuch", "type": "numberentry", "maxvalue": "thismuch", "marks": 0.5, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 3: Test statistic
\nShould we use the z or t test statistic? [[0]] (enter z or t)
\nNow calculate the test statistic = ? [[1]] (to 3 decimal places)
\n \n ", "gaps": [{"checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "z", "type": "jme"}, {"minvalue": "zval-tol", "type": "numberentry", "maxvalue": "zval+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 4: p-value
\nUse tables to find a range for your $p$-value.
\nChoose the correct range here for $p$ : [[0]]
\n \n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 5: Conclusion
\n\n
Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour Decision:
\n[[1]]
\n\n
Conclusion:
\n[[2]]
\n \n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "dmm", "shufflechoices": false, "minanswers": 0.0, "choices": ["Retain", "Reject"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": [1.0, 0.0], "shufflechoices": true, "minanswers": 0.0, "choices": ["{Correctc}", "{Fac}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}], "statement": "\n{this} {stuff}
\n{claim}$\\var{thismuch}${units} and {var} {thisvar}.
\n{test}
\nTo investigate a sample of $\\var{n}$ {things} {resultis} $\\var{m}${units}.
\nPerform an appropriate hypothesis test to see if the claim made by the customers is substantiated.
\n ", "variable_groups": [], "progress": "testing", "type": "question", "variables": {"claim": {"definition": "\"The vending machine company claims that each cup should be filled with \"", "name": "claim"}, "var": {"definition": "\"the variance of the filling process is known to be \"", "name": "var"}, "pval": {"definition": "switch(zval2/01/2012:
\n \t\tAdded tag sc as has string variables in order to generate other scenarios.
\n \t\tAdded tag diagram as the i-assess question advice has a nice graphic of the p-value and the appropriate decision.
\n \t\t", "description": "Provided with information on a sample with sample mean and known population variance, use the z test to either accept or reject a given null hypothesis.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS4.5", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "tags": ["accept null hypothesis", "alternative hypothesis", "comparing means", "degree of freedom", "diagram", "hypothesis testing", "null hypothesis", "p values", "pooled standard deviation", "population variance", "random sample", "reject null hypothesis", "sample mean", "sampling", "sc", "statistics", "t tables", "t test", "test statistic", "two-tailed test"], "advice": "
b)
Step 3 : Test statistic
\nWe should use the t statistic as the population variance is unknown.
\nThe pooled standard deviation is given by :
\n\\[s = \\sqrt{\\frac{\\var{n1 -1} \\times \\var{sd} ^ 2 + \\var{n2 -1} \\times \\var{sd1} ^ 2 }{\\var{n1} + \\var{n2} -2}} = \\var{tpsd} = \\var{psd}\\] to 3 decimal places.
\nThe test statistic is given by \\[t = \\frac{|\\var{m} -\\var{m1}|}{s \\sqrt{\\frac{1}{ \\var{n1} }+\\frac{1}{ \\var{n2}}}} = \\var{tval}\\] to 3 decimal places.
\n(Using $s=\\var{tpsd}$ in this formula. )
\nc)
\nStep 4: p value range.
\nAs the degree of freedom is $\\var{n1}+\\var{n2}-2=\\var{n-1}$ we use the $t_{\\var{n-1}}$ tables. We have the following data from the tables:
\n{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}
\nWe see that the $p$ value {pm[pval]}.
\nd)
\nStep 5: Conclusion
\nHence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.
\n{Correctc}.
", "rulesets": {}, "parts": [{"prompt": "\nStep 1: Null hypothesis
\nIf $\\mu_M$ is the mean for time spent by {things} and $\\mu_F$ is the mean for time spent by {things1} then you are given that:
\n$\\operatorname{H}_0\\;:\\;\\mu_M=\\mu_F$.
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;:\\;\\mu_M \\neq \\mu_F$.
\n\n ", "type": "information", "marks": 0.0}, {"prompt": "\n
Step 3: Test statistic
\nShould we use the z or t test statistic?
\n[[0]]
\nNow calculate the pooled standard deviation: [[1]] (to 3 decimal places)
\n\n
Now calculate the test statistic = ? [[2]] (to 3 decimal places)
\n\n
(Note that in this calculation you should use a value for the pooled standard deviation which is accurate to at least 5 decimal places and not the value you found to 3 decimal places above).
\n ", "gaps": [{"checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "t", "type": "jme"}, {"minvalue": "psd-tol", "type": "numberentry", "maxvalue": "psd+tol", "marks": 1.0, "showPrecisionHint": false}, {"minvalue": "tval-tol", "type": "numberentry", "maxvalue": "tval+tol", "marks": 1.0, "showPrecisionHint": false}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nStep 4: p-value range
\nUse tables to find a range for your p -value.
\nChoose the correct range here for p : [[0]]
\n\n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}, {"prompt": "\n
Given the $p$ - value and the range you have found, what is the strength of evidence against the null hypothesis?
\n[[0]]
\nYour Decision:
\n[[1]]
\n\n
Conclusion:
\n[[2]]
\n ", "gaps": [{"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "mm", "shufflechoices": false, "minanswers": 0.0, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", "", "", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": "dmm", "shufflechoices": false, "minanswers": 0.0, "choices": ["Retain", "Reject"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}, {"maxanswers": 0.0, "displaycolumns": 0.0, "matrix": [1.0, 0.0], "shufflechoices": true, "minanswers": 0.0, "choices": ["{Correctc}", "{Fac}"], "displaytype": "radiogroup", "maxmarks": 0.0, "distractors": ["", ""], "marks": 1.0, "type": "1_n_2", "minmarks": 0.0}], "type": "gapfill", "marks": 0.0}], "statement": "\n{this}
\nA random sample of $\\var{n1}$ {things} and $\\var{n2}$ {things1} gave the following results in {units}.
\n{table([['Male',{m},{sd}],['Female',{m1},{sd1}]],[' ','Mean','Standard deviation'])}
\nPerform an appropriate hypothesis test to see if there is any difference between {that} between {things} and {things1} (the null and alternative hypotheses have been set out for you).
\n ", "variable_groups": [], "progress": "testing", "type": "question", "variables": {"sd1": {"definition": "random(65..90)", "name": "sd1"}, "pval": {"definition": "switch(tval3/01/2012:
\n \t\tAdded tag sc as can be changed to other applications. Perhaps the tables used should be improved.
\n \t\tMissing a diagram from the original iassess question, hence tag diagram added.
\n \t\t", "description": "Given two sets of data, sample mean and sample standard deviation, on performance on the same task, make a decision as to whether or not the mean times differ. Population variance not given, so the t test has to be used in conjunction with the pooled sample standard deviation.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}