// Numbas version: exam_results_page_options {"name": "Probability: Conditional probability 2 - with Venn", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Probability: Conditional probability 2 - with Venn", "tags": [], "metadata": {"description": "
Calculate P(A|B) given a venn diagram including P(A) and P(B) and intersection.
", "licence": "None specified"}, "statement": "", "advice": "
$P(A \\vert B)$ can be read as \"the probability of $A$ given $B$\", or \"if we know $B$ is true, what is the probability of $A$?\".
We can use the formula, or the Venn diagram; the Venn diagram clarifies the standard formula:
\n$P(A \\vert B) = \\frac{P(A \\cap B)}{P(B)}$
\nsince we know $B$ is true, we restrict ourselves to the domain of $B$, and then look for where $A$ is true, which now is only the intersection, $A \\cap B$.
\n$P(A \\vert B) = \\frac{P(A \\cap B)}{P(B)} = \\frac{\\var{both}}{\\var{B}} = \\var{precround(both/B,2)}$.
", "rulesets": {}, "extensions": ["geogebra"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "random(0.01 .. 0.99#0.01)", "description": "", "templateType": "randrange", "can_override": false}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "random(0.01 .. 0.99#0.01)", "description": "", "templateType": "randrange", "can_override": false}, "justA": {"name": "justA", "group": "Ungrouped variables", "definition": "A-both", "description": "", "templateType": "anything", "can_override": false}, "justB": {"name": "justB", "group": "Ungrouped variables", "definition": "B-both", "description": "", "templateType": "anything", "can_override": false}, "both": {"name": "both", "group": "Ungrouped variables", "definition": "A+B-AuB", "description": "", "templateType": "anything", "can_override": false}, "AuB": {"name": "AuB", "group": "Ungrouped variables", "definition": "1-neither", "description": "", "templateType": "anything", "can_override": false}, "neither": {"name": "neither", "group": "Ungrouped variables", "definition": "1-random(max(A,B)..1 #0.01)", "description": "", "templateType": "anything", "can_override": false}, "sol": {"name": "sol", "group": "Ungrouped variables", "definition": "both/B", "description": "", "templateType": "anything", "can_override": false}, "sol2": {"name": "sol2", "group": "Ungrouped variables", "definition": "precround(sol,2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "both>0", "maxRuns": 100}, "ungrouped_variables": ["A", "B", "justA", "justB", "both", "AuB", "neither", "sol", "sol2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"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, "prompt": "{geogebra_applet('https://www.geogebra.org/m/rudd6jns',[a:{neither}, b:{A}, c:{both},d:{B}])}
Calculate $P(A|B)$