// Numbas version: exam_results_page_options {"metadata": {"licence": "None specified", "description": ""}, "question_groups": [{"name": "Q1", "pickQuestions": 1, "pickingStrategy": "all-ordered", "questions": [{"name": "Data set problem", "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. 

\n

Efficiently sort the data by copying it into an Excel spreadsheet and inserting a pivot table, then use this information to answer the following questions.

\n

This 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": {"ei_answers": {"name": "ei_answers", "group": "Sensitivity etc (part e)", "definition": "[(A/(A+C)*100), (D/(B+D)*100)]", "description": "", "templateType": "anything"}, "cii_answers": {"name": "cii_answers", "group": "Size of subsets (part c)", "definition": "[\n A+B+C,\n A\n]", "description": "", "templateType": "anything"}, "ci_ind": {"name": "ci_ind", "group": "Size of subsets (part c)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "eii_ind": {"name": "eii_ind", "group": "Sensitivity etc (part e)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "ciii_ind": {"name": "ciii_ind", "group": "Size of subsets (part c)", "definition": "random(0..5)", "description": "", "templateType": "anything"}, "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"}, "eii_chosenanswer": {"name": "eii_chosenanswer", "group": "Sensitivity etc (part e)", "definition": "eii_answers[eii_ind]", "description": "", "templateType": "anything"}, "cii_ind": {"name": "cii_ind", "group": "Size of subsets (part c)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "eii_options": {"name": "eii_options", "group": "Sensitivity etc (part e)", "definition": "[\"positive predictive value\", \"negative predictive value\"]", "description": "", "templateType": "anything"}, "eii_answers": {"name": "eii_answers", "group": "Sensitivity etc (part e)", "definition": "[A/(A+B)*100, D/(C+D)*100]", "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"}, "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"}, "diii_ind1": {"name": "diii_ind1", "group": "Probabilties (part d)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "AplusB": {"name": "AplusB", "group": "Data and part a", "definition": "random(round(total/4)..round(3*total/4))", "description": "", "templateType": "anything"}, "eiii_chosen": {"name": "eiii_chosen", "group": "Sensitivity etc (part e)", "definition": "eiii_options[eiii_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"}, "patients": {"name": "patients", "group": "Data and part a", "definition": "map(\" Patient \" + string(n) + \" \" + results[n-1], n, 1..total)\n", "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"}, "A": {"name": "A", "group": "Data and part a", "definition": "random(round(2*AplusB/3)..AplusB-20)", "description": "

pregnant and positive

", "templateType": "anything"}, "diii_chosen2": {"name": "diii_chosen2", "group": "Probabilties (part d)", "definition": "diii_options[diii_ind2]", "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"}, "cii_chosen": {"name": "cii_chosen", "group": "Size of subsets (part c)", "definition": "cii_options[cii_ind]", "description": "", "templateType": "anything"}, "di_chosen": {"name": "di_chosen", "group": "Probabilties (part d)", "definition": "di_options[di_ind]", "description": "", "templateType": "anything"}, "dii_chosen2": {"name": "dii_chosen2", "group": "Probabilties (part d)", "definition": "dii_option[dii_ind2]", "description": "", "templateType": "anything"}, "eiii_options": {"name": "eiii_options", "group": "Sensitivity etc (part e)", "definition": "[\"positive\", \"negative\"]", "description": "", "templateType": "anything"}, "ei_chosen": {"name": "ei_chosen", "group": "Sensitivity etc (part e)", "definition": "ei_options[ei_ind]", "description": "", "templateType": "anything"}, "diii_chosen1": {"name": "diii_chosen1", "group": "Probabilties (part d)", "definition": "diii_options[diii_ind1]", "description": "", "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"}, "di_chosenanswer": {"name": "di_chosenanswer", "group": "Probabilties (part d)", "definition": "100*di_answers[di_ind]", "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"}, "dii_ind1": {"name": "dii_ind1", "group": "Probabilties (part d)", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "ci_chosen": {"name": "ci_chosen", "group": "Size of subsets (part c)", "definition": "ci_options[ci_ind]", "description": "", "templateType": "anything"}, "vl": {"name": "vl", "group": "Venn diagram (part b)", "definition": "shuffle(['A','B','C','D'])", "description": "

Venn labels

", "templateType": "anything"}, "eiii_ind": {"name": "eiii_ind", "group": "Sensitivity etc (part e)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "D": {"name": "D", "group": "Data and part a", "definition": "CplusD-C", "description": "

not pregnant and not positive

", "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"}, "data": {"name": "data", "group": "Data and part a", "definition": "\"\" +\n\"\" +\njoin(patients,\"\") +\n\"
PatientsConditionTest result
\"", "description": "", "templateType": "anything"}, "dii_ind2": {"name": "dii_ind2", "group": "Probabilties (part d)", "definition": "if(dii_ind1<2,random(2,3),random(0,1))", "description": "", "templateType": "anything"}, "CplusD": {"name": "CplusD", "group": "Data and part a", "definition": "total-AplusB", "description": "", "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"}, "B": {"name": "B", "group": "Data and part a", "definition": "AplusB-A", "description": "

not pregnant and positive

", "templateType": "anything"}, "ei_ind": {"name": "ei_ind", "group": "Sensitivity etc (part e)", "definition": "random(0..1)", "description": "", "templateType": "anything"}, "cii_options": {"name": "cii_options", "group": "Size of subsets (part c)", "definition": "[\n latex(\"\\\\left|P \\\\cup T_+\\\\right|\"),\n latex(\"\\\\left|P \\\\cap T_+\\\\right|\")\n]", "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"}, "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"}, "dii_option": {"name": "dii_option", "group": "Probabilties (part d)", "definition": "[\"is pregnant\",\"is not pregnant\",\"tests positive\",\"tests negative\"]", "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_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"}, "ciii_chosenanswer": {"name": "ciii_chosenanswer", "group": "Size of subsets (part c)", "definition": "ciii_answers[ciii_ind]", "description": "", "templateType": "anything"}, "results": {"name": "results", "group": "Data and part a", "definition": "shuffle(\n repeat(\" is pregnant \"+\" tested positive \", A) + \n repeat(\" is not pregnant \"+\" tested positive \", B) + \n repeat(\" is pregnant \"+\" tested negative \", C) + \n repeat(\" is not pregnant \"+\" tested negative \", D)\n)", "description": "", "templateType": "anything"}, "ei_chosenanswer": {"name": "ei_chosenanswer", "group": "Sensitivity etc (part e)", "definition": "ei_answers[ei_ind]", "description": "", "templateType": "anything"}, "ei_options": {"name": "ei_options", "group": "Sensitivity etc (part e)", "definition": "[\"sensitivity\", \"specificity\"]", "description": "", "templateType": "anything"}, "eiii_chosenanswer": {"name": "eiii_chosenanswer", "group": "Sensitivity etc (part e)", "definition": "eiii_answers[eiii_ind]", "description": "", "templateType": "anything"}, "diii_ind2": {"name": "diii_ind2", "group": "Probabilties (part d)", "definition": "if(diii_ind1<2,random(2,3),random(0,1))", "description": "", "templateType": "anything"}, "cii_chosenanswer": {"name": "cii_chosenanswer", "group": "Size of subsets (part c)", "definition": "cii_answers[cii_ind]", "description": "", "templateType": "anything"}, "C": {"name": "C", "group": "Data and part a", "definition": "random(20..round(CplusD/3))", "description": "

pregnant and not positive

", "templateType": "anything"}, "total": {"name": "total", "group": "Data and part a", "definition": "100*random(2..7)", "description": "", "templateType": "anything"}, "eii_chosen": {"name": "eii_chosen", "group": "Sensitivity etc (part e)", "definition": "eii_options[eii_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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
pregnantnot pregnanttotals
positive test[[0]][[1]][[2]]
negative test[[3]][[4]][[5]]
totals[[6]][[7]]$\\var{total}$
", "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": "A", "maxValue": "A", "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": "B", "maxValue": "B", "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": "A+B", "maxValue": "A+B", "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": "C", "maxValue": "C", "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": "D", "maxValue": "D", "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": "C+D", "maxValue": "C+D", "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": "A+C", "maxValue": "A+C", "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": "B+D", "maxValue": "B+D", "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": "

Let $\\,P\\,$ be the set of patients who were pregnant, and $\\,T_+\\,$ be the set of patients who tested positive.

\n

Find 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": "

Find the following values:

\n

(i) $\\,\\var{ci_chosen} =$ [[0]]

\n

(ii) $\\,\\var{cii_chosen}=$ [[1]]

\n

(iii) $\\,\\var{ciii_chosen} =$ [[2]]

\n

(iv)  The expression in part (iii) describes the number of patients who  [[3]]. That is, the number of patients who  [[4]].

\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": "ci_chosenanswer", "maxValue": "ci_chosenanswer", "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": "cii_chosenanswer", "maxValue": "cii_chosenanswer", "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": "ciii_chosenanswer", "maxValue": "ciii_chosenanswer", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "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": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": ["were not pregnant or tested positive.", "were not pregnant and tested positive.", "were pregnant or tested negative", "were pregnant and tested negative", "were not pregnant or tested negative", "were not pregnant and tested negative"], "matrix": ["if(ciii_ind=0,1,0)", "if(ciii_ind=1,1,0)", "if(ciii_ind=2,1,0)", "if(ciii_ind=3,1,0)", "if(ciii_ind=4,1,0)", "if(ciii_ind=5,1,0)"], "distractors": ["", "", "", "", "", ""]}, {"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": true, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": ["did not have a false negative result.", "had a false positive result.", "did not have a false positive result.", "had a false negative result.", "did not have a true positive result.", "had a true negative result."], "matrix": ["if(ciii_ind=0,1,0)", "if(ciii_ind=1,1,0)", "if(ciii_ind=2,1,0)", "if(ciii_ind=3,1,0)", "if(ciii_ind=4,1,0)", "if(ciii_ind=5,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)  Based on this data, the point estimate for the probability that a patient {di_chosen} is  [[0]]$\\!\\%$ (correct to the nearest percentage).

\n

(ii)  Based on this data, the point estimate for the probability that a patient {dii_chosen1} and {dii_chosen2} is  [[1]]$\\!\\%$ (correct to the nearest percentage).

\n

(iii)  Based on this data, the point estimate for the probability that a patient who {diii_chosen1} {diii_chosen2} is  [[2]]$\\!\\%$ (correct to the nearest percentage).

\n

Which of the following represents this probability?

\n

[[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": "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)  Based on this data, the point estimate for the {ei_chosen} of the pregnancy test is  [[0]]$\\!\\%$ (correct to the nearest percentage).

\n

(ii)  Based on this data, the point estimate for the {eii_chosen} of the pregnancy test is  [[1]]$\\!\\%$ (correct to the nearest percentage).

\n

(iii)  The {eiii_chosen} likelihood ratio equals $\\,\\var{eiii_fraction}\\,$.

\n

Based on this data, the {eiii_chosen} likelihood ratio is  [[2]] (correct to 2 significant figures).

\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": "sigfig", "precision": "2", "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": "
\n

The results of the pregnancy test for {total} patients who visited a medical practice is as follows: 

\n

\n

{data}

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}, {"name": "Q2", "pickQuestions": 1, "pickingStrategy": "random-subset", "questions": [{"name": "Complete probability tables/diagrams V1", "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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$$\\var{x1}$[[0]][[1]]
$\\var{th[1]}$[[2]][[3]][[4]]
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]]$\\var{x2}$[[1]]
$\\var{th[1]}$[[2]][[3]][[4]]
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]][[2]]
$\\var{th[1]}$$\\var{y1}$[[3]][[4]]
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]][[2]]
$\\var{th[1]}$[[3]]$\\var{y2}$[[4]]
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]]$\\var{x3}$
$\\var{th[1]}$[[2]][[3]][[4]]
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]][[2]]
$\\var{th[1]}$[[3]][[4]]$\\var{y3}$
totals[[5]][[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "z1", "maxValue": "z1", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]][[2]]
$\\var{th[1]}$[[3]][[4]][[5]]
totals$\\var{z1}$[[6]]$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z2", "maxValue": "z2", "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": "

{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$. 

\n

It is known that $\\var{prob}=\\var{prob_val}\\,$.

\n

Using 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{th[2]}$$\\var{th[3]}$totals
$\\var{th[0]}$[[0]][[1]][[2]]
$\\var{th[1]}$[[3]][[4]][[5]]
totals[[6]]$\\var{z2}$$\\var{z3}$
\n

", "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": "x1", "maxValue": "x1", "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": "x2", "maxValue": "x2", "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": "x3", "maxValue": "x3", "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": "y1", "maxValue": "y1", "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": "y2", "maxValue": "y2", "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": "y3", "maxValue": "y3", "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": "z1", "maxValue": "z1", "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": "

{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": "Q3", "pickQuestions": 1, "pickingStrategy": "all-ordered", "questions": [{"name": "Tree diagram and conditional probability", "extensions": [], "custom_part_types": [], "resources": [["question-resources/treediagram.png", "/srv/numbas/media/question-resources/treediagram.png"]], "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": [], "ungrouped_variables": ["positive", "negative", "Tplus", "v_options", "v_answers", "v_ind", "v_chosen", "v_chosenanswer", "ans0", "ans1", "ans2", "ans3"], "advice": "", "rulesets": {}, "parts": [{"type": "gapfill", "gaps": [{"unitTests": [], "customName": "", "useCustomName": false, "showFeedbackIcon": true, "adaptiveMarkingPenalty": 0, "correctAnswerStyle": "plain", "mustBeReduced": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showFractionHint": true, "minValue": "ans0*100", "mustBeReducedPC": 0, "variableReplacements": [], "type": "numberentry", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFraction": false, "allowFractions": false, "maxValue": "ans0*100", "scripts": {}, "notationStyles": ["plain", "en", "si-en"]}, {"unitTests": [], "customName": "", "useCustomName": false, "showFeedbackIcon": true, "adaptiveMarkingPenalty": 0, "correctAnswerStyle": "plain", "mustBeReduced": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showFractionHint": true, "minValue": "ans1*100", "mustBeReducedPC": 0, "variableReplacements": [], "type": "numberentry", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFraction": false, "allowFractions": false, "maxValue": "ans1*100", "scripts": {}, "notationStyles": ["plain", "en", "si-en"]}, {"unitTests": [], "customName": "", "useCustomName": false, "showFeedbackIcon": true, "adaptiveMarkingPenalty": 0, "correctAnswerStyle": "plain", "mustBeReduced": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showFractionHint": true, "minValue": "ans2*100", "mustBeReducedPC": 0, "variableReplacements": [], "type": "numberentry", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFraction": false, "allowFractions": false, "maxValue": "ans2*100", "scripts": {}, "notationStyles": ["plain", "en", "si-en"]}, {"unitTests": [], "customName": "", "useCustomName": false, "showFeedbackIcon": true, "adaptiveMarkingPenalty": 0, "correctAnswerStyle": "plain", "mustBeReduced": false, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showFractionHint": true, "minValue": "ans3*100", "mustBeReducedPC": 0, "variableReplacements": [], "type": "numberentry", "marks": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFraction": false, "allowFractions": false, "maxValue": "ans3*100", "scripts": {}, "notationStyles": ["plain", "en", "si-en"]}, {"unitTests": [], "customName": "", "precisionMessage": "You have not given your answer to the correct precision.", "useCustomName": false, "showFeedbackIcon": true, "adaptiveMarkingPenalty": 0, "showPrecisionHint": false, "mustBeReduced": false, "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "minValue": "v_chosenanswer", "precisionPartialCredit": 0, "mustBeReducedPC": 0, "precision": 0, "variableReplacements": [], "type": "numberentry", "precisionType": "dp", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "strictPrecision": true, "correctAnswerFraction": false, "allowFractions": false, "maxValue": "v_chosenanswer", "correctAnswerStyle": "plain", "scripts": {}, "notationStyles": ["plain", "en", "si-en"]}], "marks": 0, "customName": "", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "showFeedbackIcon": true, "showCorrectAnswer": true, "unitTests": [], "customMarkingAlgorithm": "", "adaptiveMarkingPenalty": 0, "variableReplacements": [], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "prompt": "

Note that no rounding is required for parts (i) to (iv).

\n

(i) $\\,{\\boldsymbol{P}}\\left(T_+\\cap P\\right)=\\,$[[0]]$\\!\\%$

\n

(ii) $\\,{\\boldsymbol{P}}\\left( T_+\\cap \\overline{P}\\right)=\\,$[[1]]$\\!\\%$

\n

(iii) $\\,{\\boldsymbol{P}}\\left(T_- \\cap P\\right)=\\,$[[2]]$\\!\\%$

\n

(iv) $\\,{\\boldsymbol{P}}\\left( T_- \\cap \\overline{P}\\right)=\\,$[[3]]$\\!\\%$

\n

(v)  The {v_chosen} is  [[4]]$\\!\\%$ (correct to the nearest percent) 

\n

\n

", "scripts": {}}], "preamble": {"js": "", "css": ""}, "statement": "

The findings of a pregnancy test are given on a website just like that of the online database referred to in the hand-in component of this assignment (www.getthediagnosis.com).

\n

In calculator mode it outputs the following post-test probabilities for pregnancy:

\n\n

Let $\\,T_+\\,$ be the event \"tests positive\", let $\\,T_-\\,$ be the event \"tests negative\", and let $\\,P\\,$ be the event \"is pregnant\".

\n

It is given that $\\,{\\boldsymbol{P}}\\left(T_+\\right)=\\var{Tplus}\\%\\,$.

\n

Use a tree diagram to find each of the probabilties listed below.

\n

", "variable_groups": [], "variables": {"v_chosenanswer": {"group": "Ungrouped variables", "templateType": "anything", "name": "v_chosenanswer", "definition": "v_answers[v_ind]*100", "description": ""}, "v_options": {"group": "Ungrouped variables", "templateType": "anything", "name": "v_options", "definition": "[\"sensitivity\",\"specificity\"]", "description": ""}, "negative": {"group": "Ungrouped variables", "templateType": "anything", "name": "negative", "definition": "random(1..5)", "description": ""}, "positive": {"group": "Ungrouped variables", "templateType": "anything", "name": "positive", "definition": "random(71..89)", "description": ""}, "v_chosen": {"group": "Ungrouped variables", "templateType": "anything", "name": "v_chosen", "definition": "v_options[v_ind]", "description": ""}, "Tplus": {"group": "Ungrouped variables", "templateType": "anything", "name": "Tplus", "definition": "random(35..55)", "description": ""}, "ans1": {"group": "Ungrouped variables", "templateType": "anything", "name": "ans1", "definition": "Tplus/100*(1-positive/100)", "description": ""}, "v_ind": {"group": "Ungrouped variables", "templateType": "anything", "name": "v_ind", "definition": "random(0..1)", "description": ""}, "ans2": {"group": "Ungrouped variables", "templateType": "anything", "name": "ans2", "definition": "(1-Tplus/100)*negative/100", "description": ""}, "ans3": {"group": "Ungrouped variables", "templateType": "anything", "name": "ans3", "definition": "(1-Tplus/100)*(1-negative/100)", "description": ""}, "v_answers": {"group": "Ungrouped variables", "templateType": "anything", "name": "v_answers", "definition": "[(ans0)/(ans0+ans2),(ans3)/(ans1+ans3)]", "description": ""}, "ans0": {"group": "Ungrouped variables", "templateType": "anything", "name": "ans0", "definition": "Tplus/100*positive/100", "description": ""}}, "metadata": {"licence": "None specified", "description": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}}]}], "timing": {"allowPause": true, "timedwarning": {"message": "", "action": "none"}, "timeout": {"message": "", "action": "none"}}, "name": "Year 11 Mathematics Advanced Task 2 (Probability) - online component", "showQuestionGroupNames": false, "showstudentname": true, "navigation": {"showfrontpage": true, "browse": true, "preventleave": true, "onleave": {"message": "", "action": "none"}, "reverse": true, "allowregen": false, "startpassword": "", "showresultspage": "oncompletion"}, "feedback": {"showtotalmark": true, "showanswerstate": true, "feedbackmessages": [], "advicethreshold": 0, "intro": "

Year 11 Mathematics Advanced Task 2 (Probability) - online component

\n

You will have access to this online component up until 8:15am on Monday June 24th.

\n

In this (practice) version you can submit answers to questions or parts of questions as many times as you like and you are encouraged to keep trying until you get a green tick for each part.

\n

You can pause and resume an exam. You can also end exam and start a new attempt as many times as you like.

\n

(Under test conditions on June 24th, however, you will only be able to submit your answers once and will not get immediate feedback).

\n

You are very much encouraged to complete the online quiz with pen, a scribble sheet and a calculator by your side. Under test conditions on June 24th, one handwritten single-sided A4 pages of notes will be allowed. You will also be provided with a blank scribble sheet.

\n

Finally, in order to become familiarised with conditional probability terms in diagnostic testing, it is best to look at Questions 1 and 2 before starting the hand-in component. However, Question 3 might best be attempted and practised after doing the hand-in component.

", "allowrevealanswer": true, "showactualmark": true}, "duration": 0, "percentPass": 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": [["question-resources/treediagram.png", "/srv/numbas/media/question-resources/treediagram.png"]]}