// Numbas version: exam_results_page_options {"timing": {"timedwarning": {"message": "", "action": "none"}, "timeout": {"message": "", "action": "none"}, "allowPause": true}, "metadata": {"description": "", "licence": "None specified"}, "navigation": {"showresultspage": "oncompletion", "browse": true, "onleave": {"message": "", "action": "none"}, "startpassword": "", "reverse": true, "allowregen": false, "showfrontpage": true, "preventleave": true}, "question_groups": [{"pickQuestions": 1, "name": "Q1", "pickingStrategy": "all-ordered", "questions": [{"name": "Data set problem for year 9", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "
The data set at the bottom of this page shows the results of a pregnancy test for {total} patients who visited a medical practice.
\nEfficiently sort the data by copying it into an Excel spreadsheet and inserting a pivot table, then use this information to answer the following questions.
\nThis is one of many short videos on pivot tables that can be found online to explain the steps involved: \"Excel Magic Trick #168: Cross Tabulation For a Survey\"
", "advice": "", "rulesets": {}, "variables": {"di_ind": {"name": "di_ind", "group": "Probabilties (part d)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "ci_chosenanswer": {"name": "ci_chosenanswer", "group": "Size of subsets (part c)", "definition": "ci_answers[ci_ind]", "description": "", "templateType": "anything"}, "ciii_answers": {"name": "ciii_answers", "group": "Size of subsets (part c)", "definition": "[\n A+B+D,\n B,\n A+C+D,\n C,\n B+C+D,\n D\n]", "description": "answers still need to be added
", "templateType": "anything"}, "ciii_options": {"name": "ciii_options", "group": "Size of subsets (part c)", "definition": "[\n latex(\"\\\\left|\\\\overline\\{P\\} \\\\cup T_+\\\\right|\"),\n latex(\"\\\\left|\\\\overline\\{P\\} \\\\cap T_+\\\\right|\"),\n latex(\"\\\\left|P \\\\cup \\\\overline\\{T_+\\}\\\\right|\"),\n latex(\"\\\\left|P \\\\cap \\\\overline\\{T_+\\}\\\\right|\"),\n latex(\"\\\\left|\\\\overline\\{P\\} \\\\cup \\\\overline\\{T_+\\}\\\\right|\"),\n latex(\"\\\\left|\\\\overline\\{P\\} \\\\cap \\\\overline\\{T_+\\}\\\\right|\")\n]", "description": "", "templateType": "anything"}, "diii_chosen2": {"name": "diii_chosen2", "group": "Probabilties (part d)", "definition": "diii_options[diii_ind2]", "description": "", "templateType": "anything"}, "ei_chosenanswer": {"name": "ei_chosenanswer", "group": "Sensitivity etc (part e)", "definition": "ei_answers[ei_ind]", "description": "", "templateType": "anything"}, "eiii_answers": {"name": "eiii_answers", "group": "Sensitivity etc (part e)", "definition": "[\n (A/(A+C))/(B/(B+D)),\n (C/(A+C))/(D/(B+D))\n]", "description": "", "templateType": "anything"}, "eiii_options": {"name": "eiii_options", "group": "Sensitivity etc (part e)", "definition": "[\"positive\", \"negative\"]", "description": "", "templateType": "anything"}, "dii_chosen2": {"name": "dii_chosen2", "group": "Probabilties (part d)", "definition": "dii_option[dii_ind2]", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['A','B','C','D'])", "description": "Venn labels
", "templateType": "anything"}, "D": {"name": "D", "group": "Data and part a", "definition": "CplusD-C", "description": "not pregnant and not positive
", "templateType": "anything"}, "cii_chosen": {"name": "cii_chosen", "group": "Size of subsets (part c)", "definition": "cii_options[cii_ind]", "description": "", "templateType": "anything"}, "dii_ind1": {"name": "dii_ind1", "group": "Probabilties (part d)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "di_options": {"name": "di_options", "group": "Probabilties (part d)", "definition": "[\n \"is pregnant\",\n \"tests positive\",\n \"is not pregnant\",\n \"tests negative\"\n]", "description": "", "templateType": "anything"}, "eiii_chosenanswer": {"name": "eiii_chosenanswer", "group": "Sensitivity etc (part e)", "definition": "eiii_answers[eiii_ind]", "description": "", "templateType": "anything"}, "dii_answer": {"name": "dii_answer", "group": "Probabilties (part d)", "definition": "100/total*[\n [A,C],\n[B,D],\n [A,B],\n [C,D]\n][dii_ind1][mod(dii_ind2,2)]", "description": "", "templateType": "anything"}, "AplusB": {"name": "AplusB", "group": "Data and part a", "definition": "random(round(total/4)..round(3*total/4))", "description": "", "templateType": "anything"}, "ci_chosen": {"name": "ci_chosen", "group": "Size of subsets (part c)", "definition": "ci_options[ci_ind]", "description": "", "templateType": "anything"}, "total": {"name": "total", "group": "Data and part a", "definition": "100*random(2..7)", "description": "", "templateType": "anything"}, "diii_options": {"name": "diii_options", "group": "Probabilties (part d)", "definition": "[\"is pregnant\",\"is not pregnant\",\"tests positive\",\"tests negative\"]", "description": "", "templateType": "anything"}, "dii_option": {"name": "dii_option", "group": "Probabilties (part d)", "definition": "[\"is pregnant\",\"is not pregnant\",\"tests positive\",\"tests negative\"]", "description": "", "templateType": "anything"}, "cii_chosenanswer": {"name": "cii_chosenanswer", "group": "Size of subsets (part c)", "definition": "cii_answers[cii_ind]", "description": "", "templateType": "anything"}, "eii_ind": {"name": "eii_ind", "group": "Sensitivity etc (part e)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "eii_chosen": {"name": "eii_chosen", "group": "Sensitivity etc (part e)", "definition": "eii_options[eii_ind]", "description": "", "templateType": "anything"}, "diii_chosen1": {"name": "diii_chosen1", "group": "Probabilties (part d)", "definition": "diii_options[diii_ind1]", "description": "", "templateType": "anything"}, "di_chosenanswer": {"name": "di_chosenanswer", "group": "Probabilties (part d)", "definition": "100*di_answers[di_ind]", "description": "", "templateType": "anything"}, "B": {"name": "B", "group": "Data and part a", "definition": "AplusB-A", "description": "not pregnant and positive
", "templateType": "anything"}, "cii_ind": {"name": "cii_ind", "group": "Size of subsets (part c)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([A,C,B,D][indices(vl,l)[0]],l,['A','B','C','D'])", "description": "", "templateType": "anything"}, "di_chosen": {"name": "di_chosen", "group": "Probabilties (part d)", "definition": "di_options[di_ind]", "description": "", "templateType": "anything"}, "ei_options": {"name": "ei_options", "group": "Sensitivity etc (part e)", "definition": "[\"sensitivity\", \"specificity\"]", "description": "", "templateType": "anything"}, "diii_ind1": {"name": "diii_ind1", "group": "Probabilties (part d)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "ci_answers": {"name": "ci_answers", "group": "Size of subsets (part c)", "definition": "[\n A+C,\n A+B,\n B+D,\n C+D\n]", "description": "", "templateType": "anything"}, "eiii_fraction": {"name": "eiii_fraction", "group": "Sensitivity etc (part e)", "definition": "latex(\"\\\\dfrac\\{\\\\mbox\\{probability a patient who is pregnant tests {eiii_chosen}\\}\\}\\{\\\\mbox\\{probability a patient who is not pregnant tests {eiii_chosen}\\}\\}\")", "description": "", "templateType": "anything"}, "ci_options": {"name": "ci_options", "group": "Size of subsets (part c)", "definition": "[\n latex(\"|P|\"),\n latex(\"|T_+|\"),\n latex(\"\\\\left|\\\\overline\\{P\\}\\\\right|\"),\n latex(\"\\\\left|\\\\overline\\{T_+\\}\\\\right|\")\n]", "description": "", "templateType": "anything"}, "results": {"name": "results", "group": "Data and part a", "definition": "shuffle(\n repeat(\"pregnant and positive
", "templateType": "anything"}, "di_answers": {"name": "di_answers", "group": "Probabilties (part d)", "definition": "[\n (A+C)/total,\n (A+B)/total,\n (B+D)/total,\n (C+D)/total\n]", "description": "", "templateType": "anything"}, "CplusD": {"name": "CplusD", "group": "Data and part a", "definition": "total-AplusB", "description": "", "templateType": "anything"}, "diii_answer": {"name": "diii_answer", "group": "Probabilties (part d)", "definition": "100*[\n [A/(A+C),C/(A+C)],\n [B/(B+D),D/(B+D)],\n [A/(A+B),B/(A+B)],\n [C/(C+D),D/(C+D)]\n][diii_ind1][mod(diii_ind2,2)]", "description": "", "templateType": "anything"}, "ciii_ind": {"name": "ciii_ind", "group": "Size of subsets (part c)", "definition": "random(0..5)", "description": "", "templateType": "anything"}, "eiii_ind": {"name": "eiii_ind", "group": "Sensitivity etc (part e)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "dii_chosen1": {"name": "dii_chosen1", "group": "Probabilties (part d)", "definition": "dii_option[dii_ind1]", "description": "", "templateType": "anything"}, "ciii_chosen": {"name": "ciii_chosen", "group": "Size of subsets (part c)", "definition": "ciii_options[ciii_ind]", "description": "", "templateType": "anything"}, "data": {"name": "data", "group": "Data and part a", "definition": "\"Patients | Condition | Test result |
---|---|---|
pregnant and not positive
", "templateType": "anything"}, "ci_ind": {"name": "ci_ind", "group": "Size of subsets (part c)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "eiii_chosen": {"name": "eiii_chosen", "group": "Sensitivity etc (part e)", "definition": "eiii_options[eiii_ind]", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": [], "variable_groups": [{"name": "Data and part a", "variables": ["total", "AplusB", "CplusD", "A", "B", "C", "D", "results", "patients", "data"]}, {"name": "Venn diagram (part b)", "variables": ["vl", "vlans"]}, {"name": "Size of subsets (part c)", "variables": ["ci_options", "ci_answers", "ci_ind", "ci_chosen", "ci_chosenanswer", "cii_options", "cii_answers", "cii_ind", "cii_chosen", "cii_chosenanswer", "ciii_options", "ciii_answers", "ciii_ind", "ciii_chosen", "ciii_chosenanswer"]}, {"name": "Probabilties (part d)", "variables": ["di_options", "di_answers", "di_ind", "di_chosen", "di_chosenanswer", "dii_option", "dii_ind1", "dii_chosen1", "dii_ind2", "dii_chosen2", "dii_answer", "diii_options", "diii_ind1", "diii_chosen1", "diii_ind2", "diii_chosen2", "diii_answer"]}, {"name": "Sensitivity etc (part e)", "variables": ["ei_options", "ei_answers", "ei_ind", "ei_chosen", "ei_chosenanswer", "eii_options", "eii_answers", "eii_ind", "eii_chosen", "eii_chosenanswer", "eiii_options", "eiii_answers", "eiii_ind", "eiii_chosen", "eiii_chosenanswer", "eiii_fraction"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\nboard.create('text',[-8+xos,4+yos,'P'],{fontsize:30,strokeColor:'blue',anchorX:'left',anchorY:'top'});\nboard.create('text',[8+xos,4+yos,'T+'],{fontsize:30,strokeColor:'blue',anchorX:'left',anchorY:'top'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "Carefully complete the following two-way table for the pregnancy test data:
\n\n\n | pregnant | \nnot pregnant | \ntotals | \n
positive test | \n[[0]] | \n[[1]] | \n[[2]] | \n
negative test | \n[[3]] | \n[[4]] | \n[[5]] | \n
totals | \n[[6]] | \n[[7]] | \n$\\var{total}$ | \n
Let $\\,P\\,$ be the set of patients who were pregnant, and $\\,T_+\\,$ be the set of patients who tested positive.
\nFind the values below, representing the size of each section in the Venn diagram.
\n{venn(vl[0],vl[1],vl[2],vl[3])}
\n$|A|=\\,$[[0]]
\n$|B|=\\,$[[1]]
\n$|C|=\\,$[[2]]
\n$|D|=\\,$[[3]]
", "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": "vlans[0]", "maxValue": "vlans[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "vlans[1]", "maxValue": "vlans[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "vlans[2]", "maxValue": "vlans[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "vlans[3]", "maxValue": "vlans[3]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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": "(i) Based on this data, the probability that a patient {di_chosen} is [[0]]$\\!\\%$ (correct to the nearest percentage).
\n(ii) Based on this data, the probability that a patient {dii_chosen1} and {dii_chosen2} is [[1]]$\\!\\%$ (correct to the nearest percentage).
\n(iii) Based on this data, the probability that a patient who {diii_chosen1} {diii_chosen2} is [[2]]$\\!\\%$ (correct to the nearest percentage).
\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": "di_chosenanswer", "maxValue": "di_chosenanswer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "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": "dii_answer", "maxValue": "dii_answer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "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": "diii_answer", "maxValue": "diii_answer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": "4", "showCellAnswerState": true, "choices": ["$\\boldsymbol{P}\\left(T_+\\big|P\\right)$", "$\\boldsymbol{P}\\left(\\overline{T_+}\\big|P\\right)$", "$\\boldsymbol{P}\\left(T_+\\big|\\overline{P}\\right)$", "$\\boldsymbol{P}\\left(\\overline{T_+}\\big|\\overline{P}\\right)$", "$\\boldsymbol{P}\\left(P\\big|T_+\\right)$", "$\\boldsymbol{P}\\left(\\overline{P}\\big|T_+\\right)$", "$\\boldsymbol{P}\\left(P\\big|\\overline{T_+}\\right)$", "$\\boldsymbol{P}\\left(\\overline{P}\\big|\\overline{T_+}\\right)$"], "matrix": ["if(diii_ind1=0,1,0)*if(diii_ind2=2,1,0)", "if(diii_ind1=0,1,0)*if(diii_ind2=3,1,0)", "if(diii_ind1=1,1,0)*if(diii_ind2=2,1,0)", "if(diii_ind1=1,1,0)*if(diii_ind2=3,1,0)", "if(diii_ind1=2,1,0)*if(diii_ind2=0,1,0)", "if(diii_ind1=2,1,0)*if(diii_ind2=1,1,0)", "if(diii_ind1=3,1,0)*if(diii_ind2=0,1,0)", "if(diii_ind1=3,1,0)*if(diii_ind2=1,1,0)"], "distractors": ["", "", "", "", "", "", "", ""]}], "sortAnswers": false}, {"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": "(i) The sensitivity of a diagnostic test such as this one is the probability that a person who is pregnant does indeed test positive. On the other hand, the specificity is the probability that a person who is not pregnant does not test positive.
\nBased on this data, the point estimate for the {ei_chosen} of the pregnancy test is [[0]]$\\!\\%$ (correct to the nearest percentage).
\n\n(ii) The positive predictive value is the probability that a person who tests positive actually is pregnant. The negative predictive value is the probability that a person who tests negative is not pregnant.
\nBased on this data, the point estimate for the {eii_chosen} of the pregnancy test is [[1]]$\\!\\%$ (correct to the nearest percentage).
\n\n(iii) The {eiii_chosen} likelihood ratio equals $\\,\\var{eiii_fraction}\\,$.
\nBased on this data, the {eiii_chosen} likelihood ratio is [[2]] (correct to 3 decimal places).
\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": "ei_chosenanswer", "maxValue": "ei_chosenanswer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "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": "eii_chosenanswer", "maxValue": "eii_chosenanswer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "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": "eiii_chosenanswer", "maxValue": "eiii_chosenanswer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "3", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "information", "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": "The results of the pregnancy test for {total} patients who visited a medical practice is as follows:
\n\n{data}
Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}, "vl0": {"name": "vl0", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z'])", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "Dpos": {"name": "Dpos", "group": "Venn diagram (part b)", "definition": "if(prob_ind<2,\n random(2,3),\n random(1,3)\n)", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "vl0[0..Dpos]+[\"D\"]+vl0[Dpos..3]", "description": "Venn labels
", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["Dpos", "vl0", "vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n$\\var{x1}$ | \n[[0]] | \n[[1]] | \n
$\\var{th[1]}$ | \n[[2]] | \n[[3]] | \n[[4]] | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V2", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"Dpos": {"name": "Dpos", "group": "Venn diagram (part b)", "definition": "if(prob_ind<2,\n random(2,3),\n random(0,2)\n)", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "vl0[0..Dpos]+[\"D\"]+vl0[Dpos..3]", "description": "Venn labels
", "templateType": "anything"}, "vl0": {"name": "vl0", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z'])", "description": "", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["Dpos", "vl0", "vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n$\\var{x2}$ | \n[[1]] | \n
$\\var{th[1]}$ | \n[[2]] | \n[[3]] | \n[[4]] | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V3", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"Dpos": {"name": "Dpos", "group": "Venn diagram (part b)", "definition": "if(prob_ind<2,\n random(0,1),\n random(1,3)\n)", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "vl0": {"name": "vl0", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z'])", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "vl0[0..Dpos]+[\"D\"]+vl0[Dpos..3]", "description": "Venn labels
", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["Dpos", "vl0", "vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n[[2]] | \n
$\\var{th[1]}$ | \n$\\var{y1}$ | \n[[3]] | \n[[4]] | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V4", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"Dpos": {"name": "Dpos", "group": "Venn diagram (part b)", "definition": "if(prob_ind<2,\n random(0,1),\n random(0,2)\n)", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "vl0": {"name": "vl0", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z'])", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "vl0[0..Dpos]+[\"D\"]+vl0[Dpos..3]", "description": "Venn labels
", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["Dpos", "vl0", "vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n[[2]] | \n
$\\var{th[1]}$ | \n[[3]] | \n$\\var{y2}$ | \n[[4]] | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V5", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z','D'])", "description": "Venn labels
", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(2..3)", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n$\\var{x3}$ | \n
$\\var{th[1]}$ | \n[[2]] | \n[[3]] | \n[[4]] | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V6", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(2..3)", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z','D'])", "description": "Venn labels
", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n[[2]] | \n
$\\var{th[1]}$ | \n[[3]] | \n[[4]] | \n$\\var{y3}$ | \n
totals | \n[[5]] | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V7", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z','D'])", "description": "Venn labels
", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n[[2]] | \n
$\\var{th[1]}$ | \n[[3]] | \n[[4]] | \n[[5]] | \n
totals | \n$\\var{z1}$ | \n[[6]] | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Complete probability tables/diagrams V8", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "Below, you are provided with an incomplete two-way table and Venn diagram for two events $A$ and $B$.
\nIt is known that $\\var{prob}=\\var{prob_val}\\,$.
\nUsing the information already provided, complete both the table and diagram entries.
", "advice": "", "rulesets": {}, "variables": {"y1": {"name": "y1", "group": "Data and part a", "definition": "random(1..y3/m-1)*m", "description": "pregnant and not positive
", "templateType": "anything"}, "z2": {"name": "z2", "group": "Data and part a", "definition": "x2+y2", "description": "", "templateType": "anything"}, "v": {"name": "v", "group": "Data and part a", "definition": "safe(\"[[8]]\")", "description": "", "templateType": "anything"}, "y2": {"name": "y2", "group": "Data and part a", "definition": "y3-y1", "description": "not pregnant and not positive
", "templateType": "anything"}, "x2": {"name": "x2", "group": "Data and part a", "definition": "x3-x1", "description": "not pregnant and positive
", "templateType": "anything"}, "prob_val": {"name": "prob_val", "group": "Ungrouped variables", "definition": "[x3,y3,z1,z2][prob_ind]/z3", "description": "", "templateType": "anything"}, "z1": {"name": "z1", "group": "Data and part a", "definition": "x1+y1", "description": "", "templateType": "anything"}, "y3": {"name": "y3", "group": "Data and part a", "definition": "z3-x3", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Data and part a", "definition": "random(2..9)", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(\"A\",\"B\")", "description": "", "templateType": "anything"}, "vl2": {"name": "vl2", "group": "Venn diagram (part b)", "definition": "map(if(vl[j]=\"D\",string(vlans[3]),vl[j]),j,0..3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Data and part a", "definition": "random(1..x3/m-1)*m", "description": "pregnant and positive
", "templateType": "anything"}, "vlans2": {"name": "vlans2", "group": "Venn diagram (part b)", "definition": "vlans", "description": "", "templateType": "anything"}, "prob_ind": {"name": "prob_ind", "group": "Ungrouped variables", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "if(p1=\"A\",\"B\",\"A\")", "description": "", "templateType": "anything"}, "x3": {"name": "x3", "group": "Data and part a", "definition": "random(2..98)*m", "description": "", "templateType": "anything"}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "[latex(\"{p1}\"),latex(\"\\\\overline {p1}\"),latex(\"{p2}\"),latex(\"\\\\overline {p2}\")]", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['X','Y','Z','D'])", "description": "Venn labels
", "templateType": "anything"}, "vlans": {"name": "vlans", "group": "Venn diagram (part b)", "definition": "map([x1,x2,y1,y2][indices(vl,l)[0]],l,['X','Y','Z','D'])", "description": "", "templateType": "anything"}, "z3": {"name": "z3", "group": "Data and part a", "definition": "100*m", "description": "", "templateType": "anything"}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "latex([\"\\\\boldsymbol P({p1})\",\"\\\\boldsymbol P(\\\\overline {p1})\",\"\\\\boldsymbol P({p2})\",\"\\\\boldsymbol P(\\\\overline {p2})\"][prob_ind])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": "1000"}, "ungrouped_variables": ["p1", "p2", "th", "prob_ind", "prob", "prob_val"], "variable_groups": [{"name": "Data and part a", "variables": ["m", "z3", "x3", "y3", "x1", "x2", "y1", "y2", "z1", "z2", "v"]}, {"name": "Venn diagram (part b)", "variables": ["vl", "vlans", "vl2", "vlans2"]}], "functions": {"venn": {"parameters": [["ab", "string"], ["a", "string"], ["b", "string"], ["rem", "string"], ["c1", "string"], ["c2", "string"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\nvar x_min = -10;\nvar x_max = 10;\nvar y_min = -10;\nvar y_max = 10;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: false\n});\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\nvar xos = -0.5; // x-offset (anchorX:middle will not work for some reason; CSS doesn't seem to fix it)\nvar yos = 1;\n\nboard.create('circle',[[-3,0],5]);\nboard.create('circle',[[3,0],5]);\nboard.create('polygon',[[-9.5,-9.5],[-9.5,9.5],[9.5,9.5],[9.5,-9.5]],\n {fillOpacity:0,vertices:{visible: false}});\n\n// Randomly picking which label goes where: \nvar m = 2*Math.floor(Math.random() * 2)-1;\n\nboard.create('text',[-8*m+xos,4+yos,c1],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\nboard.create('text',[8*m+xos,4+yos,c2],{fontsize:30,anchorX:'left',anchorY:'top',strokeColor:'blue'});\n\nboard.create('text',[0+xos,0+yos,ab],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[-4.5*m+xos,0+yos,a],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[4.5*m+xos,0+yos,b],{fontsize:30,anchorX:'left',anchorY:'top'});\nboard.create('text',[7+xos,-6.5+yos,rem],{fontsize:30,anchorX:'left',anchorY:'top'});\n\n\nreturn div;"}}, "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": "\n\n | $\\var{th[2]}$ | \n$\\var{th[3]}$ | \ntotals | \n
$\\var{th[0]}$ | \n[[0]] | \n[[1]] | \n[[2]] | \n
$\\var{th[1]}$ | \n[[3]] | \n[[4]] | \n[[5]] | \n
totals | \n[[6]] | \n$\\var{z2}$ | \n$\\var{z3}$ | \n
{venn(vl2[0],vl2[1],vl2[2],vl2[3],p1,p2)}
\n$|X|=\\,$[[0]]
\n$|Y|=\\,$[[1]]
\n$|Z|=\\,$[[2]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[0]", "maxValue": "vlans2[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[1]", "maxValue": "vlans2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "vlans2[2]", "maxValue": "vlans2[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "showQuestionGroupNames": false, "name": "Probability Questions for Year 9 (two-way tables and Venn diagrams)", "feedback": {"advicethreshold": 0, "showactualmark": true, "showtotalmark": true, "feedbackmessages": [], "showanswerstate": true, "allowrevealanswer": true, "intro": "These problems will help you develop your understanding of both two-way tables and Venn diagrams (and learn some skills in Excel too).
\nEnjoy :-)
"}, "percentPass": 0, "showstudentname": true, "duration": 0, "contributors": [{"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "Thanom Shaw", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2564/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": []}