// 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": [{"variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"dothisandthat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"work on both domestic and European routes\"", "description": "", "name": "dothisandthat"}, "ans2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(1-prob1,2)", "description": "", "name": "ans2"}, "desc2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"are in training\"", "description": "", "name": "desc2"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "definition": "'stewardesses'", "description": "", "name": "things"}, "dothat1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"works on European routes\"", "description": "", "name": "dothat1"}, "p3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "p-random(85..95)", "description": "", "name": "p3"}, "prob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((p-p3)/100,2)", "description": "", "name": "prob1"}, "therest": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"The remainder\"", "description": "", "name": "therest"}, "desc1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"with a small UK-based airline\"", "description": "", "name": "desc1"}, "p2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "p-p1", "description": "", "name": "p2"}, "thing": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"stewardess\"", "description": "", "name": "thing"}, "dothis1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"works on domestic routes\"", "description": "", "name": "dothis1"}, "desc4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"is in training\"", "description": "", "name": "desc4"}, "dothat": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"work on European routes\"", "description": "", "name": "dothat"}, "dothis": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"work on domestic routes\"", "description": "", "name": "dothis"}, "p1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(40..70)", "description": "", "name": "p1"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(105..125)", "description": "", "name": "p"}, "desc3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"working with this airline\"", "description": "", "name": "desc3"}}, "ungrouped_variables": ["dothisandthat", "desc4", "p1", "desc1", "dothat", "desc3", "things", "ans2", "p3", "p", "p2", "dothat1", "dothis", "therest", "desc2", "thing", "dothis1", "prob1"], "name": "Calculate probability of either of two events occurring", "functions": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "parts": [{"customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "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 ", "unitTests": [], "showFeedbackIcon": true, "scripts": {}, "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "prob1", "maxValue": "prob1", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}, {"correctAnswerFraction": false, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "extendBaseMarkingAlgorithm": true, "minValue": "ans2", "maxValue": "ans2", "unitTests": [], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "variableReplacements": [], "marks": 1, "mustBeReducedPC": 0}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "sortAnswers": false}], "statement": "\n

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

\n

{therest} {desc2}

\n ", "tags": ["checked2015"], "rulesets": {}, "extensions": [], "type": "question", "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.

"}, "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}$.

", "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/"}]}]}], "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/"}]}