// Numbas version: finer_feedback_settings {"name": "Relative Percentage Frequency", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"revsort": {"definition": "list(-1*vector(sort(list(-1*vector(a)))))", "type": "list", "parameters": [["a", "list"]], "language": "jme"}}, "ungrouped_variables": ["a", "what", "freqdays", "daysopen", "things", "m", "forwhat", "units", "s", "num", "rel", "n1", "y", "freqdays1", "freqdays2", "r", "norm1"], "name": "Relative Percentage Frequency", "tags": ["frequencies", "percentages", "rebel", "Rebel", "REBEL", "rebelmaths", "relative percentage frequencies", "statistics"], "advice": "\n
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.
\nNote that there were $\\var{daysopen}$ days in the year when sales took place.
\nThere 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) .
\nHence 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\n ", "rulesets": {}, "parts": [{"prompt": "\n
{things} | {num} | Relative Percentages | \n
---|---|---|
$\\var{a[0]}\\le X \\lt \\var{a[1]}$ | \n$\\var{norm1[0]}$ | \n[[0]] | \n
$\\var{a[1]}\\le X \\lt \\var{a[2]}$ | \n$\\var{norm1[1]}$ | \n[[1]] | \n
$\\var{a[2]}\\le X \\lt \\var{a[3]}$ | \n$\\var{norm1[2]}$ | \n[[2]] | \n
$\\var{a[3]}\\le X \\lt \\var{a[4]}$ | \n$\\var{norm1[3]}$ | \n[[3]] | \n
$\\var{a[4]}\\le X \\lt \\var{a[5]}$ | \n$\\var{norm1[4]}$ | \n[[4]] | \n
$\\var{a[5]}\\le X \\lt \\var{a[6]}$ | \n$\\var{norm1[5]}$ | \n[[5]] | \n
$\\var{a[6]}\\le X \\lt \\var{a[7]}$ | \n$\\var{norm1[6]}$ | \n[[6]] | \n
The following table shows {what}, $X$, {units} {forwhat}.
\nCalculate the relative percentage frequencies (to one decimal place for all).
\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "map(s*x,x,0..7)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "what": {"definition": "'daily sales'", "templateType": "anything", "group": "Ungrouped variables", "name": "what", "description": ""}, "freqdays": {"definition": "freqdays1+freqdays2", "templateType": "anything", "group": "Ungrouped variables", "name": "freqdays", "description": ""}, "daysopen": {"definition": "sum(norm1)", "templateType": "anything", "group": "Ungrouped variables", "name": "daysopen", "description": ""}, "things": {"definition": "'Sales'", "templateType": "anything", "group": "Ungrouped variables", "name": "things", "description": ""}, "m": {"definition": "max(freqdays1)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "forwhat": {"definition": "'for a large retailer in '+random(2010,2011,2012)", "templateType": "anything", "group": "Ungrouped variables", "name": "forwhat", "description": ""}, "units": {"definition": "'in thousands of pounds'", "templateType": "anything", "group": "Ungrouped variables", "name": "units", "description": ""}, "s": {"definition": "random(5..15#5)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "num": {"definition": "'Number of days'", "templateType": "anything", "group": "Ungrouped variables", "name": "num", "description": ""}, "rel": {"definition": "map(precround(100*norm1[x]/daysopen,1),x,0..2*n1-2)", "templateType": "anything", "group": "Ungrouped variables", "name": "rel", "description": ""}, "n1": {"definition": "4", "templateType": "anything", "group": "Ungrouped variables", "name": "n1", "description": ""}, "y": {"definition": "random(300..320)", "templateType": "anything", "group": "Ungrouped variables", "name": "y", "description": ""}, "freqdays1": {"definition": "sort(repeat(random(2..50),n1))", "templateType": "anything", "group": "Ungrouped variables", "name": "freqdays1", "description": ""}, "freqdays2": {"definition": "revsort(repeat(random(2..m-1),n1-1))", "templateType": "anything", "group": "Ungrouped variables", "name": "freqdays2", "description": ""}, "r": {"definition": "random(0..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}, "norm1": {"definition": "map(round(x),x,list((y/sum(freqdays))*vector(freqdays)))", "templateType": "anything", "group": "Ungrouped variables", "name": "norm1", "description": ""}}, "metadata": {"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.
\nrebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}