// Numbas version: exam_results_page_options {"name": "12: Statistics - Comparing Iron Content of Two Lava Flows ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["ca", "cb", "meda", "medb", "sampvara", "sampvarb", "meana", "meanb", "similar", "popmeana", "popmeanb", "sea", "seb", "boundsa", "boundsb"], "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"}, "variable_groups": [], "tags": [], "variables": {"sampvarb": {"description": "", "name": "sampvarb", "templateType": "anything", "definition": "variance(cb)", "group": "Ungrouped variables"}, "meda": {"description": "", "name": "meda", "templateType": "anything", "definition": "median(ca)", "group": "Ungrouped variables"}, "boundsb": {"description": "", "name": "boundsb", "templateType": "anything", "definition": "[meanb-2*seb,meanb+2*seb]", "group": "Ungrouped variables"}, "meana": {"description": "", "name": "meana", "templateType": "anything", "definition": "mean(ca)", "group": "Ungrouped variables"}, "cb": {"description": "", "name": "cb", "templateType": "anything", "definition": "repeat(round(normalsample(popmeanb,3)),10)", "group": "Ungrouped variables"}, "popmeana": {"description": "", "name": "popmeana", "templateType": "anything", "definition": "9.50 + random(0..7)", "group": "Ungrouped variables"}, "sea": {"description": "", "name": "sea", "templateType": "anything", "definition": "sqrt({sampvara}*10/90)", "group": "Ungrouped variables"}, "sampvara": {"description": "", "name": "sampvara", "templateType": "anything", "definition": "variance(ca)", "group": "Ungrouped variables"}, "ca": {"description": "", "name": "ca", "templateType": "anything", "definition": "repeat(round(normalsample(popmeana,3)),10)", "group": "Ungrouped variables"}, "boundsa": {"description": "", "name": "boundsa", "templateType": "anything", "definition": "[meana - 2*sea,meana + 2*sea]", "group": "Ungrouped variables"}, "medb": {"description": "", "name": "medb", "templateType": "anything", "definition": "median(cb)", "group": "Ungrouped variables"}, "meanb": {"description": "", "name": "meanb", "templateType": "anything", "definition": "mean(cb)", "group": "Ungrouped variables"}, "seb": {"description": "", "name": "seb", "templateType": "anything", "definition": "sqrt({sampvarb}*10/90)", "group": "Ungrouped variables"}, "similar": {"description": "", "name": "similar", "templateType": "anything", "definition": "random(0,1)", "group": "Ungrouped variables"}, "popmeanb": {"description": "", "name": "popmeanb", "templateType": "anything", "definition": "popmeana + random(1..3)*(1-similar)*random(1,-1)", "group": "Ungrouped variables"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "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}}$

", "functions": {"overlaps": {"language": "javascript", "definition": "return (a[1] > b[0])&&(a[0] < b[1]);", "parameters": [["a", "list"], ["b", "list"]], "type": "boolean"}, "ordered": {"language": "javascript", "definition": "return li.sort();", "parameters": [["li", "list"]], "type": "list"}}, "parts": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "variableReplacements": [], "gaps": [{"correctAnswerStyle": "plain", "scripts": {}, "variableReplacements": [], "mustBeReducedPC": 0, "showCorrectAnswer": true, "marks": 1, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "maxValue": "{meana}+0.1", "correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showFeedbackIcon": true, "minValue": "{meana}-0.1"}, {"correctAnswerStyle": "plain", "scripts": {}, "variableReplacements": [], "mustBeReducedPC": 0, "showCorrectAnswer": true, "marks": 1, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "maxValue": "{meanb}+0.1", "correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showFeedbackIcon": true, "minValue": "{meanb}-0.1"}], "showCorrectAnswer": true, "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.

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

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

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

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

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

-

\n

.1

\n

0

\n

+

\n

You have not given your answer to the correct precision.

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

", "type": "gapfill", "marks": 0, "showFeedbackIcon": true}], "name": "12: Statistics - Comparing Iron Content of Two Lava Flows ", "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.

", "preamble": {"js": "", "css": ""}, "extensions": ["stats"], "type": "question", "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}]}]}], "contributors": [{"name": "Jean jinhua Mathias", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/353/"}]}