// 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.

\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.

\n

 

", "rulesets": {}, "parts": [{"prompt": "

Is the population variance known or unknown? 

\n

[[0]]

\n

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

\n

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

\n

Enter 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]}.

\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.

\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:

\n

Uses 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.

\n

6/01/2013:

\n

Improved display of units.

", "description": "\n \t\t

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.

\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)

\n

We use the z tables 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{confl}}=\\var{zval}$ and the confidence interval is given by:

\n

\\[ \\var{m[s]} \\pm z_{\\var{confl}}\\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

b)

\n

Since $\\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}

\n

Enter 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": "\n

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

\n

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

\n

 

\n ", "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 lci,0,1)", "name": "test"}, "zval": {"definition": "if(confl=90,1.645,if(confl=95,1.96,2.576))", "name": "zval"}, "sc1ch": {"definition": "random(\"flour.\",\"sugar.\",\"dried milk.\",\"instant coffee.\")", "name": "sc1ch"}, "lci": {"definition": "precround(tlci,2)", "name": "lci"}, "tuci": {"definition": "m[s]+zval*sqrt(sd1^2/n)", "name": "tuci"}, "lies": {"definition": "if(test=0,\"lies\",\"lie\")", "name": "lies"}, "mm": {"definition": "[1-test,test]", "name": "mm"}, "dothis": {"definition": "\n [var1 + \" is\",\n \"with a \"+var2+\" of\",\n var3+ \" is\",\n \"knows that the population standard deviation for the wages of employees is\"]\n \n \n \n \n ", "name": "dothis"}, "sc4ch": {"definition": "random(\"supermarkets\",\"clothing retailers\",\"department stores\",\"fast food outlets\")", "name": "sc4ch"}, "m": {"definition": "\n [random(700..745),\n random(95..98),\n random(90..99),\n random(1000..2500#50)]\n \n \n ", "name": "m"}, "n": {"definition": "random(20..100)", "name": "n"}, "aim": {"definition": "if(s=0,750,if(s=1,100,if(s=2,100,1500)))", "name": "aim"}, "sc3ch": {"definition": "random(\"hot water.\",\"tea.\",\"coffee.\",\"hot chocolate.\",\"cappuccino.\")", "name": "sc3ch"}, "s": {"definition": "random(0..abs(sc)-1)", "name": "s"}, "tlci": {"definition": "m[s]-zval*sqrt(sd1^2/n)", "name": "tlci"}, "t": {"definition": "\n [\"bags \",\n sc2ch,\n \"filled cups \",\n \"monthly wage slips \"]\n \n \n ", "name": "t"}, "sc": {"definition": "\n [\"packs sacks of \"+sc1ch,\n \"manufactures \"+sc2ch,\n \"produces vending machines which fill cups with \"+sc3ch,\n \"in charge of the accounts of a large chain of \"+sc4ch\n ]\n \n ", "name": "sc"}, "sd": {"definition": "\n [random(800..1400#20),\n random(1200..1800#20),\n random(300..600#20),\n random(100..200#0.1)]\n \n ", "name": "sd"}}, "metadata": {"notes": "\n \t\t

1/01/2013:

\n \t\t

Uses 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\t

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.

\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)

\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thisamount}$

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$

\n

b)

\n

We should use the t statistic as the population variance is unknown.

\n

The test statistic:

\n

\\[t =\\frac{ |\\var{m} -\\var{thisamount}|} {\\sqrt{\\frac{\\var{stand} ^ 2 }{\\var{n}}}} = \\var{tval}\\]

\n

to 3 decimal places.

\n

c)

\n

As  $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%'])}

\n

We see that the $p$ value {pm[pval]}.

\n


d)

\n

Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.

\n

{Correctc}

\n ", "rulesets": {}, "parts": [{"prompt": "\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]

\n

Step 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": "\n

Step 3: Test statistic

\n

Should we use the z or t test statistic? [[0]] (enter z or t)

\n

Now 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": "\n

Step 4: p-value

\n

Use tables to find a range for your $p$-value. 

\n

Choose 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": "\n

Step 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]]

\n

Your 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}

\n

A sample of {n} {things}

\n

{resultis} £{m} with a standard  deviation of £{stand}.

\n

Perform 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(tval1,\"There is sufficient evidence against the claim of the flight company.\",\"There is insufficient evidence against the claim of the flight company.\")", "name": "correctc"}, "resultis": {"definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \"", "name": "resultis"}, "here": {"definition": "random(\"Barcelona\",\"Madrid\",\"Athens\",\"Berlin\",\"Palma\",\"Rome\",\"Paris\",\"Lisbon\")", "name": "here"}, "fac": {"definition": "if(pval<2,\"There is sufficient evidence against the claim of the flight company\",\"There is insufficient evidence against the claim of the flight company.\")", "name": "fac"}, "confl": {"definition": "random(90,95,99)", "name": "confl"}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi"}, "this": {"definition": "\"An online flight company makes the following claim:\"", "name": "this"}, "dothis": {"definition": "switch(pval <2, 'retain','reject')", "name": "dothis"}, "m": {"definition": "thisamount+random(1..15)", "name": "m"}, "dmm": {"definition": "if(pval<2,[1,0],[0,1])", "name": "dmm"}, "n": {"definition": "random(10..30)", "name": "n"}, "mm": {"definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "name": "mm"}, "thisamount": {"definition": "random(70..90)", "name": "thisamount"}, "stand": {"definition": "random(15..25)", "name": "stand"}}, "metadata": {"notes": "\n \t\t

2/01/2012:

\n \t\t

Added tag sc as has string variables in order to generate other scenarios.

\n \t\t

The jstat function studenttinv(critvalue,n-1) gives the critical p values correctly.

\n \t\t

Added 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": "\n

a)

\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thismuch}$

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\lt\\;\\var{thismuch}$

\n

b)

\n

We should use the z statistic as the population variance is known.

\n

The test statistic:

\n

\\[z =\\frac{ |\\var{m} -\\var{thismuch}|} {\\sqrt{\\frac{\\var{thisvar}}{\\var{n}}}} = \\var{zval}\\]

\n

to 3 decimal places.

\n

c)

\n

{table([['Critical Value',crit[0],crit[1],crit[2]]],['p value','10%','5%','1%'])}

\n

We see that the $p$ value {pm[pval]}.

\n


d)

\n

Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.

\n

{Correctc}

\n ", "rulesets": {}, "parts": [{"prompt": "\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]

\n

Step 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": "\n

Step 3: Test statistic

\n

Should we use the z or t test statistic? [[0]] (enter z or t)

\n

Now 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": "\n

Step 4: p-value

\n

Use tables to find a range for your $p$-value. 

\n

Choose 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

Step 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]]

\n

Your 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}

\n

To investigate a sample of $\\var{n}$ {things} {resultis} $\\var{m}${units}. 

\n

Perform 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(zval1,\n \"There is sufficient evidence against the claim of the vending company.\",\n \"There is insufficient evidence against the claim of the vending company.\")", "name": "correctc"}, "resultis": {"definition": "\"giving a mean of \"", "name": "resultis"}, "thisvar": {"definition": "random(300..500#10)", "name": "thisvar"}, "test": {"definition": "\"Customers of the vending machine suspect the machine is under-filling.\"", "name": "test"}, "zval": {"definition": "precround(zval1,3)", "name": "zval"}, "fac": {"definition": "if(pval<2,\n \"There is sufficient evidence against the claim of the vending company\",\"There is insufficient evidence against the claim of the vending company.\")", "name": "fac"}, "confl": {"definition": "random(90,95,99)", "name": "confl"}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi"}, "this": {"definition": "\"A vending machine fills cups with \"", "name": "this"}, "dothis": {"definition": "switch(pval <2, 'retain','reject')", "name": "dothis"}, "m": {"definition": "thismuch-random(3..15)", "name": "m"}, "dmm": {"definition": "if(pval<2,[1,0],[0,1])", "name": "dmm"}, "n": {"definition": "random(50..100)", "name": "n"}, "zval1": {"definition": "abs(m-thismuch)*sqrt(n)/sqrt(thisvar)", "name": "zval1"}, "stand": {"definition": "random(15..25)", "name": "stand"}}, "metadata": {"notes": "\n \t\t

2/01/2012:

\n \t\t

Added tag sc as has string variables in order to generate other scenarios.

\n \t\t

Added 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)

\n

Step 3 : Test statistic

\n

We should use the   t statistic as the population variance is unknown.

\n

The 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.

\n

The 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. )

\n

c)

\n

Step 4: p value range.

\n

As  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%'])}

\n

We see that the $p$ value {pm[pval]}.

\n

d)

\n

Step 5: Conclusion

\n

Hence there is {evi1[pval]} evidence against $\\operatorname{H}_0$ and so we {dothis} $\\operatorname{H}_0$.

\n

{Correctc}.

", "rulesets": {}, "parts": [{"prompt": "\n

Step 1: Null hypothesis

\n

If $\\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$. 

\n

Step 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

\n

Should we use the z or t test statistic? 

\n

[[0]]

\n

Now 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": "\n

Step 4:  p-value range

\n

Use tables to find a range for your p -value. 

\n

Choose 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]]

\n

Your 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

A 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'])}

\n

Perform 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(tval1,\"There is evidence to suggest that average call times for male and female employees differ\",\"There is insufficent evidence to suggest that average call times for male and female employees differ\")", "name": "correctc"}, "tval1": {"definition": "abs(m-m1)*sqrt(n1*n2)/(tpsd*sqrt(n1+n2))", "name": "tval1"}, "things": {"definition": "\"male employees\"", "name": "things"}, "m1": {"definition": "random(280..400#10)", "name": "m1"}, "tol": {"definition": 0.001, "name": "tol"}, "units": {"definition": "\"seconds\"", "name": "units"}, "pm": {"definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "name": "pm"}, "tpsd": {"definition": "sqrt(((n1-1)*sd^2+(n2-1)*sd1^2)/(n-1))", "name": "tpsd"}, "that": {"definition": "\"the average time spent on the telephone \"", "name": "that"}, "psd": {"definition": "precround(tpsd,3)", "name": "psd"}, "fac": {"definition": "if(pval<2,\"There is evidence to suggest that average call times for male and female employees differ\",\"There is insufficent evidence to suggest that average call times for male and female employees differ\")", "name": "fac"}, "confl": {"definition": "[90,95,99]", "name": "confl"}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi"}, "mm": {"definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "name": "mm"}, "dothis": {"definition": "switch(pval <2, 'retain','reject')", "name": "dothis"}, "m": {"definition": "random(220..380#10)", "name": "m"}, "dmm": {"definition": "if(pval<2,[1,0],[0,1])", "name": "dmm"}, "n": {"definition": "n1+n2-1", "name": "n"}, "this": {"definition": "\"A call centre company wants to know if there is any difference between the average time spent on the telephone, per call to customers, between male and female employees.\"", "name": "this"}, "tval": {"definition": "precround(tval1,3)", "name": "tval"}, "n1": {"definition": "random(5..15)", "name": "n1"}, "n2": {"definition": "random(20..30)-n1", "name": "n2"}, "things1": {"definition": "\"female employees\"", "name": "things1"}, "sd": {"definition": "random(55..85)", "name": "sd"}}, "metadata": {"notes": "\n \t\t

3/01/2012:

\n \t\t

Added tag sc as can be changed to other applications. Perhaps the tables used should be improved.

\n \t\t

Missing 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": []}