// Numbas version: finer_feedback_settings {"name": "Harry's copy of David's copy of 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": [{"preamble": {"css": "", "js": ""}, "functions": {}, "advice": "\n
a)
\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": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 0.5, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "thisamount", "minValue": "thisamount", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0.5, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "thisamount", "minValue": "thisamount", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "sortAnswers": false, "prompt": "\nStep 1: Null Hypothesis
\n$\\operatorname{H}_0\\;: \\; \\mu=\\;$[[0]]
\nStep 2: Alternative Hypothesis
\n$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;$[[1]]
\n ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "answer": "t", "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "unitTests": [], "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingType": "absdiff", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "showPreview": true, "failureRate": 1, "expectedVariableNames": [], "vsetRange": [0, 1], "checkVariableNames": false, "type": "jme", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "type": "numberentry", "mustBeReducedPC": 0, "maxValue": "tval+tol", "minValue": "tval-tol", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "sortAnswers": false, "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)
", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "displayType": "radiogroup", "showFeedbackIcon": true, "shuffleChoices": false, "minMarks": 0, "maxMarks": 0, "matrix": "mm", "extendBaseMarkingAlgorithm": true, "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "showCorrectAnswer": true, "displayColumns": 0}], "showFeedbackIcon": true, "sortAnswers": false, "prompt": "\nStep 4: p-value
\nUse tables to find a range for your $p$-value.
\nChoose the correct range here for $p$ : [[0]]
\n ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "gaps": [{"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "displayType": "radiogroup", "showFeedbackIcon": true, "shuffleChoices": false, "minMarks": 0, "maxMarks": 0, "matrix": "mm", "extendBaseMarkingAlgorithm": true, "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "showCorrectAnswer": true, "displayColumns": 0}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "displayType": "radiogroup", "showFeedbackIcon": true, "shuffleChoices": false, "minMarks": 0, "maxMarks": 0, "matrix": "dmm", "extendBaseMarkingAlgorithm": true, "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "choices": ["Do not reject the null hypothsis
", "Reject the null hypothesis
"], "showCorrectAnswer": true, "displayColumns": 0}, {"scripts": {}, "unitTests": [], "marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "displayType": "radiogroup", "showFeedbackIcon": true, "shuffleChoices": true, "minMarks": 0, "maxMarks": 0, "matrix": [1, 0], "extendBaseMarkingAlgorithm": true, "distractors": ["", ""], "type": "1_n_2", "variableReplacementStrategy": "originalfirst", "choices": ["{Correctc}", "{Fac}"], "showCorrectAnswer": true, "displayColumns": 0}], "showFeedbackIcon": true, "sortAnswers": false, "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 ", "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "tags": [], "rulesets": {}, "statement": "{this}
\n{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).
", "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "variables": {"this": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "\"An online flight company makes the following claim:\"", "name": "this"}, "here": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(\"Barcelona\",\"Madrid\",\"Athens\",\"Berlin\",\"Palma\",\"Rome\",\"Paris\",\"Lisbon\")", "name": "here"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(10..30)", "name": "n"}, "fac": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "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"}, "crit": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "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"}, "mm": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "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"}, "evi1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "name": "evi1"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "\"customers is taken.\"", "name": "things"}, "dothis": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "switch(pval <2, 'retain','reject')", "name": "dothis"}, "resultis": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \"", "name": "resultis"}, "tval1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "abs(m-thisamount)*sqrt(n)/stand", "name": "tval1"}, "confl": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(90,95,99)", "name": "confl"}, "dmm": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "if(pval<2,[1,0],[0,1])", "name": "dmm"}, "pval": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "switch(tvalProvided 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"}, "name": "Harry's copy of David's copy of Perform t-test for hypothesis given sample mean and standard deviation", "type": "question", "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}, {"name": "Adam Vellender", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1844/"}, {"name": "David Goulding", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2365/"}]}]}], "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}, {"name": "Adam Vellender", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1844/"}, {"name": "David Goulding", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2365/"}]}