// Numbas version: exam_results_page_options {"name": "Statistics - Comparing Iron Content of Two Lava Flows", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"scripts": {}, "marks": 0, "gaps": [{"correctAnswerFraction": false, "minValue": "{meana}-0.1", "mustBeReduced": false, "showCorrectAnswer": true, "type": "numberentry", "showFeedbackIcon": true, "maxValue": "{meana}+0.1", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain"}, {"correctAnswerFraction": false, "minValue": "{meanb}-0.1", "mustBeReduced": false, "showCorrectAnswer": true, "type": "numberentry", "showFeedbackIcon": true, "maxValue": "{meanb}+0.1", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the mean FeO content for each sample. 

\n

Mean FeO content of sample A: [[0]] years.

\n

Mean FeO content of sample B: [[1]] years.

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}, {"scripts": {}, "marks": 0, "gaps": [{"correctAnswerFraction": false, "minValue": "{meda}", "mustBeReduced": false, "showCorrectAnswer": true, "type": "numberentry", "showFeedbackIcon": true, "maxValue": "{meda}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain"}, {"correctAnswerFraction": false, "minValue": "{medb}", "mustBeReduced": false, "showCorrectAnswer": true, "type": "numberentry", "showFeedbackIcon": true, "maxValue": "{medb}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "variableReplacements": [], "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

Determine the median FeO content for each sample. 

\n

Medain FeO content of sample A: [[0]] years

\n

Medain FeO content of sample B: [[1]] years

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}, {"scripts": {}, "marks": 0, "gaps": [{"precision": "2", "precisionPartialCredit": 0, "minValue": "{sampvara}-0.01", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{sampvara}+0.01", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "2", "precisionPartialCredit": 0, "minValue": "{sampvarb}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{sampvarb}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the variance of each sample. Give your answer to two decimal places.

\n

Sample A variance: [[0]] years2

\n

Sample B variance: [[1]] years2

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}, {"scripts": {}, "marks": 0, "gaps": [{"precision": "2", "precisionPartialCredit": 0, "minValue": "sqrt({sampvara}*10/9)", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "sqrt({sampvara}*10/9)", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "2", "precisionPartialCredit": 0, "minValue": "sqrt({sampvarb}*10/9)", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "sqrt({sampvarb}*10/9)", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate an unbiased estimate of the standard deviation of the population represented by each sample, showing the formula you use. Give your answers to 2 decimal places.

\n

\n

$\\hat s_A$ = [[0]] years

\n

$\\hat s_B$ = [[1]] years

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}, {"scripts": {}, "marks": 0, "gaps": [{"precision": "2", "precisionPartialCredit": 0, "minValue": "{sea}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{sea}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "2", "precisionPartialCredit": 0, "minValue": "{seb}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{seb}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

Determine the standard error in the mean age for the two samples. Give your answers to 2 decimal places.

\n

$SE_A$ = [[0]] years

\n

$SE_B$ = [[1]] years

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}, {"scripts": {}, "marks": 0, "gaps": [{"precision": "1", "precisionPartialCredit": 0, "minValue": "{boundsa[0]}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{boundsa[0]}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "1", "precisionPartialCredit": 0, "minValue": "{boundsa[1]}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{boundsa[1]}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "

-

\n

.1

\n

0

\n

+

\n

You have not given your answer to the correct precision.

", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "1", "precisionPartialCredit": 0, "minValue": "{boundsb[0]}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{boundsb[0]}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}, {"precision": "1", "precisionPartialCredit": 0, "minValue": "{boundsb[1]}", "variableReplacements": [], "showCorrectAnswer": true, "strictPrecision": true, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "type": "numberentry", "maxValue": "{boundsb[1]}", "mustBeReducedPC": 0, "allowFractions": false, "marks": 1, "mustBeReduced": false, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "scripts": {}, "correctAnswerStyle": "plain", "showPrecisionHint": false, "correctAnswerFraction": false}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "prompt": "

State, with reasons, whether you would be justified in assuming that the lava flows that produced the two outcrops were active at the same time.

\n

Construct a 95% confidence interval for the population mean age of charcoals A and B to 1 decimal places.

\n

95% confidence interval for the population mean, $\\mu_A$, of Charcoal A: [[0]] $< \\mu_A <$ [[1]]

\n

95% confidence interval for the population mean, $\\mu_B$, of Charcoal B:  [[2]]$< \\mu_B <$ [[3]]

\n

Now you can compare the means and intervals to justify whether the lava flows were active from the same time.

\n

", "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill"}], "advice": "

a) We use the formula for the mean. In our case we have $N$ = 10 since we have 10 measurements for each charcoal sample. We find the total for sample A to be {meana*10} and the total for sample B to be {meanb*10}. All that remains is to divide each by $N$ = 10.

\n

b) We first order each list of measurements (ascending or descending order will do!).

\n

charcoal A measurements = {ordered(ca)}

\n

charcoal B measurements = {ordered(cb)}

\n

Since we have 10 measurements, the medians lie between the fifth and sixth values in our ordered lists. To calculate them we simply take the average of those respective values:

\n

Median of A = $\\frac{\\var{ordered(ca)[4]} + \\var{ordered(ca)[5]}}{2} = \\var{meda}$

\n

Median of B = $\\frac{\\var{ordered(cb)[4]} + \\var{ordered(cb)[5]}}{2} = \\var{medb}$

\n

c) We use either form of the formula for the sample variance. Here we will use the simpler form which requires us to first calculate the sum of squared measurements for each sample. (Make sure you understand and can apply these useful formulae before the exam!)

\n

Sample A variance = $\\overline {x^2 }- \\bar x^2 = \\frac{\\var{sumsqrd(ca)}}{10} - \\var{meana}^2 = \\var{sampvara}$

\n

Sample B variance = $\\overline {x^2 }- \\bar x^2 = \\frac{\\var{sumsqrd(cb)}}{10} - \\var{meanb}^2 = \\var{sampvarb}$

\n

d) We note that we are asked for the standard deviation, not the variance, so we will need to take a square root at some point. We want to obtain $\\hat s$, so we take the square root of the given formula for the unbiased estimate of population variance: $\\hat s =\\sqrt{ s^2\\frac{N}{N-1}}$. We now plug in our previously calculated values of the sample variance, $s^2$, and round to 2 decimal places:

\n

$\\hat s_A = \\sqrt{\\var{sampvara}\\times\\frac{10}{9}} = \\var{sqrt({sampvara}*10/9)} =\\var{precround(sqrt({sampvara}*10/9),2)} $

\n

$\\hat s_B = \\sqrt{\\var{sampvarb}\\times\\frac{10}{9}} = \\var{sqrt({sampvarb}*10/9)}=\\var{precround(sqrt({sampvarb}*10/9),2)} $

\n

e) We use the formula for the standard error in the mean. We calculated the values of $\\hat s$ in part d), so all that is left to do is to divide these values by $\\sqrt{10}$.

\n

$SE_A = \\var{sqrt({sampvara}*1/9)} =\\var{precround(sqrt({sampvara}*1/9),2)} $

\n

$SE_B = \\var{sqrt({sampvarb}*1/9)}=\\var{precround(sqrt({sampvarb}*1/9),2)} $

\n

(You might have a slightly different answer if you have used the rounded value from part d). It is good practice to use the unrounded values in later calculations unless directed otherwise. You can make this easier by storing the previous answers in your calculator's memory. If you do not know how to do this, please follow the link to see a 30-second tutorial: https://vimeo.com/101615630)

\n

f) We need to use the statistics we have just calculated to form a conclusion. 

\n

95% confidence intervals.

\n

For $\\mu_A$: $\\bar x_A \\pm 2 SE_A = \\var{meana} \\pm2\\times\\var{sea}$

\n

$\\var{precround(boundsa[0],1)}< \\mu_A < \\var{precround(boundsa[1],1)}$

\n

For $\\mu_B$: $\\bar x_B \\pm 2 SE_B = \\var{meanb} \\pm2\\times\\var{seb}$

\n

$\\var{precround(boundsb[0],1)}< \\mu_B < \\var{precround(boundsb[1],1)}$

\n

Since these intervals do not overlap, we have insufficient evidence to suggest that the population mean ages are different at a 5% level of significance (as they are not more than 2 standard errors apart from each other).

\n

Also, the standard errors in the mean ages are quite small. This suggests that the measurements which we are given in the table are representative of the true ages of charcoal A and B, so we are more convinced by our conclusion drawn from the comparison of the confidence intervals.

\n

Taking all of this into account, we interpret our previous conclusion that the population mean ages are not different at a 5% level of significance by saying that we would be justified in assuming the lava flows that produced the two outcrops were active at the same time.

\n

Taking all of this into account, we interpret our previous conclusion that the population mean ages are different at a 5% level of significance by saying that we would not be justified in assuming the lava flows that produced the two outcrops were active at the same time.

\n

Note: the marking of this question does not take into account the size of the overlap of the confidence intervals, just whether or not they actually overlap. If the size of the overlap turns out to be quite small (compared to the sizes of the standard errors) then the conclusion we should make (if any) is a bit more ambiguous. This question uses randomly generated values; in an exam situation the values will most likely be chosen so that their 95% confidence intervals for their population means clearly either do or do not overlap. For example, in the 2015 paper the 95% confidence interval for the population mean of charcoal B lies completely inside that of charcoal A, so there is no ambiguity.

", "variable_groups": [], "ungrouped_variables": ["ca", "cb", "meda", "medb", "sampvara", "sampvarb", "meana", "meanb", "similar", "popmeana", "popmeanb", "sea", "seb", "boundsa", "boundsb"], "rulesets": {}, "name": "Statistics - Comparing Iron Content of Two Lava Flows", "extensions": ["stats"], "tags": [], "type": "question", "metadata": {"description": "

Calculate statistics from a table of unpaired data and conclude whether or not they are from the same underlying population and interpret the result.

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"ordered": {"parameters": [["li", "list"]], "definition": "return li.sort();", "type": "list", "language": "javascript"}, "overlaps": {"parameters": [["a", "list"], ["b", "list"]], "definition": "return (a[1] > b[0])&&(a[0] < b[1]);", "type": "boolean", "language": "javascript"}}, "variables": {"popmeana": {"templateType": "anything", "name": "popmeana", "definition": "9.50 + random(0..7)", "description": "", "group": "Ungrouped variables"}, "sampvara": {"templateType": "anything", "name": "sampvara", "definition": "variance(ca)", "description": "", "group": "Ungrouped variables"}, "meana": {"templateType": "anything", "name": "meana", "definition": "mean(ca)", "description": "", "group": "Ungrouped variables"}, "seb": {"templateType": "anything", "name": "seb", "definition": "sqrt({sampvarb}*10/90)", "description": "", "group": "Ungrouped variables"}, "ca": {"templateType": "anything", "name": "ca", "definition": "repeat(round(normalsample(popmeana,3)),10)", "description": "", "group": "Ungrouped variables"}, "sea": {"templateType": "anything", "name": "sea", "definition": "sqrt({sampvara}*10/90)", "description": "", "group": "Ungrouped variables"}, "meda": {"templateType": "anything", "name": "meda", "definition": "median(ca)", "description": "", "group": "Ungrouped variables"}, "boundsb": {"templateType": "anything", "name": "boundsb", "definition": "[meanb-2*seb,meanb+2*seb]", "description": "", "group": "Ungrouped variables"}, "medb": {"templateType": "anything", "name": "medb", "definition": "median(cb)", "description": "", "group": "Ungrouped variables"}, "similar": {"templateType": "anything", "name": "similar", "definition": "random(0,1)", "description": "", "group": "Ungrouped variables"}, "boundsa": {"templateType": "anything", "name": "boundsa", "definition": "[meana - 2*sea,meana + 2*sea]", "description": "", "group": "Ungrouped variables"}, "cb": {"templateType": "anything", "name": "cb", "definition": "repeat(round(normalsample(popmeanb,3)),10)", "description": "", "group": "Ungrouped variables"}, "popmeanb": {"templateType": "anything", "name": "popmeanb", "definition": "popmeana + random(1..3)*(1-similar)*random(1,-1)", "description": "", "group": "Ungrouped variables"}, "sampvarb": {"templateType": "anything", "name": "sampvarb", "definition": "variance(cb)", "description": "", "group": "Ungrouped variables"}, "meanb": {"templateType": "anything", "name": "meanb", "definition": "mean(cb)", "description": "", "group": "Ungrouped variables"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

The following table presents two samples of the iron content of two lava flows A and B, measured as percent iron oxide (FeO).

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FeO content of A (%)FeO content of B (%)
{ca[0]}{cb[0]}
{ca[1]}{cb[1]}
{ca[2]}{cb[2]}
{ca[3]}{cb[3]}
{ca[4]}{cb[4]}
{ca[5]}{cb[5]}
{ca[6]}{cb[6]}
{ca[7]}{cb[7]}
{ca[8]}{cb[8]}
{ca[9]}{cb[9]}
\n

Useful formulae

\n

For $N$ measurements, $x_i$, $i = 1,2,3,...,N$

\n

mean, $\\bar x = \\frac{1}{N}\\sum\\limits_{i=1}^{N}x_i$

\n

sample variance, $s^2 = \\frac{1}{N}\\big(\\sum\\limits_{i=1}^{N}(x_i - \\bar x)^2\\big) = \\overline {x^2} - \\bar x^2$

\n

unbiased estimate of population variance, $\\hat s^2 = \\frac{N}{N-1} s^2$

\n

standard deviation is the square root of variance.

\n

standard error in the mean, $SE = \\frac{\\hat s}{\\sqrt{N}}$

", "preamble": {"css": "", "js": ""}, "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}