// Numbas version: finer_feedback_settings {"name": "Find quartiles, range and interquartile range of small sample", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"sig": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(4..9)", "description": "", "name": "sig"}, "r1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sort(r0)", "description": "", "name": "r1"}, "median": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.5*(r1[15]+r1[16])", "description": "", "name": "median"}, "var": {"templateType": "anything", "group": "Ungrouped variables", "definition": "variance(r0,true)", "description": "", "name": "var"}, "guess2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(guess1/4)", "description": "", "name": "guess2"}, "mean": {"templateType": "anything", "group": "Ungrouped variables", "definition": "mean(r0)", "description": "", "name": "mean"}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "stdev(r0,true)", "description": "", "name": "sd"}, "mu": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(30..50)", "description": "", "name": "mu"}, "uquartile": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.25*r1[23]+0.75*r1[24]", "description": "", "name": "uquartile"}, "guess4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(7*guess1/4)", "description": "", "name": "guess4"}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "32", "description": "", "name": "n"}, "guess1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round((r1[31]-r1[0])/4)", "description": "", "name": "guess1"}, "lquartile": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.75*r1[7]+0.25*r1[8]", "description": "", "name": "lquartile"}, "guess3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(guess1/2)", "description": "", "name": "guess3"}, "range": {"templateType": "anything", "group": "Ungrouped variables", "definition": "r1[31]-r1[0]", "description": "", "name": "range"}, "r0": {"templateType": "anything", "group": "Ungrouped variables", "definition": "repeat(round(normalsample(mu,sig)),32)", "description": "", "name": "r0"}, "stdev": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(stdev(r0,true),2)", "description": "", "name": "stdev"}}, "ungrouped_variables": ["guess3", "guess2", "guess1", "r0", "r1", "guess4", "mean", "median", "n", "mu", "lquartile", "sig", "stdev", "var", "uquartile", "sd", "range"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Find quartiles, range and interquartile range of small sample", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{r1[0]}", "minValue": "{r1[0]}", "correctAnswerFraction": false, "marks": 0.4, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{lquartile}", "minValue": "{lquartile}", "correctAnswerFraction": false, "marks": 0.4, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{median}", "minValue": "{median}", "correctAnswerFraction": false, "marks": 0.4, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{uquartile}", "minValue": "{uquartile}", "correctAnswerFraction": false, "marks": 0.4, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{r1[31]}", "minValue": "{r1[31]}", "correctAnswerFraction": false, "marks": 0.4, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \n
Obtain the $5$ number summary MQMQM and input their values below as exact decimals:
\n \n \n \nMinimum | Lower Quartile | Median | Upper Quartile | Maximum |
---|---|---|---|---|
[[0]] | [[1]] | [[2]] | [[3]] | [[4]] |
Find the range as an exact decimal.
\nRange=[[0]]
", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{uquartile-lquartile}", "minValue": "{uquartile-lquartile}", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n \n \nEnter the interquartile range: [[0]]
\n \n \n \nInput as an exact decimal.
\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["{guess1}
", "{guess2}
", "{guess3}
", "{guess4}
"], "displayColumns": 4, "distractors": ["", "", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": [1, 0, 0, 0], "marks": 0}], "type": "gapfill", "prompt": "Without doing any further calculations, which of the following numbers do you think is likely to be closest to the sample standard deviation?
[[0]]
Given the following table of data, answer all the following questions:
\n \n \n \n$\\var{r0[0]}$ | $\\var{r0[1]}$ | $\\var{r0[2]}$ | $\\var{r0[3]}$ | $\\var{r0[4]}$ | $\\var{r0[5]}$ | $\\var{r0[6]}$ | $\\var{r0[7]}$ | $\\var{r0[8]}$ | $\\var{r0[9]}$ | $\\var{r0[10]}$ | $\\var{r0[11]}$ | $\\var{r0[12]}$ | $\\var{r0[13]}$ | $\\var{r0[14]}$ | $\\var{r0[15]}$ |
$\\var{r0[16]}$ | $\\var{r0[17]}$ | $\\var{r0[18]}$ | $\\var{r0[19]}$ | $\\var{r0[20]}$ | $\\var{r0[21]}$ | $\\var{r0[22]}$ | $\\var{r0[23]}$ | $\\var{r0[24]}$ | $\\var{r0[25]}$ | $\\var{r0[26]}$ | $\\var{r0[27]}$ | $\\var{r0[28]}$ | $\\var{r0[29]}$ | $\\var{r0[30]}$ | $\\var{r0[31]}$ |
11/07/2012:
\nAdded tags.
\nCalculations not tested yet.
\n23/07/2012:
\nAdded description.
\nChecked calculations as stats extension now available. OK.
\n3/08/2012:
\nAdded tags.
\nQuestion appears to be working correctly.
\n19/12/2012:
\nChanged to new stats functions and replaced the uniform sample data by a normal sample.
\nChecked calculations. Note that the quartiles are defined differently from the stats extension definition - so used the Newcastle definition! Added query tag so that can be decided upon.
\nAdded tested1 tag.
\n21/12/2012:
\nRounding OK, added tag cr1.
\n", "licence": "Creative Commons Attribution 4.0 International", "description": "
Given 32 datapoints in a table find their minimum, lower quartile, median, upper quartile, and maximum.
"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "If you sort the data in increasing order you get the following table:
\n$\\var{r1[0]}$ | \n$\\var{r1[1]}$ | \n$\\var{r1[2]}$ | \n$\\var{r1[3]}$ | \n$\\var{r1[4]}$ | \n$\\var{r1[5]}$ | \n$\\var{r1[6]}$ | \n$\\var{r1[7]}$ | \n$\\var{r1[8]}$ | \n$\\var{r1[9]}$ | \n$\\var{r1[10]}$ | \n$\\var{r1[11]}$ | \n$\\var{r1[12]}$ | \n$\\var{r1[13]}$ | \n$\\var{r1[14]}$ | \n$\\var{r1[15]}$ | \n
$\\var{r1[16]}$ | \n$\\var{r1[17]}$ | \n$\\var{r1[18]}$ | \n$\\var{r1[19]}$ | \n$\\var{r1[20]}$ | \n$\\var{r1[21]}$ | \n$\\var{r1[22]}$ | \n$\\var{r1[23]}$ | \n$\\var{r1[24]}$ | \n$\\var{r1[25]}$ | \n$\\var{r1[26]}$ | \n$\\var{r1[27]}$ | \n$\\var{r1[28]}$ | \n$\\var{r1[29]}$ | \n$\\var{r1[30]}$ | \n$\\var{r1[31]}$ | \n
Denote the ordered data by $x_j$, thus $x_{10}=\\var{r1[9]}$ for example.
\nMinimum value: The minimum value is $x_1=\\var{r1[0]}$.
\nLower Quartile: As there is an even number of values, the Lower Quartile will lie between two values. Its position is calculated by finding
\n\\[\\frac{n+1}{4}=\\frac{\\var{n+1}}{4}=8\\frac{1}{4}\\]
\nHence the Lower Quartile lies between the 8th and 9th entries in the ordered table, so it is:
\n\\[0.75\\times x_8+0.25\\times x_9 = 0.75\\times\\var{r1[7]}+0.25\\times \\var{r1[8]}=\\var{lquartile}\\]
\nMedian: The position of the median in the table is given by
\n\\[ \\frac{2(n+1)}{4} = \\frac{\\var{2*(n+1)}}{4} = 16 \\frac{1}{2}\\]
\nThe median lies between the 16th and 17th entries in the ordered table and is given by:
\n\\[0.5\\times x_{16}+0.5\\times x_{17} = 0.5\\times\\var{r1[15]}+0.5\\times \\var{r1[16]}=\\var{median}\\]
\nUpper Quartile: As there is an even number of values, the Upper Quartile will lie between two values. Its position is calculated by finding
\n\\[\\frac{3(n+1)}{4}=\\frac{\\var{3*(n+1)}}{4}=24\\frac{3}{4}\\]
\nHence the Upper Quartile lies between the 24th and 25th entries in the ordered table.
\nWe find it is \\[0.25\\times x_{24}+0.75\\times x_{25} = 0.25\\times\\var{r1[23]}+0.75\\times \\var{r1[24]}=\\var{uquartile}\\]
\nMaximum value: The maximum value is $x_{32}=\\var{r1[31]}$
\nb)
\nThe range is defined to be
Range = Maximum – Minimum
and so in this case we have:
Range = $\\var{r1[31]}-\\var{r1[0]}=\\var{range}$.
The interquartile range is defined to be
\n\\[ \\text{Upper Quartile} – \\text{Lower Quartile} \\]
\nand so in this case we have:
\n\\[ \\text{Interquartile range} = \\var{uquartile}-\\var{lquartile}=\\var{uquartile-lquartile} \\]
\nMost of the data should be spanned by $4s$ where $s$ is the sample standard deviation.
\nThe range of values is $\\var{r1[31]}-\\var{r1[0]}=\\var{r1[31]-r1[0]}$ and so $s$ should be approximately
\n\\[ \\simplify[std]{({r1[31]}-{r1[0]}) / 4 = {(r1[31] -r1[0]) / 4}} \\]
\nThe most likely value for the sample standard deviation of the options presented is $\\var{guess1}$.
\n(The actual value is $\\var{stdev}$ to 2 decimal places).
", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}