// Numbas version: finer_feedback_settings {"name": "Mean and mid-range", "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": "Mean and mid-range", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "
Determine the mean and mid-range of the following set of data: $\\Delta T$ / K: {data_str}.
", "advice": "Mean
\n$\\bar{\\Delta T} = \\dfrac{\\sum\\limits_{i=1}^{N} \\Delta T_i}{N}$
\nHere $N$ = {n}, and summing the data gives $\\sum\\limits_{i=1}^{N} \\Delta T_i$ = {sum_str} K.
\n$\\bar{\\Delta T}$ = {sum_str} K ÷ {n} = {correct_mean_str} K
\nThe least precise value in the data has {min_dp} decimal place(s), so the mean is reported to {min_dp} decimal place(s). If the digits being removed are exactly 5, remember to round to even.
\nMid-range
\n$\\Delta T_{\\textrm{mid-range}} = \\dfrac{\\Delta T_\\textrm{max} + \\Delta T_\\textrm{min}}{2}$
\nPutting the data in increasing order: {sorted_str}
\nSo our minimum value is {min_str} K and our maximum value is {max_str} K.
\n$\\Delta T_{\\textrm{mid-range}}$ = ({max_str} K + {min_str} K) ÷ 2 = {midrange_exact_str} K = {correct_midrange_str} K
\nOnly the maximum and minimum values are used, so the mid-range is reported to the precision of the less precise of those two values: {mid_dp} decimal place(s).
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "random(4,5)", "description": "", "templateType": "anything", "can_override": false}, "dps": {"name": "dps", "group": "Ungrouped variables", "definition": "random([2,3],[1,2,3])", "description": "", "templateType": "anything", "can_override": false}, "data_dps": {"name": "data_dps", "group": "Ungrouped variables", "definition": "repeat(random(dps), n)", "description": "", "templateType": "anything", "can_override": false}, "raw": {"name": "raw", "group": "Ungrouped variables", "definition": "map(w + random(0..999)/1000, w, shuffle(5..14)[0..n])", "description": "", "templateType": "anything", "can_override": false}, "data_strs": {"name": "data_strs", "group": "Ungrouped variables", "definition": "map(dpformat(raw[j], data_dps[j]), j, 0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "map(dec(x), x, data_strs)", "description": "", "templateType": "anything", "can_override": false}, "data_str": {"name": "data_str", "group": "Ungrouped variables", "definition": "join(data_strs, \", \")", "description": "", "templateType": "anything", "can_override": false}, "min_dp": {"name": "min_dp", "group": "Ungrouped variables", "definition": "min(data_dps)", "description": "", "templateType": "anything", "can_override": false}, "data_sum": {"name": "data_sum", "group": "Ungrouped variables", "definition": "sum(data)", "description": "", "templateType": "anything", "can_override": false}, "sum_str": {"name": "sum_str", "group": "Ungrouped variables", "definition": "string(data_sum)", "description": "", "templateType": "anything", "can_override": false}, "mean_exact": {"name": "mean_exact", "group": "Ungrouped variables", "definition": "data_sum / n", "description": "", "templateType": "anything", "can_override": false}, "correct_mean": {"name": "correct_mean", "group": "Ungrouped variables", "definition": "even_dp(mean_exact, min_dp)", "description": "", "templateType": "anything", "can_override": false}, "correct_mean_str": {"name": "correct_mean_str", "group": "Ungrouped variables", "definition": "dpformat(correct_mean, min_dp)", "description": "", "templateType": "anything", "can_override": false}, "i_min": {"name": "i_min", "group": "Ungrouped variables", "definition": "indices(data, min(data))[0]", "description": "", "templateType": "anything", "can_override": false}, "i_max": {"name": "i_max", "group": "Ungrouped variables", "definition": "indices(data, max(data))[0]", "description": "", "templateType": "anything", "can_override": false}, "min_str": {"name": "min_str", "group": "Ungrouped variables", "definition": "data_strs[i_min]", "description": "", "templateType": "anything", "can_override": false}, "max_str": {"name": "max_str", "group": "Ungrouped variables", "definition": "data_strs[i_max]", "description": "", "templateType": "anything", "can_override": false}, "mid_dp": {"name": "mid_dp", "group": "Ungrouped variables", "definition": "min(data_dps[i_min], data_dps[i_max])", "description": "", "templateType": "anything", "can_override": false}, "midrange_exact": {"name": "midrange_exact", "group": "Ungrouped variables", "definition": "(dec(max_str) + dec(min_str)) / 2", "description": "", "templateType": "anything", "can_override": false}, "midrange_exact_str": {"name": "midrange_exact_str", "group": "Ungrouped variables", "definition": "string(midrange_exact)", "description": "", "templateType": "anything", "can_override": false}, "correct_midrange": {"name": "correct_midrange", "group": "Ungrouped variables", "definition": "even_dp(midrange_exact, mid_dp)", "description": "", "templateType": "anything", "can_override": false}, "correct_midrange_str": {"name": "correct_midrange_str", "group": "Ungrouped variables", "definition": "dpformat(correct_midrange, mid_dp)", "description": "", "templateType": "anything", "can_override": false}, "items": {"name": "items", "group": "Ungrouped variables", "definition": "map([\"v\": data[k], \"s\": data_strs[k]], k, 0..n-1)", "description": "", "templateType": "anything", "can_override": false}, "sorted_str": {"name": "sorted_str", "group": "Ungrouped variables", "definition": "join(map(x[\"s\"], x, sort_by(\"v\", items)), \", \")", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "dps", "data_dps", "raw", "data_strs", "data", "data_str", "min_dp", "data_sum", "sum_str", "mean_exact", "correct_mean", "correct_mean_str", "i_min", "i_max", "min_str", "max_str", "mid_dp", "midrange_exact", "midrange_exact_str", "correct_midrange", "correct_midrange_str", "items", "sorted_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": "Determine the mean of the data.
", "minValue": "correct_mean", "maxValue": "correct_mean", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "min_dp", "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": "Determine the mid-range of the same data.
", "minValue": "correct_midrange", "maxValue": "correct_midrange", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "mid_dp", "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/"}]}