// Numbas version: finer_feedback_settings {"name": "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": [{"parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{intersect-tol}", "maxValue": "{intersect+tol}", "marks": 1}], "type": "gapfill", "prompt": "\n \n \n

$P(A\\cap B)=\\;\\;$[[0]]

\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{intcom-tol}", "maxValue": "{intcom+tol}", "marks": 1}], "type": "gapfill", "prompt": "\n \n \n

$P(A^c\\cap B^c)=\\;\\;$[[0]]

\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{unioncom-tol}", "maxValue": "{unioncom+tol}", "marks": 1}], "type": "gapfill", "prompt": "\n \n \n

$P(A^c\\cup B^c)=\\;\\;$[[0]]

\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{prob4-tol}", "maxValue": "{prob4+tol}", "marks": 1}], "type": "gapfill", "prompt": "\n \n \n

$P(A^c\\cap B)=\\;\\;$[[0]]

\n \n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "showCorrectAnswer": true, "minValue": "{prob5-tol}", "maxValue": "{prob5+tol}", "marks": 1}], "type": "gapfill", "prompt": "\n \n \n

$P(A^c\\cup B)=\\;\\;$[[0]]

\n \n \n ", "showCorrectAnswer": true, "marks": 0}], "variables": {"prob4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-prob2-intersect,10)", "name": "prob4", "description": ""}, "intcom": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1-prob3", "name": "intcom", "description": ""}, "intersect": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(prob1+1-prob2-prob3,2)", "name": "intersect", "description": "

P(A and B)

"}, "prob2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..0.9#0.05)", "name": "prob2", "description": "

P(not B)

"}, "prob3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((t*(max(prob1,1-prob2))+(100-t)*min(0.95,prob1+1-prob2))/100,2)", "name": "prob3", "description": "

P(A or B)

"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "name": "tol", "description": ""}, "unioncom": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1-intersect", "name": "unioncom", "description": ""}, "prob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..0.9#0.05)", "name": "prob1", "description": "

P(A)

"}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(10..100)", "name": "t", "description": ""}, "prob5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "1-prob1+1-prob2-prob4", "name": "prob5", "description": ""}}, "ungrouped_variables": ["intcom", "intersect", "prob1", "prob2", "prob3", "prob4", "prob5", "t", "tol", "unioncom"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Calculate probability of combinations of events happening or not, , ", "showQuestionGroupNames": false, "variable_groups": [], "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "\n

Let $A$ and $B$ be events with:

\n

1. $P(A) = \\var{prob1}$

\n

2. $P(A \\cup B)=\\var{prob3}$

\n

3. $P(B^c)=\\var{prob2}$

\n

Find the following probabilities (all answers to 2 decimal places):

\n ", "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"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

7/07/2012:

\n

Added tags.

\n

Set tolerances via new variable tol=0 for all answers.

\n

Checked calculations.

\n

22/07/2012:

\n

Added description.

\n

Switched on stats extension (not needed, but policy for all stats questions).

\n

31/07/2012:

\n

Added tags.

\n

In the Advice section, moved \\Rightarrow to beginning of the line instead of the end of the previous line.

\n

Question appears to be working correctly.

\n

20/12/2012:

\n

Added tested1 tag after checking again - calculations OK.

\n

21/12/2012:

\n

Checked 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..

"}, "advice": "

a)

\n

It follows from the axioms of probability that:

\n

\\[P(A \\cup B)=P(A)+P(B)-P(A \\cap B)\\]

\n

Hence

\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}

\n

Note that we have used $P(B)=1-P(B^c)= 1-\\var{prob2}=\\var{1-prob2}$

\n

b)

\n

The laws of sets gives:

\n

\\[A^c \\cap B^c=(A \\cup B)^c\\]

\n

so

\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}

\n

c)

\n

Similarly to b), the laws of sets gives:

\n

\\[A^c \\cup B^c=(A \\cap B)^c\\]

\n

so

\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}

\n

d)

\n

Note that $B$ is the following union of disjoint sets:

\n

\\[B = (A^c \\cap B) \\cup (A \\cap B)\\]

\n

Hence

\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}

\n

e)

\n

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}

\n

Where we used the result from d) that $P(A^c \\cap B)=\\var{prob4}$

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}