// Numbas version: exam_results_page_options {"name": "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": [{"metadata": {"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.
", "notes": "\n \t\t2/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", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "variables": {"things": {"definition": "\"cups is taken\"", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "things"}, "resultis": {"definition": "\"giving a mean of \"", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "resultis"}, "claim": {"definition": "\"The vending machine company claims each cup should be filled with \"", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "claim"}, "pval": {"definition": "switch(zvala)
\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 ", "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 0, "name": "", "questions": []}], "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"], "name": "Perform z-test for hypothesis given sample mean and population variance", "rulesets": {}, "preamble": {"css": "", "js": ""}, "tags": ["checked2015", "MAS1403"], "variable_groups": [], "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 ", "showQuestionGroupNames": false, "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "thismuch", "marks": 0.5, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "minValue": "thismuch"}, {"correctAnswerFraction": false, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "thismuch", "marks": 0.5, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "minValue": "thismuch"}], "prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\lt\\;$[[1]]
\n ", "scripts": {}}, {"type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"type": "jme", "showCorrectAnswer": true, "checkingaccuracy": 0.001, "checkvariablenames": false, "vsetrange": [0, 1], "showpreview": true, "expectedvariablenames": [], "marks": 1, "vsetrangepoints": 5, "checkingtype": "absdiff", "scripts": {}, "answer": "z"}, {"correctAnswerFraction": false, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "zval+tol", "marks": 1, "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "minValue": "zval-tol"}], "prompt": "Step 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)
", "scripts": {}}, {"type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"type": "1_n_2", "marks": 0, "shuffleChoices": false, "showCorrectAnswer": true, "displayType": "radiogroup", "maxMarks": 0, "matrix": "mm", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "minMarks": 0, "displayColumns": 0, "scripts": {}, "distractors": ["", "", "", ""]}], "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 ", "scripts": {}}, {"type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"type": "1_n_2", "marks": 0, "shuffleChoices": false, "showCorrectAnswer": true, "displayType": "radiogroup", "maxMarks": 0, "matrix": "mm", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "minMarks": 0, "displayColumns": 0, "scripts": {}, "distractors": ["", "", "", ""]}, {"type": "1_n_2", "marks": 0, "shuffleChoices": false, "showCorrectAnswer": true, "displayType": "radiogroup", "maxMarks": 0, "matrix": "dmm", "choices": ["Retain", "Reject"], "minMarks": 0, "displayColumns": 0, "scripts": {}, "distractors": ["", ""]}, {"type": "1_n_2", "marks": 0, "shuffleChoices": true, "showCorrectAnswer": true, "displayType": "radiogroup", "maxMarks": 0, "matrix": [1, 0], "choices": ["{Correctc}", "{Fac}"], "minMarks": 0, "displayColumns": 0, "scripts": {}, "distractors": ["", ""]}], "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 ", "scripts": {}}], "functions": {}, "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/"}]}