// Numbas version: finer_feedback_settings {"name": "Calculate relative percentage frequencies from table of data", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"notes": "", "description": "

Given a table of the number of days in which sales were between £x1000 and £(x+1)1000 find the relative percentage frequencies of these volume of sales.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "preamble": {"css": "", "js": ""}, "advice": "

We show how to calculate the relative percentage frequency for one range of values for  $\\var{a[r]} \\le X \\lt \\var{a[r+1]}$    - you can then check the rest.

\n

Note that there were $\\var{daysopen}$ days  in the year when sales took place. 

\n

There were $\\var{norm1[r]}$ days out of the  $\\var{daysopen}$ when there were between $\\var{a[r]}$ and $\\var{a[r+1]}$ thousand pounds worth of sales (including  $\\var{a[r]}$ thousand but not $\\var{a[r+1]}$ thousand) .

\n

Hence the relative frequency percentage for such sales is given by \\[100 \\times \\frac{\\var{norm1[r]}}{\\var{daysopen}}\\%=\\var{rel[r]}\\%\\] to one decimal place.

\n

 

", "rulesets": {}, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "name": "Calculate relative percentage frequencies from table of data", "ungrouped_variables": ["a", "what", "freqdays", "daysopen", "things", "m", "forwhat", "y", "s", "num", "rel", "freqdays1", "units", "n1", "freqdays2", "r", "norm1"], "showQuestionGroupNames": false, "functions": {"revsort": {"type": "list", "definition": "list(-1*vector(sort(list(-1*vector(a)))))", "language": "jme", "parameters": [["a", "list"]]}}, "tags": ["checked2015", "MAS1403"], "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "variables": {"forwhat": {"name": "forwhat", "group": "Ungrouped variables", "definition": "'for a large retailer in '+random(2010,2011,2012)", "description": "", "templateType": "anything"}, "freqdays2": {"name": "freqdays2", "group": "Ungrouped variables", "definition": "revsort(repeat(random(2..m-1),n1-1))", "description": "", "templateType": "anything"}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "4", "description": "", "templateType": "anything"}, "freqdays1": {"name": "freqdays1", "group": "Ungrouped variables", "definition": "sort(repeat(random(2..50),n1))", "description": "", "templateType": "anything"}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random(5..15#5)", "description": "", "templateType": "anything"}, "things": {"name": "things", "group": "Ungrouped variables", "definition": "'Sales'", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "map(s*x,x,0..7)", "description": "", "templateType": "anything"}, "norm1": {"name": "norm1", "group": "Ungrouped variables", "definition": "map(round(x),x,list((y/sum(freqdays))*vector(freqdays)))", "description": "", "templateType": "anything"}, "freqdays": {"name": "freqdays", "group": "Ungrouped variables", "definition": "freqdays1+freqdays2", "description": "", "templateType": "anything"}, "num": {"name": "num", "group": "Ungrouped variables", "definition": "'Number of days'", "description": "", "templateType": "anything"}, "r": {"name": "r", "group": "Ungrouped variables", "definition": "random(0..5)", "description": "", "templateType": "anything"}, "what": {"name": "what", "group": "Ungrouped variables", "definition": "'daily sales'", "description": "", "templateType": "anything"}, "y": {"name": "y", "group": "Ungrouped variables", "definition": "random(300..320)", "description": "", "templateType": "anything"}, "daysopen": {"name": "daysopen", "group": "Ungrouped variables", "definition": "sum(norm1)", "description": "", "templateType": "anything"}, "rel": {"name": "rel", "group": "Ungrouped variables", "definition": "map(precround(100*norm1[x]/daysopen,1),x,0..2*n1-2)", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "max(freqdays1)", "description": "", "templateType": "anything"}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "'in thousands of pounds'", "description": "", "templateType": "anything"}}, "statement": "

The following table shows {what}, $X$, {units} {forwhat}.

\n

Calculate the relative percentage frequencies (to one decimal place for all).

", "parts": [{"type": "gapfill", "scripts": {}, "marks": 0, "prompt": " \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{things} {num} Relative Percentages
$\\var{a[0]}\\le X \\lt \\var{a[1]}$$\\var{norm1[0]}$[[0]]
$\\var{a[1]}\\le X \\lt \\var{a[2]}$$\\var{norm1[1]}$[[1]]
$\\var{a[2]}\\le X \\lt \\var{a[3]}$$\\var{norm1[2]}$[[2]]
$\\var{a[3]}\\le X \\lt \\var{a[4]}$$\\var{norm1[3]}$[[3]]
$\\var{a[4]}\\le X \\lt \\var{a[5]}$$\\var{norm1[4]}$[[4]]
$\\var{a[5]}\\le X \\lt \\var{a[6]}$$\\var{norm1[5]}$[[5]]
$\\var{a[6]}\\le X \\lt \\var{a[7]}$$\\var{norm1[6]}$[[6]]
", "showCorrectAnswer": true, "gaps": [{"maxValue": "rel[0]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[0]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[1]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[1]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[2]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[2]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[3]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[3]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[4]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[4]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[5]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[5]", "showCorrectAnswer": true, "correctAnswerFraction": false}, {"maxValue": "rel[6]", "showPrecisionHint": false, "scripts": {}, "allowFractions": false, "type": "numberentry", "marks": 1, "minValue": "rel[6]", "showCorrectAnswer": true, "correctAnswerFraction": false}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}