// Numbas version: exam_results_page_options {"name": "Simon'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": [{"extensions": ["stats"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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.

"}, "variable_groups": [], "variables": {"tol": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "0.001", "name": "tol"}, "m": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "thismuch-random(2..8)", "name": "m"}, "fac": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "if(pval<2,\"There is sufficient evidence against the claim of the vending company\",\n \"There is insufficient evidence against the claim of the vending company.\")", "name": "fac"}, "zval1": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "(m-thismuch)*sqrt(n)/sqrt(thisvar)", "name": "zval1"}, "this": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"A vending machine fills cups with \"", "name": "this"}, "crit": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "[1.282,1.645,2.326]", "name": "crit"}, "test": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"Customers of the vending machine suspect the machine is under-filling.\"", "name": "test"}, "resultis": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"giving a mean of \"", "name": "resultis"}, "var": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"the variance of the filling process is known to be \"", "name": "var"}, "units": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "'ml'", "name": "units"}, "evi1": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "name": "evi1"}, "dothis": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "switch(pval <2, 'retain','reject')", "name": "dothis"}, "claim": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"The vending machine company claims each cup should be filled with \"", "name": "claim"}, "dmm": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "if(pval<2,[1,0],[0,1])", "name": "dmm"}, "things": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "\"cups is taken\"", "name": "things"}, "thismuch": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(140..160)", "name": "thismuch"}, "zval": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "precround(abs(zval1),3)", "name": "zval"}, "thisvar": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(300..500#10)", "name": "thisvar"}, "pm": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "name": "pm"}, "evi": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi"}, "stand": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(15..25)", "name": "stand"}, "pval": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "switch(zval1,\"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"}, "n": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(50..100)", "name": "n"}, "confl": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(90,95,99)", "name": "confl"}}, "parts": [{"type": "gapfill", "marks": 0, "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": [{"type": "numberentry", "marks": 0.5, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "mustBeReducedPC": 0, "maxValue": "thismuch", "scripts": {}, "customName": "", "variableReplacements": [], "correctAnswerFraction": false, "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "mustBeReduced": false, "showCorrectAnswer": true, "minValue": "thismuch", "showFractionHint": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"type": "numberentry", "marks": 0.5, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "mustBeReducedPC": 0, "maxValue": "thismuch", "scripts": {}, "customName": "", "variableReplacements": [], "correctAnswerFraction": false, "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "mustBeReduced": false, "showCorrectAnswer": true, "minValue": "thismuch", "showFractionHint": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}], "scripts": {}, "customName": "", "variableReplacements": [], "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "sortAnswers": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "marks": 0, "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]] 

", "gaps": [{"type": "jme", "marks": 1, "checkVariableNames": false, "failureRate": 1, "valuegenerators": [{"value": "", "name": "z"}], "showPreview": true, "scripts": {}, "customName": "", "variableReplacements": [], "answer": "z", "vsetRangePoints": 5, "vsetRange": [0, 1], "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "showCorrectAnswer": true, "checkingAccuracy": 0.001, "checkingType": "absdiff", "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"marks": 1, "allowFractions": false, "precisionType": "dp", "mustBeReduced": false, "scripts": {}, "showCorrectAnswer": true, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": true, "type": "numberentry", "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "precision": "3", "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "customName": "", "variableReplacements": [], "unitTests": [], "customMarkingAlgorithm": "", "useCustomName": false, "maxValue": "zval1", "minValue": "zval1", "correctAnswerFraction": false, "showFeedbackIcon": true}], "scripts": {}, "customName": "", "variableReplacements": [], "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "sortAnswers": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "marks": 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": [{"type": "1_n_2", "marks": 0, "minMarks": 0, "shuffleChoices": false, "scripts": {}, "customName": "", "variableReplacements": [], "showCellAnswerState": true, "unitTests": [], "customMarkingAlgorithm": "", "maxMarks": 0, "showFeedbackIcon": true, "useCustomName": false, "displayType": "radiogroup", "showCorrectAnswer": true, "matrix": "mm", "displayColumns": 0, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"]}], "scripts": {}, "customName": "", "variableReplacements": [], "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "sortAnswers": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "marks": 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": [{"type": "1_n_2", "marks": 0, "minMarks": 0, "shuffleChoices": false, "scripts": {}, "customName": "", "variableReplacements": [], "showCellAnswerState": true, "unitTests": [], "customMarkingAlgorithm": "", "maxMarks": 0, "showFeedbackIcon": true, "useCustomName": false, "displayType": "radiogroup", "showCorrectAnswer": true, "matrix": "mm", "displayColumns": 0, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"]}, {"type": "1_n_2", "marks": 0, "minMarks": 0, "shuffleChoices": false, "scripts": {}, "customName": "", "variableReplacements": [], "showCellAnswerState": true, "unitTests": [], "customMarkingAlgorithm": "", "maxMarks": 0, "showFeedbackIcon": true, "useCustomName": false, "displayType": "radiogroup", "showCorrectAnswer": true, "matrix": "dmm", "displayColumns": 0, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "choices": ["Retain", "Reject"]}, {"type": "1_n_2", "marks": 0, "minMarks": 0, "distractors": ["", ""], "shuffleChoices": true, "scripts": {}, "customName": "", "variableReplacements": [], "showCellAnswerState": true, "unitTests": [], "customMarkingAlgorithm": "", "maxMarks": 0, "showFeedbackIcon": true, "useCustomName": false, "displayType": "radiogroup", "showCorrectAnswer": true, "matrix": [1, 0], "displayColumns": 0, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "choices": ["{Correctc}", "{Fac}"]}], "scripts": {}, "customName": "", "variableReplacements": [], "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "useCustomName": false, "sortAnswers": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "functions": {}, "name": "Simon's copy of Perform z-test for hypothesis given sample mean and population variance", "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 ", "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"], "advice": "

(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

\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{dpformat(zval1,3)}\\]

\n

to 3 decimal places.

\n

\n

(c)

\n

Since we are carrying out a 1-tailed hypothesis test (we are testing specifically for under-filling) we must use the 1-tailed critical values for the normal distribution.

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

", "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}