// Numbas version: finer_feedback_settings {"name": "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": [{"name": "David's copy of Perform t-test for hypothesis given sample mean and standard deviation", "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "maxValue": "thisamount", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "minValue": "thisamount", "variableReplacements": [], "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "marks": 0.5, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "maxValue": "thisamount", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "minValue": "thisamount", "variableReplacements": [], "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "marks": 0.5, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "prompt": "\n

Step 1: Null Hypothesis

\n

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

\n

Step 2: Alternative Hypothesis

\n

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

\n ", "type": "gapfill", "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "showPreview": true, "checkingType": "absdiff", "checkVariableNames": false, "vsetRangePoints": 5, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "t", "vsetRange": [0, 1], "type": "jme", "variableReplacements": [], "failureRate": 1, "customMarkingAlgorithm": "", "marks": 1, "unitTests": [], "expectedVariableNames": [], "showFeedbackIcon": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "mustBeReduced": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "maxValue": "tval+tol", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "minValue": "tval-tol", "variableReplacements": [], "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "marks": 1, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "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)

", "type": "gapfill", "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "displayColumns": 0, "maxMarks": 0, "minMarks": 0, "matrix": "mm", "type": "1_n_2", "showFeedbackIcon": true, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "shuffleChoices": false, "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "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 ", "type": "gapfill", "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "gaps": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "displayColumns": 0, "maxMarks": 0, "minMarks": 0, "matrix": "mm", "type": "1_n_2", "showFeedbackIcon": true, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "shuffleChoices": false, "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "displayColumns": 0, "maxMarks": 0, "minMarks": 0, "matrix": "dmm", "type": "1_n_2", "showFeedbackIcon": true, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "shuffleChoices": false, "choices": ["

Do not reject the null hypothsis

", "

Reject the null hypothesis

"], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "displayColumns": 0, "maxMarks": 0, "minMarks": 0, "distractors": ["", ""], "matrix": [1, 0], "type": "1_n_2", "showFeedbackIcon": true, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "shuffleChoices": true, "choices": ["{Correctc}", "{Fac}"], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true}], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "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 ", "type": "gapfill", "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "unitTests": [], "showFeedbackIcon": true, "showCorrectAnswer": true}], "preamble": {"js": "", "css": ""}, "variable_groups": [], "rulesets": {}, "advice": "\n

a)

\n

Step 1: Null Hypothesis

\n

$\\operatorname{H}_0\\;: \\; \\mu=\\;\\var{thisamount}$

\n

Step 2: Alternative Hypothesis

\n

$\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$

\n

b)

\n

We should use the t statistic as the population variance is unknown.

\n

The test statistic:

\n

\\[t =\\frac{ |\\var{m} -\\var{thisamount}|} {\\sqrt{\\frac{\\var{stand} ^ 2 }{\\var{n}}}} = \\var{tval}\\]

\n

to 3 decimal places.

\n

c)

\n

As  $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%'])}

\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 ", "tags": [], "extensions": ["stats"], "variables": {"tol": {"description": "", "name": "tol", "templateType": "anything", "group": "Ungrouped variables", "definition": "0.001"}, "mm": {"description": "", "name": "mm", "templateType": "anything", "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])"}, "test": {"description": "", "name": "test", "templateType": "anything", "group": "Ungrouped variables", "definition": "\"A rival flight company decides to test their claim.\""}, "pm": {"description": "", "name": "pm", "templateType": "anything", "group": "Ungrouped variables", "definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]"}, "dmm": {"description": "", "name": "dmm", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(pval<2,[1,0],[0,1])"}, "pval": {"description": "", "name": "pval", "templateType": "anything", "group": "Ungrouped variables", "definition": "switch(tval1,\"There is sufficient evidence against the claim of the flight company.\",\"There is insufficient evidence against the claim of the flight company.\")"}, "tval": {"description": "", "name": "tval", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tval1,3)"}, "confl": {"description": "", "name": "confl", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(90,95,99)"}, "crit": {"description": "", "name": "crit", "templateType": "anything", "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)])"}, "claim": {"description": "", "name": "claim", "templateType": "anything", "group": "Ungrouped variables", "definition": "\"The average cost of a flight with us to \"+ here + \" is just \u20ac\" + {thisamount} + \" (including all taxes and charges!)\""}, "fac": {"description": "", "name": "fac", "templateType": "anything", "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.\")"}, "evi1": {"description": "", "name": "evi1", "templateType": "anything", "group": "Ungrouped variables", "definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]"}, "thisamount": {"description": "", "name": "thisamount", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(70..90)"}, "resultis": {"description": "", "name": "resultis", "templateType": "anything", "group": "Ungrouped variables", "definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \""}}, "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"}, "functions": {}, "statement": "

{this} 

\n

{claim}

\n

{test}

\n

A sample of {n} {things}

\n

{resultis} €{m} with a standard  deviation of €{stand}.

\n

Perform an appropriate hypothesis test to see if the claim made by the online flight company is substantiated (use a two-tailed test).

", "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"], "type": "question", "contributors": [{"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": "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/"}]}