// Numbas version: exam_results_page_options {"name": "Harry's copy of Perform z-test for hypothesis given sample mean and population variance", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "question_groups": [{"questions": [], "pickingStrategy": "all-ordered", "name": "", "pickQuestions": 0}], "showQuestionGroupNames": false, "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"correctc": {"definition": "if(pval>1,\"There is sufficient evidence against the claim of the vending company.\",\n \"There is insufficient evidence against the claim of the vending company.\")", "group": "Ungrouped variables", "name": "correctc", "description": "", "templateType": "anything"}, "thismuch": {"definition": "random(140..160)", "group": "Ungrouped variables", "name": "thismuch", "description": "", "templateType": "anything"}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "group": "Ungrouped variables", "name": "evi", "description": "", "templateType": "anything"}, "claim": {"definition": "\"The vending machine company claims each cup should be filled with \"", "group": "Ungrouped variables", "name": "claim", "description": "", "templateType": "anything"}, "pm": {"definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "group": "Ungrouped variables", "name": "pm", "description": "", "templateType": "anything"}, "tol": {"definition": "0.001", "group": "Ungrouped variables", "name": "tol", "description": "", "templateType": "anything"}, "units": {"definition": "'ml'", "group": "Ungrouped variables", "name": "units", "description": "", "templateType": "anything"}, "zval1": {"definition": "abs(m-thismuch)*sqrt(n)/sqrt(thisvar)", "group": "Ungrouped variables", "name": "zval1", "description": "", "templateType": "anything"}, "n": {"definition": "random(50..100)", "group": "Ungrouped variables", "name": "n", "description": "", "templateType": "anything"}, "evi1": {"definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "group": "Ungrouped variables", "name": "evi1", "description": "", "templateType": "anything"}, "var": {"definition": "\"the variance of the filling process is known to be \"", "group": "Ungrouped variables", "name": "var", "description": "", "templateType": "anything"}, "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])", "group": "Ungrouped variables", "name": "mm", "description": "", "templateType": "anything"}, "pval": {"definition": "switch(zvalStep 1: Null Hypothesis

\n

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

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\lt\\;$[[1]]

\n ", "gaps": [{"maxValue": "thismuch", "type": "numberentry", "scripts": {}, "correctAnswerFraction": false, "marks": 0.5, "allowFractions": false, "minValue": "thismuch", "showCorrectAnswer": true, "showPrecisionHint": false}, {"maxValue": "thismuch", "type": "numberentry", "scripts": {}, "correctAnswerFraction": false, "marks": 0.5, "allowFractions": false, "minValue": "thismuch", "showCorrectAnswer": true, "showPrecisionHint": false}], "showCorrectAnswer": true}, {"type": "gapfill", "marks": 0, "scripts": {}, "prompt": "

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)

", "gaps": [{"showCorrectAnswer": true, "marks": 1, "checkvariablenames": false, "showpreview": true, "checkingtype": "absdiff", "expectedvariablenames": [], "type": "jme", "scripts": {}, "answer": "z", "vsetrangepoints": 5, "vsetrange": [0, 1], "checkingaccuracy": 0.001}, {"maxValue": "zval+tol", "type": "numberentry", "scripts": {}, "correctAnswerFraction": false, "marks": 1, "allowFractions": false, "minValue": "zval-tol", "showCorrectAnswer": true, "showPrecisionHint": false}], "showCorrectAnswer": true}, {"type": "gapfill", "marks": 0, "scripts": {}, "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": [{"choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "showCorrectAnswer": true, "marks": 0, "displayType": "radiogroup", "minMarks": 0, "type": "1_n_2", "scripts": {}, "matrix": "mm", "distractors": ["", "", "", ""], "shuffleChoices": false, "displayColumns": 0, "maxMarks": 0}], "showCorrectAnswer": true}, {"type": "gapfill", "marks": 0, "scripts": {}, "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": [{"choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "showCorrectAnswer": true, "marks": 0, "displayType": "radiogroup", "minMarks": 0, "type": "1_n_2", "scripts": {}, "matrix": "mm", "distractors": ["", "", "", ""], "shuffleChoices": false, "displayColumns": 0, "maxMarks": 0}, {"choices": ["Retain", "Reject"], "showCorrectAnswer": true, "marks": 0, "displayType": "radiogroup", "minMarks": 0, "type": "1_n_2", "scripts": {}, "matrix": "dmm", "distractors": ["", ""], "shuffleChoices": false, "displayColumns": 0, "maxMarks": 0}, {"choices": ["{Correctc}", "{Fac}"], "showCorrectAnswer": true, "marks": 0, "displayType": "radiogroup", "minMarks": 0, "type": "1_n_2", "scripts": {}, "matrix": [1, 0], "distractors": ["", ""], "shuffleChoices": true, "displayColumns": 0, "maxMarks": 0}], "showCorrectAnswer": true}], "name": "Harry's copy of Perform z-test for hypothesis given sample mean and population variance", "ungrouped_variables": ["claim", "var", "pval", "evi1", "crit", "zval1", "things", "tol", "units", "thismuch", "pm", "correctc", "resultis", "thisvar", "test", "zval", "fac", "confl", "evi", "mm", "dothis", "m", "dmm", "n", "this", "stand"], "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 ", "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 ", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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.

"}, "rulesets": {}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}