// Numbas version: finer_feedback_settings {"name": "Simon's copy of Relative Percentage Frequency", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "variables": {"norm1": {"description": "", "templateType": "anything", "name": "norm1", "definition": "map(round(x),x,list((y/sum(freqdays))*vector(freqdays)))", "group": "Ungrouped variables"}, "freqdays1": {"description": "", "templateType": "anything", "name": "freqdays1", "definition": "sort(repeat(random(2..50),n1))", "group": "Ungrouped variables"}, "what": {"description": "", "templateType": "anything", "name": "what", "definition": "'daily sales'", "group": "Ungrouped variables"}, "m": {"description": "", "templateType": "anything", "name": "m", "definition": "max(freqdays1)", "group": "Ungrouped variables"}, "freqdays": {"description": "", "templateType": "anything", "name": "freqdays", "definition": "freqdays1+freqdays2", "group": "Ungrouped variables"}, "n1": {"description": "", "templateType": "anything", "name": "n1", "definition": "4", "group": "Ungrouped variables"}, "r": {"description": "", "templateType": "anything", "name": "r", "definition": "random(0..5)", "group": "Ungrouped variables"}, "daysopen": {"description": "", "templateType": "anything", "name": "daysopen", "definition": "sum(norm1)", "group": "Ungrouped variables"}, "rel": {"description": "", "templateType": "anything", "name": "rel", "definition": "map(precround(100*norm1[x]/daysopen,1),x,0..2*n1-2)", "group": "Ungrouped variables"}, "freqdays2": {"description": "", "templateType": "anything", "name": "freqdays2", "definition": "revsort(repeat(random(2..m-1),n1-1))", "group": "Ungrouped variables"}, "a": {"description": "", "templateType": "anything", "name": "a", "definition": "map(s*x,x,0..7)", "group": "Ungrouped variables"}, "things": {"description": "", "templateType": "anything", "name": "things", "definition": "'Sales'", "group": "Ungrouped variables"}, "num": {"description": "", "templateType": "anything", "name": "num", "definition": "'Number of days'", "group": "Ungrouped variables"}, "y": {"description": "", "templateType": "anything", "name": "y", "definition": "random(300..320)", "group": "Ungrouped variables"}, "forwhat": {"description": "", "templateType": "anything", "name": "forwhat", "definition": "'for a large retailer in '+random(2010,2011,2012)", "group": "Ungrouped variables"}, "units": {"description": "", "templateType": "anything", "name": "units", "definition": "'in thousands of pounds'", "group": "Ungrouped variables"}, "s": {"description": "", "templateType": "anything", "name": "s", "definition": "random(5..15#5)", "group": "Ungrouped variables"}}, "statement": "\n

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

\n

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

\n ", "parts": [{"gaps": [{"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[0]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[0]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[1]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[1]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[2]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[2]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[3]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[3]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[4]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[4]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[5]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[5]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}, {"mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "rel[6]", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "minValue": "rel[6]", "mustBeReducedPC": 0, "scripts": {}, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "extendBaseMarkingAlgorithm": true, "unitTests": [], "type": "numberentry", "marks": 1, "showFeedbackIcon": true}], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "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\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]]
", "unitTests": [], "type": "gapfill", "marks": 0, "showFeedbackIcon": true}], "variable_groups": [], "rulesets": {}, "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.

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"revsort": {"type": "list", "language": "jme", "definition": "list(-1*vector(sort(list(-1*vector(a)))))", "parameters": [["a", "list"]]}}, "ungrouped_variables": ["a", "what", "freqdays", "daysopen", "things", "m", "forwhat", "units", "s", "num", "rel", "n1", "y", "freqdays1", "freqdays2", "r", "norm1"], "advice": "

By summing the 'number of days' column we note that there were $\\var{daysopen}$ days  in the year when sales took place. 

\n

So to work out the relative percentage for a given sales interval, we must calculate $\\frac{\\text{number of days}}{\\var{daysopen}}\\times 100$

\n

\n

\n

E.g. for the interval $\\var{a[0]}\\le X \\lt \\var{a[1]}$:

\n

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

\n

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

\n

 

", "preamble": {"js": "", "css": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["stats"], "name": "Simon's copy of Relative Percentage Frequency", "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}