// Numbas version: finer_feedback_settings
{"name": "Creating Frequency Tables", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "tags": ["Frequency", "Frequency Table", "frequency table", "Frequency table", "taxonomy"], "name": "Creating Frequency Tables", "functions": {"tally": {"parameters": [["n", "number"]], "language": "javascript", "definition": "var s = ''\n// Add strikethrough if n>=5\n// For simplicity, I have not handled the case where n reaches 10, which is unlikely.\nif(n>=5){\n s = '|||| ';\n n = n-5;\n}\n// Tally for each n\nfor (i=1; i <= n; i++) { \n s+= '|';\n}\nreturn ''+s+'';", "type": "string"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Present some given data in a frequency table.
"}, "ungrouped_variables": ["data", "frequencies", "tallies"], "parts": [{"variableReplacementStrategy": "originalfirst", "gaps": [{"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[0]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[0]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[1]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[1]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[2]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[2]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[3]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[3]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[4]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[4]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[5]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[5]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[6]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[6]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[7]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[7]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[8]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[8]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[9]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[9]}"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{frequencies[10]}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "mustBeReduced": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{frequencies[10]}"}], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "prompt": "\nComplete the frequency table for this data.
\n\nScore | \nFrequency | \n
$0$ | \n[[0]] | \n
$1$ | \n[[1]] | \n
$2$ | \n[[2]] | \n
$3$ | \n[[3]] | \n
$4$ | \n[[4]] | \n
$5$ | \n[[5]] | \n
$6$ | \n[[6]] | \n
$7$ | \n[[7]] | \n
$8$ | \n[[8]] | \n
$9$ | \n[[9]] | \n
$10$ | \n[[10]] | \n
Frequency is the number of times that an event occurs (in this case, obtaining a certain score) within a particular experiment (in this case, the exam).
\nWe are given enough data that keeping a mental count of the frequencies is difficult:
\n$\\var{data[0]}$ | \n$\\var{data[1]}$ | \n$\\var{data[2]}$ | \n$\\var{data[3]}$ | \n$\\var{data[4]}$ | \n$\\var{data[5]}$ | \n$\\var{data[6]}$ | \n$\\var{data[7]}$ | \n$\\var{data[8]}$ | \n$\\var{data[9]}$ | \n
$\\var{data[10]}$ | \n$\\var{data[11]}$ | \n$\\var{data[12]}$ | \n$\\var{data[13]}$ | \n$\\var{data[14]}$ | \n$\\var{data[15]}$ | \n$\\var{data[16]}$ | \n$\\var{data[17]}$ | \n$\\var{data[18]}$ | \n$\\var{data[19]}$ | \n
Therefore, a better way to approach this problem would be to add an extra column to the frequency table, as illustrated below, to tally the number of students with each score. The number of tally marks for each score can then be read off and insterted into the frequency column.
\nScore | \nTally | \nFrequency | \n
$0$ | \n{tallies[0]} | \n$\\var{frequencies[0]}$ | \n
$1$ | \n{tallies[1]} | \n$\\var{frequencies[1]}$ | \n
$2$ | \n{tallies[2]} | \n$\\var{frequencies[2]}$ | \n
$3$ | \n{tallies[3]} | \n$\\var{frequencies[3]}$ | \n
$4$ | \n{tallies[4]} | \n$\\var{frequencies[4]}$ | \n
$5$ | \n{tallies[5]} | \n$\\var{frequencies[5]}$ | \n
$6$ | \n{tallies[6]} | \n$\\var{frequencies[6]}$ | \n
$7$ | \n{tallies[7]} | \n$\\var{frequencies[7]}$ | \n
$8$ | \n{tallies[8]} | \n$\\var{frequencies[8]}$ | \n
$9$ | \n{tallies[9]} | \n$\\var{frequencies[9]}$ | \n
$10$ | \n{tallies[10]} | \n$\\var{frequencies[10]}$ | \n
A maths test in a Year 7 class of $20$ students was scored out of $10$. The marks awarded to the students were as follows:
\n$\\var{data[0]}$ | \n$\\var{data[1]}$ | \n$\\var{data[2]}$ | \n$\\var{data[3]}$ | \n$\\var{data[4]}$ | \n$\\var{data[5]}$ | \n$\\var{data[6]}$ | \n$\\var{data[7]}$ | \n$\\var{data[8]}$ | \n$\\var{data[9]}$ | \n
$\\var{data[10]}$ | \n$\\var{data[11]}$ | \n$\\var{data[12]}$ | \n$\\var{data[13]}$ | \n$\\var{data[14]}$ | \n$\\var{data[15]}$ | \n$\\var{data[16]}$ | \n$\\var{data[17]}$ | \n$\\var{data[18]}$ | \n$\\var{data[19]}$ | \n