// Numbas version: finer_feedback_settings {"name": "Luis's copy of Calculate probability of combinations of events happening or not, ,", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": ["axiom", "axioms of probability", "checked2015", "complement", "complement of an event", "cr1", "elementary probability", "intersection of events", "intersection of sets", "laws of sets", "MAS1604", "MAS8380", "MAS8401", "Probability", "probability", "probability laws", "set laws", "sets", "statistics", "tested1", "union", "union of events", "union of sets"], "statement": "\n
Let $A$ and $B$ be events with:
\n1. $P(A) = \\var{prob1}$
\n2. $P(A \\cup B)=\\var{prob3}$
\n3. $P(B^c)=\\var{prob2}$
\nFind the following probabilities (all answers to 2 decimal places):
\n ", "name": "Luis's copy of Calculate probability of combinations of events happening or not, ,", "metadata": {"notes": "7/07/2012:
\nAdded tags.
\nSet tolerances via new variable tol=0 for all answers.
\nChecked calculations.
\n22/07/2012:
\nAdded description.
\nSwitched on stats extension (not needed, but policy for all stats questions).
\n31/07/2012:
\nAdded tags.
\nIn the Advice section, moved \\Rightarrow to beginning of the line instead of the end of the previous line.
\nQuestion appears to be working correctly.
\n20/12/2012:
\nAdded tested1 tag after checking again - calculations OK.
\n21/12/2012:
\nChecked rounding, OK. Added tag cr1.
", "licence": "Creative Commons Attribution 4.0 International", "description": "Given $P(A)$, $P(A\\cup B)$, $P(B^c)$ find $P(A \\cap B)$, $P(A^c \\cap B^c)$, $P(A^c \\cup B^c)$ etc..
"}, "ungrouped_variables": ["intcom", "intersect", "prob1", "prob2", "prob3", "prob4", "prob5", "t", "tol", "unioncom"], "parts": [{"prompt": "\n \n \n$P(A\\cap B)=\\;\\;$[[0]]
\n \n \n ", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"showPrecisionHint": false, "type": "numberentry", "allowFractions": false, "showCorrectAnswer": true, "minValue": "{intersect-tol}", "maxValue": "{intersect+tol}", "correctAnswerFraction": false, "scripts": {}, "marks": 1}], "scripts": {}}, {"prompt": "\n \n \n$P(A^c\\cap B^c)=\\;\\;$[[0]]
\n \n \n ", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"showPrecisionHint": false, "type": "numberentry", "allowFractions": false, "showCorrectAnswer": true, "minValue": "{intcom-tol}", "maxValue": "{intcom+tol}", "correctAnswerFraction": false, "scripts": {}, "marks": 1}], "scripts": {}}, {"prompt": "\n \n \n$P(A^c\\cup B^c)=\\;\\;$[[0]]
\n \n \n ", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"showPrecisionHint": false, "type": "numberentry", "allowFractions": false, "showCorrectAnswer": true, "minValue": "{unioncom-tol}", "maxValue": "{unioncom+tol}", "correctAnswerFraction": false, "scripts": {}, "marks": 1}], "scripts": {}}, {"prompt": "\n \n \n$P(A^c\\cap B)=\\;\\;$[[0]]
\n \n \n ", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"showPrecisionHint": false, "type": "numberentry", "allowFractions": false, "showCorrectAnswer": true, "minValue": "{prob4-tol}", "maxValue": "{prob4+tol}", "correctAnswerFraction": false, "scripts": {}, "marks": 1}], "scripts": {}}, {"prompt": "\n \n \n$P(A^c\\cup B)=\\;\\;$[[0]]
\n \n \n ", "type": "gapfill", "marks": 0, "showCorrectAnswer": true, "gaps": [{"showPrecisionHint": false, "type": "numberentry", "allowFractions": false, "showCorrectAnswer": true, "minValue": "{prob5-tol}", "maxValue": "{prob5+tol}", "correctAnswerFraction": false, "scripts": {}, "marks": 1}], "scripts": {}}], "variables": {"prob4": {"definition": "precround(1-prob2-intersect,10)", "name": "prob4", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "prob2": {"definition": "random(0.1..0.9#0.05)", "name": "prob2", "templateType": "anything", "group": "Ungrouped variables", "description": "P(not B)
"}, "intcom": {"definition": "1-prob3", "name": "intcom", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "intersect": {"definition": "precround(prob1+1-prob2-prob3,2)", "name": "intersect", "templateType": "anything", "group": "Ungrouped variables", "description": "P(A and B)
"}, "t": {"definition": "random(10..100)", "name": "t", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "unioncom": {"definition": "1-intersect", "name": "unioncom", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "prob5": {"definition": "1-prob1+1-prob2-prob4", "name": "prob5", "templateType": "anything", "group": "Ungrouped variables", "description": ""}, "prob1": {"definition": "random(0.1..0.9#0.05)", "name": "prob1", "templateType": "anything", "group": "Ungrouped variables", "description": "P(A)
"}, "prob3": {"definition": "precround((t*(max(prob1,1-prob2))+(100-t)*min(0.95,prob1+1-prob2))/100,2)", "name": "prob3", "templateType": "anything", "group": "Ungrouped variables", "description": "P(A or B)
"}, "tol": {"definition": "0", "name": "tol", "templateType": "anything", "group": "Ungrouped variables", "description": ""}}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "type": "question", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "advice": "It follows from the axioms of probability that:
\n\\[P(A \\cup B)=P(A)+P(B)-P(A \\cap B)\\]
\nHence
\n\\begin{align}
P(A \\cap B) &= P(A)+P(B)-P(A \\cup B) \\\\
&= \\var{prob1}+1-\\var{prob2}-\\var{prob3} \\\\
&= \\var{intersect}
\\end{align}
Note that we have used $P(B)=1-P(B^c)= 1-\\var{prob2}=\\var{1-prob2}$
\nThe laws of sets gives:
\n\\[A^c \\cap B^c=(A \\cup B)^c\\]
\nso
\n\\begin{align}
P(A^c \\cap B^c) &= P((A \\cup B)^c) \\\\
&= 1-P(A \\cup B) \\\\
&= 1-\\var{prob3} \\\\
&= \\var{1-prob3}
\\end{align}
Similarly to b), the laws of sets gives:
\n\\[A^c \\cup B^c=(A \\cap B)^c\\]
\nso
\n\\begin{align}
P(A^c \\cup B^c) &= P((A \\cap B)^c) \\\\
&= 1-P(A \\cap B) \\\\
&= 1-\\var{intersect} \\\\
&= \\var{1-intersect}
\\end{align}
Note that $B$ is the following union of disjoint sets:
\n\\[B = (A^c \\cap B) \\cup (A \\cap B)\\]
\nHence
\n\\begin{align}
P(B) &= P(A^c \\cap B) + P(A \\cap B) \\\\
\\implies P(A^c \\cap B) &= P(B)-P(A\\cap B) \\\\
&= 1-\\var{prob2}-\\var{intersect} \\\\
&= \\var{prob4}
\\end{align}
Once again using a familiar result we have:
\n\\begin{align}
P(A^c \\cup B) &= P(A^c)+P(B)-P(A^c \\cap B) \\\\
&= 1-\\var{prob1}+1-\\var{prob2}-\\var{prob4} \\\\
&= \\var{prob5}
\\end{align}
Where we used the result from d) that $P(A^c \\cap B)=\\var{prob4}$
", "showQuestionGroupNames": false, "functions": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "questions": [], "pickQuestions": 0}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}