// Numbas version: exam_results_page_options {"name": "Simon'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": [{"rulesets": {}, "name": "Simon's copy of Perform t-test for hypothesis given sample mean and standard deviation", "parts": [{"marks": 0, "scripts": {}, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"marks": 0.5, "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "allowFractions": false, "mustBeReducedPC": 0, "showFeedbackIcon": true, "minValue": "thisamount", "type": "numberentry", "showFractionHint": true, "correctAnswerStyle": "plain", "customName": "", "unitTests": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "maxValue": "thisamount", "customMarkingAlgorithm": ""}, {"marks": 0.5, "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "allowFractions": false, "mustBeReducedPC": 0, "showFeedbackIcon": true, "minValue": "thisamount", "type": "numberentry", "showFractionHint": true, "correctAnswerStyle": "plain", "customName": "", "unitTests": [], "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "maxValue": "thisamount", "customMarkingAlgorithm": ""}], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": 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 ", "customMarkingAlgorithm": ""}, {"marks": 0, "scripts": {}, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"marks": 1, "scripts": {}, "checkingType": "absdiff", "variableReplacements": [], "showCorrectAnswer": true, "checkVariableNames": false, "vsetRange": [0, 1], "showFeedbackIcon": true, "vsetRangePoints": 5, "type": "jme", "checkingAccuracy": 0.001, "valuegenerators": [{"name": "t", "value": ""}], "customName": "", "unitTests": [], "answer": "t", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "showPreview": true, "failureRate": 1, "customMarkingAlgorithm": ""}, {"scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "strictPrecision": false, "allowFractions": false, "customName": "", "mustBeReduced": false, "maxValue": "tval", "marks": 1, "minValue": "tval", "customMarkingAlgorithm": "", "showPrecisionHint": true, "showFeedbackIcon": true, "precisionType": "dp", "precision": "3", "type": "numberentry", "precisionPartialCredit": 0, "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "correctAnswerFraction": false}], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": 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]]

", "customMarkingAlgorithm": ""}, {"marks": 0, "scripts": {}, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"marks": 0, "scripts": {}, "maxMarks": 0, "shuffleChoices": false, "variableReplacements": [], "showCellAnswerState": true, "showCorrectAnswer": true, "minMarks": 0, "displayColumns": 0, "showFeedbackIcon": true, "type": "1_n_2", "choices": ["{pm[0]}", "{pm[1]}", "{pm[2]}", "{pm[3]}"], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "matrix": "mm", "displayType": "radiogroup", "customMarkingAlgorithm": ""}], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": 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 ", "customMarkingAlgorithm": ""}, {"marks": 0, "scripts": {}, "sortAnswers": false, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "gaps": [{"marks": 0, "scripts": {}, "maxMarks": 0, "shuffleChoices": false, "variableReplacements": [], "showCellAnswerState": true, "showCorrectAnswer": true, "minMarks": 0, "displayColumns": 0, "showFeedbackIcon": true, "type": "1_n_2", "choices": ["{evi[0]}", "{evi[1]}", "{evi[2]}", "{evi[3]}"], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "matrix": "mm", "displayType": "radiogroup", "customMarkingAlgorithm": ""}, {"marks": 0, "scripts": {}, "maxMarks": 0, "shuffleChoices": false, "variableReplacements": [], "showCellAnswerState": true, "showCorrectAnswer": true, "minMarks": 0, "displayColumns": 0, "showFeedbackIcon": true, "type": "1_n_2", "choices": ["Retain", "Reject"], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "matrix": "dmm", "displayType": "radiogroup", "customMarkingAlgorithm": ""}, {"marks": 0, "scripts": {}, "maxMarks": 0, "shuffleChoices": true, "variableReplacements": [], "showCellAnswerState": true, "showCorrectAnswer": true, "minMarks": 0, "distractors": ["", ""], "displayColumns": 0, "showFeedbackIcon": true, "type": "1_n_2", "choices": ["{Correctc}", "{Fac}"], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "matrix": [1, 0], "displayType": "radiogroup", "customMarkingAlgorithm": ""}], "customName": "", "unitTests": [], "variableReplacementStrategy": "originalfirst", "useCustomName": 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 ", "customMarkingAlgorithm": ""}], "functions": {}, "tags": [], "preamble": {"css": "", "js": ""}, "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"], "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["stats"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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.

"}, "advice": "

(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

\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

\n

(c)

\n

As  $n=\\var{n}$ we use the $t_{\\var{n-1}}$ tables. Remember we require the 2-tailed critical values since our alternative hypothesis $\\operatorname{H}_1\\;: \\; \\mu \\neq\\;\\var{thisamount}$ is looking at $\\neq$ rather than < or >. 

\n

\n

Recall that for the $p\\%$ two-tailed critical value we look at the $1-p/2$ one-tailed probability, e.g. for the 5% critical value we look at t-value for a one-tailed probability of $1-0.05/2 = 0.975$ 

\n

\n

We have the following data from the tables:

\n

{table([['1-p/2',0.95,0.975,0.995],['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}

", "statement": "\n

{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).

\n ", "variables": {"evi1": {"definition": "[\"no\",\"slight\",\"moderate\",\"strong\"]", "templateType": "anything", "group": "Ungrouped variables", "name": "evi1", "description": ""}, "claim": {"definition": "\"The average cost of a flight with us to \"+ here + \" is just \u00a3\" + {thisamount} + \" (including all taxes and charges!)\"", "templateType": "anything", "group": "Ungrouped variables", "name": "claim", "description": ""}, "here": {"definition": "random(\"Barcelona\",\"Madrid\",\"Athens\",\"Berlin\",\"Palma\",\"Rome\",\"Paris\",\"Lisbon\")", "templateType": "anything", "group": "Ungrouped variables", "name": "here", "description": ""}, "this": {"definition": "\"An online flight company makes the following claim:\"", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "test": {"definition": "\"A travel magazine decides to test their claim.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "test", "description": ""}, "evi": {"definition": "[\"None\",\"Slight\",\"Moderate\",\"Strong\"]", "templateType": "anything", "group": "Ungrouped variables", "name": "evi", "description": ""}, "tval1": {"definition": "(m-thisamount)*sqrt(n)/stand", "templateType": "anything", "group": "Ungrouped variables", "name": "tval1", "description": ""}, "m": {"definition": "thisamount+random(1..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "things": {"definition": "\"customers is taken.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "things", "description": ""}, "thisamount": {"definition": "random(70..90)", "templateType": "anything", "group": "Ungrouped variables", "name": "thisamount", "description": ""}, "stand": {"definition": "random(15..25)", "templateType": "anything", "group": "Ungrouped variables", "name": "stand", "description": ""}, "tval": {"definition": "precround(abs(tval1),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "tval", "description": ""}, "n": {"definition": "random(10..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "n", "description": ""}, "resultis": {"definition": "\"The mean cost of a flight to \"+ here + \" from this sample is \"", "templateType": "anything", "group": "Ungrouped variables", "name": "resultis", "description": ""}, "fac": {"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.\")", "templateType": "anything", "group": "Ungrouped variables", "name": "fac", "description": ""}, "correctc": {"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.\")", "templateType": "anything", "group": "Ungrouped variables", "name": "correctc", "description": ""}, "dothis": {"definition": "switch(pval <2, 'retain','reject')", "templateType": "anything", "group": "Ungrouped variables", "name": "dothis", "description": ""}, "confl": {"definition": "random(90,95,99)", "templateType": "anything", "group": "Ungrouped variables", "name": "confl", "description": ""}, "crit": {"definition": "map(precround(x,3),x,[studenttinv((90+100)/200,n-1),studenttinv((95+100)/200,n-1),studenttinv((99+100)/200,n-1)])", "templateType": "anything", "group": "Ungrouped variables", "name": "crit", "description": ""}, "pm": {"definition": "[\"is greater than 10%\",\"lies between 5% and 10%\",\"lies between 1% and 5%\",\"is less than 1%\"]", "templateType": "anything", "group": "Ungrouped variables", "name": "pm", "description": ""}, "mm": {"definition": "switch(pval=0,[1,0,0,0],pval=1,[0,1,0,0],pval=2,[0,0,1,0],[0,0,0,1])", "templateType": "anything", "group": "Ungrouped variables", "name": "mm", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "dmm": {"definition": "if(pval<2,[1,0],[0,1])", "templateType": "anything", "group": "Ungrouped variables", "name": "dmm", "description": ""}, "pval": {"definition": "switch(tval