// Numbas version: exam_results_page_options {"name": "Calculate probability of either of two events occurring", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "tags": ["checked2015"], "name": "Calculate probability of either of two events occurring", "functions": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Example showing how to calculate the probability of A or B using the law $p(A \\;\\textrm{or}\\; B)=p(A)+p(B)-p(A\\;\\textrm{and}\\;B)$. 

\n

Also converting percentages to probabilities.

\n

Easily adapted to other applications.

"}, "ungrouped_variables": ["dothisandthat", "desc4", "p1", "desc1", "dothat", "desc3", "things", "ans2", "p3", "p", "p2", "dothat1", "dothis", "therest", "desc2", "thing", "dothis1", "prob1"], "parts": [{"variableReplacementStrategy": "originalfirst", "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "sortAnswers": false, "variableReplacements": [], "scripts": {}, "marks": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "gaps": [{"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "mustBeReduced": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "variableReplacements": [], "minValue": "prob1", "scripts": {}, "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "allowFractions": false, "unitTests": [], "type": "numberentry", "correctAnswerFraction": false, "maxValue": "prob1"}, {"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "mustBeReduced": false, "showCorrectAnswer": true, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "variableReplacements": [], "minValue": "ans2", "scripts": {}, "marks": 1, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "allowFractions": false, "unitTests": [], "type": "numberentry", "correctAnswerFraction": false, "maxValue": "ans2"}], "type": "gapfill", "prompt": "\n

Find the probabilities that a randomly chosen {thing} {desc3}: 

\n

a) {dothis1} or {dothat1}.

\n

Probability = [[0]]

\n

b) {desc4}.

\n

Probability = [[1]]

\n

Enter both probabilities to 2 decimal places.

\n "}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"dothat": {"name": "dothat", "description": "", "templateType": "anything", "definition": "\"work on European routes\"", "group": "Ungrouped variables"}, "desc1": {"name": "desc1", "description": "", "templateType": "anything", "definition": "\"with a small UK-based airline\"", "group": "Ungrouped variables"}, "ans2": {"name": "ans2", "description": "", "templateType": "anything", "definition": "precround(1-prob1,2)", "group": "Ungrouped variables"}, "things": {"name": "things", "description": "", "templateType": "anything", "definition": "'stewardesses'", "group": "Ungrouped variables"}, "therest": {"name": "therest", "description": "", "templateType": "anything", "definition": "\"The remainder\"", "group": "Ungrouped variables"}, "p2": {"name": "p2", "description": "", "templateType": "anything", "definition": "p-p1", "group": "Ungrouped variables"}, "desc3": {"name": "desc3", "description": "", "templateType": "anything", "definition": "\"working with this airline\"", "group": "Ungrouped variables"}, "p3": {"name": "p3", "description": "", "templateType": "anything", "definition": "p-random(85..95)", "group": "Ungrouped variables"}, "dothis1": {"name": "dothis1", "description": "", "templateType": "anything", "definition": "\"works on domestic routes\"", "group": "Ungrouped variables"}, "desc2": {"name": "desc2", "description": "", "templateType": "anything", "definition": "\"are in training\"", "group": "Ungrouped variables"}, "prob1": {"name": "prob1", "description": "", "templateType": "anything", "definition": "precround((p-p3)/100,2)", "group": "Ungrouped variables"}, "dothat1": {"name": "dothat1", "description": "", "templateType": "anything", "definition": "\"works on European routes\"", "group": "Ungrouped variables"}, "thing": {"name": "thing", "description": "", "templateType": "anything", "definition": "\"stewardess\"", "group": "Ungrouped variables"}, "dothis": {"name": "dothis", "description": "", "templateType": "anything", "definition": "\"work on domestic routes\"", "group": "Ungrouped variables"}, "dothisandthat": {"name": "dothisandthat", "description": "", "templateType": "anything", "definition": "\"work on both domestic and European routes\"", "group": "Ungrouped variables"}, "p": {"name": "p", "description": "", "templateType": "anything", "definition": "random(105..125)", "group": "Ungrouped variables"}, "desc4": {"name": "desc4", "description": "", "templateType": "anything", "definition": "\"is in training\"", "group": "Ungrouped variables"}, "p1": {"name": "p1", "description": "", "templateType": "anything", "definition": "random(40..70)", "group": "Ungrouped variables"}}, "extensions": [], "type": "question", "preamble": {"js": "", "css": ""}, "advice": "

a) There are $\\var{p1}+\\var{p2}-\\var{p3}=\\var{p-p3}$ % of stewardesses working on one of the routes. The probability that a random stewardess is working on one of these routes is therefore $\\displaystyle \\frac{\\var{p-p3}}{100}=\\var{prob1}$.

\n

b) The rest are in training and the probability that a randomly selected stewardess is in training is $1-\\var{prob1}=\\var{1-prob1}$.

", "statement": "\n

$\\var{p1}$% of {things} {desc1} {dothis}, $\\var{p2}$% {dothat} and $\\var{p3}$% {dothisandthat}. 

\n

{therest} {desc2}

\n ", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}