// Numbas version: exam_results_page_options {"name": "Find sample mean, standard deviation, median and interquartile range, , ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"showCorrectAnswer": true, "gaps": [{"correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "minValue": "{precround(mean(r0),1)}", "marks": "1", "maxValue": "{precround(mean(r0),1)}", "showCorrectAnswer": true, "correctAnswerFraction": false, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "scripts": {}}, {"correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "minValue": "{siground(stdev(r0,true),3)}", "marks": "1", "maxValue": "{siground(stdev(r0,true),3)}", "showCorrectAnswer": true, "correctAnswerFraction": false, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "scripts": {}}, {"correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "minValue": "{median}", "marks": "1", "maxValue": "{median}", "showCorrectAnswer": true, "correctAnswerFraction": false, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "scripts": {}}, {"correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "minValue": "{interq}", "marks": "1", "maxValue": "{interq}", "showCorrectAnswer": true, "correctAnswerFraction": false, "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "variableReplacements": [], "scripts": {}}], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "gapfill", "prompt": "
Sample Mean (1 dp) | Sample Standard Deviation (3 sig figs) | Median (exact value) | Interquartile Range (exact value) |
---|---|---|---|
[[0]] | [[1]] | [[2]] | [[3]] |
Sample mean: The sample mean is $\\frac{\\var{sum(r0)}}{\\var{len(r0)}} = \\var{precround(mean(r0),1)}$ to 1 decimal place.
\nSample standard deviation: The sample standard deviation is $\\var{stdev(r0,true)}=\\var{siground(stdev(r0,true),3)}$ to 3 significant figures.
\nIf you order 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
Denote the ordered data by $x_j$, thus $x_{10}=\\var{r1[9]}$ for example.
\nMedian: The median lies between the 12th and 13th entries in the ordered table and is given by:
\n\\[0.5\\times x_{12}+0.5\\times x_{13} = 0.5\\times\\var{r1[11]}+0.5\\times \\var{r1[12]}=\\var{median}\\]
\nInterquartile range: 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}=6\\frac{1}{4}\\]
\nHence the Lower Quartile lies between the 6th and 7th entries in the ordered table.
\nIt is \\[0.75\\times x_6+0.25\\times x_7 = 0.75\\times\\var{r1[5]}+0.25\\times \\var{r1[6]}=\\var{lquartile}\\]
\nOnce again as there is an even number of values, the Upper Quartile will lie between two values and its position is calculated by finding
\n\\[\\frac{3(n+1)}{4}=\\frac{\\var{3*(n+1)}}{4}=18\\frac{3}{4}\\]
\nHence the Upper Quartile lies between the 18th and 19th entries in the ordered table.
\nWe find it is \\[0.25\\times x_{18}+0.75\\times x_{19} = 0.25\\times\\var{r1[17]}+0.75\\times \\var{r1[18]}=\\var{uquartile}\\]
\nThe 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{interq} \\]
", "variables": {"things": {"group": "Ungrouped variables", "templateType": "anything", "name": "things", "description": "", "definition": "'tomatoes '"}, "description": {"group": "Ungrouped variables", "templateType": "anything", "name": "description", "description": "", "definition": "' from a new kind of tomato plant.'"}, "units": {"group": "Ungrouped variables", "templateType": "anything", "name": "units", "description": "", "definition": "'grams'"}, "u": {"group": "Ungrouped variables", "templateType": "anything", "name": "u", "description": "", "definition": "random(20..60)"}, "interq": {"group": "Ungrouped variables", "templateType": "anything", "name": "interq", "description": "", "definition": "uquartile-lquartile"}, "whatever": {"group": "Ungrouped variables", "templateType": "anything", "name": "whatever", "description": "", "definition": "'weights'"}, "var": {"group": "Ungrouped variables", "templateType": "anything", "name": "var", "description": "", "definition": "variance(r0,true)"}, "r0": {"group": "Ungrouped variables", "templateType": "anything", "name": "r0", "description": "", "definition": "repeat(random(l..u),24)"}, "uquartile": {"group": "Ungrouped variables", "templateType": "anything", "name": "uquartile", "description": "", "definition": "0.25*r1[17]+0.75*r1[18]"}, "n": {"group": "Ungrouped variables", "templateType": "anything", "name": "n", "description": "", "definition": "24"}, "mean": {"group": "Ungrouped variables", "templateType": "anything", "name": "mean", "description": "", "definition": "mean(r0)"}, "r1": {"group": "Ungrouped variables", "templateType": "anything", "name": "r1", "description": "", "definition": "sort(r0)"}, "l": {"group": "Ungrouped variables", "templateType": "anything", "name": "l", "description": "", "definition": "random(10..19)"}, "median": {"group": "Ungrouped variables", "templateType": "anything", "name": "median", "description": "", "definition": "0.5*(r1[11]+r1[12])"}, "stdev": {"group": "Ungrouped variables", "templateType": "anything", "name": "stdev", "description": "", "definition": "precround(stdev(r0,true),2)"}, "lquartile": {"group": "Ungrouped variables", "templateType": "anything", "name": "lquartile", "description": "", "definition": "0.75*r1[5]+0.25*r1[6]"}}, "metadata": {"description": "Sample of size $24$ is given in a table. Find sample mean, sample standard deviation, sample median and the interquartile range.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "The following data are the {whatever}, in {units}, of $\\var{n}$ {things} {description}
\n$\\var{r0[0]}$ | \n$\\var{r0[1]}$ | \n$\\var{r0[2]}$ | \n$\\var{r0[3]}$ | \n$\\var{r0[4]}$ | \n$\\var{r0[5]}$ | \n$\\var{r0[6]}$ | \n$\\var{r0[7]}$ | \n
$\\var{r0[8]}$ | \n$\\var{r0[9]}$ | \n$\\var{r0[10]}$ | \n$\\var{r0[11]}$ | \n$\\var{r0[12]}$ | \n$\\var{r0[13]}$ | \n$\\var{r0[14]}$ | \n$\\var{r0[15]}$ | \n
$\\var{r0[16]}$ | \n$\\var{r0[17]}$ | \n$\\var{r0[18]}$ | \n$\\var{r0[19]}$ | \n$\\var{r0[20]}$ | \n$\\var{r0[21]}$ | \n$\\var{r0[22]}$ | \n$\\var{r0[23]}$ | \n