// Numbas version: finer_feedback_settings {"name": "Adjusting the mean to match the standard error", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Adjusting the mean to match the standard error", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

A sample was measured {n} times and the mean was calculated to be {mean_val_str}, with a standard deviation of {s_str}.

", "advice": "

First we need to calculate the standard error: $\\sigma_{\\bar{x}} = \\dfrac{s}{\\sqrt{n}}$

Our sample standard deviation, $s$ = {s_str} and our number of measurements, $n$ = {n}.

$\\sigma_{\\bar{x}}$ = {s_str} / square root of {n} = {se_exact_str}, which needs to be rounded up to just one significant figure:

$\\sigma_{\\bar{x}}$ = {se_roundedup_str}.

Our uncertainty is {se_roundedup_str}, so we should adjust the precision of our mean, {mean_val_str}, to match.

$\\bar{x}$ = {mean_adjusted_str}.

Again, this might not feel right, but we should never be reporting values to an unrealistically high precision, as this precision is our first indication of our confidence in the mean.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"mean_val_str": {"name": "mean_val_str", "group": "Ungrouped variables", "definition": "dpformat(mean_val, dp_mean)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(3,6)", "description": "", "templateType": "anything", "can_override": false}, "s_str": {"name": "s_str", "group": "Ungrouped variables", "definition": "dpformat(s, 2)", "description": "", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(10..599)/100", "description": "", "templateType": "anything", "can_override": false}, "dp_mean": {"name": "dp_mean", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "templateType": "anything", "can_override": false}, "mean_val": {"name": "mean_val", "group": "Ungrouped variables", "definition": "random(10..299) + random(0..(10^dp_mean-1))/10^dp_mean", "description": "", "templateType": "anything", "can_override": false}, "se_exact": {"name": "se_exact", "group": "Ungrouped variables", "definition": "s / sqrt(n)", "description": "", "templateType": "anything", "can_override": false}, "se_exact_str": {"name": "se_exact_str", "group": "Ungrouped variables", "definition": "dpformat(se_exact, 4)", "description": "", "templateType": "anything", "can_override": false}, "magnitude": {"name": "magnitude", "group": "Ungrouped variables", "definition": "10^floor(log(se_exact))", "description": "", "templateType": "anything", "can_override": false}, "se_roundedup": {"name": "se_roundedup", "group": "Ungrouped variables", "definition": "ceil(se_exact/magnitude - 0.0000001)*magnitude", "description": "", "templateType": "anything", "can_override": false}, "dp_se": {"name": "dp_se", "group": "Ungrouped variables", "definition": "max(0, -floor(log(se_roundedup)))", "description": "", "templateType": "anything", "can_override": false}, "se_roundedup_str": {"name": "se_roundedup_str", "group": "Ungrouped variables", "definition": "dpformat(se_roundedup, dp_se)", "description": "", "templateType": "anything", "can_override": false}, "mean_adjusted": {"name": "mean_adjusted", "group": "Ungrouped variables", "definition": "even_dp(dec(mean_val_str), dp_se)", "description": "", "templateType": "anything", "can_override": false}, "mean_adjusted_str": {"name": "mean_adjusted_str", "group": "Ungrouped variables", "definition": "dpformat(mean_adjusted, dp_se)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["mean_val_str", "n", "s_str", "s", "dp_mean", "mean_val", "se_exact", "se_exact_str", "magnitude", "se_roundedup", "dp_se", "se_roundedup_str", "mean_adjusted", "mean_adjusted_str"], "variable_groups": [], "functions": {"even_sf": {"parameters": [["x", "decimal"], ["n", "number"]], "type": "decimal", "language": "javascript", "definition": "// Round x to n significant figures, rounding a tie (exactly 5) to the even digit\nreturn new Numbas.math.ComplexDecimal(x.re.toSignificantDigits(n, Decimal.ROUND_HALF_EVEN));"}, "even_dp": {"parameters": [["x", "decimal"], ["n", "number"]], "type": "decimal", "language": "javascript", "definition": "// Round x to n decimal places, rounding a tie (exactly 5) to the even digit\nreturn new Numbas.math.ComplexDecimal(x.re.toDecimalPlaces(n, Decimal.ROUND_HALF_EVEN));"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Calculate the standard error.

", "minValue": "se_roundedup", "maxValue": "se_roundedup", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "sigfig", "precision": "1", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Given a mean of {mean_val_str}, adjust it to match the precision of the standard error you just calculated.

", "minValue": "mean_adjusted", "maxValue": "mean_adjusted", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "dp_se", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "showAllParts": false, "contributors": [{"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}, {"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/38947/"}], "resources": []}]}], "contributors": [{"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2415/"}, {"name": "Ed Southwood", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/38947/"}]}