// Numbas version: exam_results_page_options {"name": "Julie's copy of BS2.1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Julie's copy of BS2.1", "tags": ["probability", "Probability", "rebelmaths", "statistics", "udf"], "metadata": {"description": "

Simple probability question. Counting number of occurrences of an event in a sample space with given size and finding the probability of the event.

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{sc[k]}

\n

{table(data,['  From','  To', '  Loans Made'])}

\n

 

", "advice": "

a) The number of loans less than €$\\var{u1}$ is $\\var{accumdisp(n,t)}$$=\\var{sum(n[0..t+1])}$

\n

Since there are $\\var{thismany}$ loans the probability of choosing one of these loans is  $\\displaystyle \\frac{\\var{sum(n[0..t+1])}}{\\var{thismany}}=\\var{ans1}$ to 2 decimal places.

\n

b) The number of loans greater than €$\\var{o1}$ is $\\var{accumdisp(n[v+1..abs(n)],abs(n)-v-2)}=\\var{sum(n[v+1..abs(n)])}$.

\n

Since there are $\\var{thismany}$ loans the probability of choosing one of these loans is  $\\displaystyle \\frac{\\var{sum(n[v+1..abs(n)])}}{\\var{thismany}}=\\var{ans2}$ to 2 decimal places.

\n

c) There are $\\var{accumdisp(n[p+1..q+1],q-p-1)}=\\var{sum(n[p+1..q+1])}$ loans between  €$\\var{a[p]}$ and €$\\var{a[q]-1}$.

\n

Hence the probability of selecting one of these loans in this range for review is $\\displaystyle \\frac{\\var{sum(n[p+1..q+1])}}{\\var{thismany}}=\\var{ans3}$ to 2 decimal places.

", "rulesets": {}, "extensions": ["stats"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "[a0,a0+b0,a0+2*b0]", "description": "", "templateType": "anything", "can_override": false}, "a0": {"name": "a0", "group": "Ungrouped variables", "definition": "random(1000..4000#1000)", "description": "", "templateType": "anything", "can_override": false}, "n0": {"name": "n0", "group": "Ungrouped variables", "definition": "round(thismany/random(15,25))", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "ans1": {"name": "ans1", "group": "Ungrouped variables", "definition": "precround(sum(n[0..t+1])/thismany,2)", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "random(0..abs(sc)-1)", "description": "", "templateType": "anything", "can_override": false}, "ans3": {"name": "ans3", "group": "Ungrouped variables", "definition": "precround((n[1]+n[2])/thismany,2)", "description": "", "templateType": "anything", "can_override": false}, "u1": {"name": "u1", "group": "Ungrouped variables", "definition": "a[t]", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "[n0,n1,thismany-n0-n1-n3,n3]", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "thismany": {"name": "thismany", "group": "Ungrouped variables", "definition": "random(300..1000#100)", "description": "", "templateType": "anything", "can_override": false}, "b0": {"name": "b0", "group": "Ungrouped variables", "definition": "random(1000..3000#1000)", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "random(0..abs(a)-1)", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "random(0..abs(a)-1 except t)", "description": "", "templateType": "anything", "can_override": false}, "sc": {"name": "sc", "group": "Ungrouped variables", "definition": "['A bank made '+{thismany}+' car loans last year. The amounts were as follows (\u20ac):']", "description": "", "templateType": "anything", "can_override": false}, "n1": {"name": "n1", "group": "Ungrouped variables", "definition": "round(thismany/random(3,6))", "description": "", "templateType": "anything", "can_override": false}, "n3": {"name": "n3", "group": "Ungrouped variables", "definition": "round(thismany/random(11,14))", "description": "", "templateType": "anything", "can_override": false}, "data": {"name": "data", "group": "Ungrouped variables", "definition": "\n [[0,a[0]-1,n[0]],\n [a[0],a[1]-1,n[1]],\n [a[1],a[2]-1,n[2]],\n [a[2],'plus',n[3]]]\n \n \n ", "description": "", "templateType": "anything", "can_override": false}, "ans2": {"name": "ans2", "group": "Ungrouped variables", "definition": "precround((thismany-sum(n[0..v+1]))/thismany,2)", "description": "", "templateType": "anything", "can_override": false}, "o1": {"name": "o1", "group": "Ungrouped variables", "definition": "a[v]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "sc", "thismany", "ans1", "k", "ans3", "u1", "p", "n", "q", "a0", "b0", "t", "v", "n0", "n1", "n3", "data", "ans2", "o1"], "variable_groups": [], "functions": {"accumdisp": {"parameters": [["a", "list"], ["k", "number"]], "type": "string", "language": "jme", "definition": "if(k=0,'$\\\\var{a[0]}$','$\\\\var{a[0]}$ + '+accumdisp(a[1..abs(a)],k-1))"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

One of these loans is sampled randomly for review by the bank. What is the probability that it is :

\n

a) Under €$\\var{u1}$?   Probability = ? [[0]]  (answer to 2 decimal places).

\n

b) Over €$\\var{o1-1}$?     Probability = ? [[1]]  (answer to 2 decimal places).

\n

c) Between €$\\var{a[p]}$ and €$\\var{a[q]-1}$?    Probability = ? [[2]] (answer to 2 decimal places).

\n

 

\n

 

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ans1", "maxValue": "ans1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ans2", "maxValue": "ans2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ans3", "maxValue": "ans3", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Patricia Cogan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3359/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Patricia Cogan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3359/"}]}