// Numbas version: finer_feedback_settings {"name": "Perform t-test for hypothesis given sample mean and standard deviation", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": ["stats"], "preamble": {"css": "", "js": ""}, "name": "Perform t-test for hypothesis given sample mean and standard deviation", "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"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"}, "rulesets": {}, "variables": {"dmm": {"group": "Ungrouped variables", "definition": "if(pval<2,[1,0],[0,1])", "name": "dmm", "templateType": "anything", "description": ""}, "resultis": {"group": "Ungrouped variables", "definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \"", "name": "resultis", "templateType": "anything", "description": ""}, "confl": {"group": "Ungrouped variables", "definition": "random(90,95,99)", "name": "confl", "templateType": "anything", "description": ""}, "here": {"group": "Ungrouped variables", "definition": "random(\"Barcelona\",\"Madrid\",\"Athens\",\"Berlin\",\"Palma\",\"Rome\",\"Paris\",\"Lisbon\")", "name": "here", "templateType": "anything", "description": ""}, "things": {"group": "Ungrouped variables", "definition": "\"customers is taken.\"", "name": "things", "templateType": "anything", "description": ""}, "n": {"group": "Ungrouped variables", "definition": "random(10..30)", "name": "n", "templateType": "anything", "description": ""}, "evi": {"group": "Ungrouped variables", "definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "name": "evi", "templateType": "anything", "description": ""}, "test": {"group": "Ungrouped variables", "definition": "\"A rival flight company decides to test their claim.\"", "name": "test", "templateType": "anything", "description": ""}, "fac": {"group": "Ungrouped variables", "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", "templateType": "anything", "description": ""}, "stand": {"group": "Ungrouped variables", "definition": "random(15..25)", "name": "stand", "templateType": "anything", "description": ""}, "tval1": {"group": "Ungrouped variables", "definition": "abs(m-thisamount)*sqrt(n)/stand", "name": "tval1", "templateType": "anything", "description": ""}, "dothis": {"group": "Ungrouped variables", "definition": "switch(pval <2, 'retain','reject')", "name": "dothis", "templateType": "anything", "description": ""}, "correctc": {"group": "Ungrouped variables", "definition": "if(pval>1,\"There is sufficient evidence against the claim of the flight company.\",\"There is insufficient evidence against the claim of the flight company.\")", "name": "correctc", "templateType": "anything", "description": ""}, "pm": {"group": "Ungrouped variables", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "name": "pm", "templateType": "anything", "description": ""}, "m": {"group": "Ungrouped variables", "definition": "thisamount+random(1..15)", "name": "m", "templateType": "anything", "description": ""}, "thisamount": {"group": "Ungrouped variables", "definition": "random(70..90)", "name": "thisamount", "templateType": "anything", "description": ""}, "tval": {"group": "Ungrouped variables", "definition": "precround(tval1,3)", "name": "tval", "templateType": "anything", "description": ""}, "mm": {"group": "Ungrouped variables", "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", "templateType": "anything", "description": ""}, "this": {"group": "Ungrouped variables", "definition": "\"An online flight company makes the following claim:\"", "name": "this", "templateType": "anything", "description": ""}, "evi1": {"group": "Ungrouped variables", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "name": "evi1", "templateType": "anything", "description": ""}, "crit": {"group": "Ungrouped variables", "definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "name": "crit", "templateType": "anything", "description": ""}, "claim": {"group": "Ungrouped variables", "definition": "\"The average cost of a flight with us to \"+ here + \" is just \u00a3\" + {thisamount} + \" (including all taxes and charges!)\"", "name": "claim", "templateType": "anything", "description": ""}, "pval": {"group": "Ungrouped variables", "definition": "switch(tval{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": [], "ungrouped_variables": ["claim", "pval", "evi1", "crit", "tval1", "things", "stand", "tol", "test", "pm", "correctc", "resultis", "here", "fac", "confl", "evi", "this", "dothis", "m", "dmm", "n", "mm", "thisamount", "tval"], "functions": {}, "advice": "\na)
\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 ", "parts": [{"scripts": {}, "gaps": [{"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "maxValue": "thisamount", "allowFractions": false, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "minValue": "thisamount", "scripts": {}, "mustBeReducedPC": 0, "type": "numberentry", "showFeedbackIcon": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "variableReplacements": [], "marks": 0.5}, {"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "maxValue": "thisamount", "allowFractions": false, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "minValue": "thisamount", "scripts": {}, "mustBeReducedPC": 0, "type": "numberentry", "showFeedbackIcon": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "variableReplacements": [], "marks": 0.5}], "type": "gapfill", "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;$[[1]]
\n "}, {"scripts": {}, "gaps": [{"checkingaccuracy": 0.001, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "answer": "t", "scripts": {}, "checkingtype": "absdiff", "type": "jme", "showpreview": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "vsetrangepoints": 5, "checkvariablenames": false, "vsetrange": [0, 1]}, {"notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "maxValue": "tval+tol", "allowFractions": false, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "minValue": "tval-tol", "scripts": {}, "mustBeReducedPC": 0, "type": "numberentry", "showFeedbackIcon": true, "showCorrectAnswer": true, "correctAnswerStyle": "plain", "variableReplacements": [], "marks": 1}], "type": "gapfill", "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "variableReplacementStrategy": "originalfirst", "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": {}, "gaps": [{"displayColumns": 0, "shuffleChoices": false, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "minMarks": 0, "scripts": {}, "type": "1_n_2", "showFeedbackIcon": true, "showCorrectAnswer": true, "displayType": "radiogroup", "variableReplacements": [], "marks": 0, "matrix": "mm", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"]}], "type": "gapfill", "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "\nStep 4: p-value
\nUse tables to find a range for your $p$-value.
\nChoose the correct range here for $p$ : [[0]]
\n "}, {"scripts": {}, "gaps": [{"displayColumns": 0, "shuffleChoices": false, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "minMarks": 0, "scripts": {}, "type": "1_n_2", "showFeedbackIcon": true, "showCorrectAnswer": true, "displayType": "radiogroup", "variableReplacements": [], "marks": 0, "matrix": "mm", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"]}, {"displayColumns": 0, "shuffleChoices": false, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "minMarks": 0, "scripts": {}, "type": "1_n_2", "showFeedbackIcon": true, "showCorrectAnswer": true, "displayType": "radiogroup", "variableReplacements": [], "marks": 0, "matrix": "dmm", "choices": ["Do not reject the null hypothsis
", "Reject the null hypothesis
"]}, {"displayColumns": 0, "shuffleChoices": true, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "distractors": ["", ""], "minMarks": 0, "scripts": {}, "type": "1_n_2", "showFeedbackIcon": true, "showCorrectAnswer": true, "displayType": "radiogroup", "variableReplacements": [], "marks": 0, "matrix": [1, 0], "choices": ["{Correctc}", "{Fac}"]}], "type": "gapfill", "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "variableReplacementStrategy": "originalfirst", "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 "}], "type": "question", "contributors": [{"name": "Adam Vellender", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1844/"}]}]}], "contributors": [{"name": "Adam Vellender", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1844/"}]}