// Numbas version: finer_feedback_settings {"name": "The probability of an event not happening - five friends play mini golf", "extensions": ["random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "The probability of an event not happening - five friends play mini golf", "tags": ["complement", "Complement", "complementary", "Probabilities sum to 1", "probability", "Probability"], "metadata": {"description": "

Given the probabilities that each of four out of five friends will win a round of mini-golf, work out the probability that the fifth friend won't win, then use that to find the probability that they will win.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Five friends are playing a game of mini-golf.

\n

The probability that each person wins the game, $\\mathrm{P}(\\text{Person})$, is given in the table.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Person{people[0]['name']}{people[1]['name']}{people[2]['name']}{people[3]['name']}{people[4]['name']}
$\\mathrm{P}(\\text{Person})$$\\var{probs[0]}$$\\var{probs[1]}$$\\var{probs[2]}$$\\var{probs[3]}$
", "advice": "

All probability situations can be reduced to two possible outcomes: success or failure.

\n

When we express the outcomes in this way we say that they are complementary.

\n

The sum of the probability of an event and its complement is always $1$.

\n

If $\\mathrm{P}(\\mathrm{E})$ is the probability of an event $\\mathrm{E}$ happening and $\\mathrm{P}(\\bar{\\mathrm{E}})$ is the probability of that event not happening then

\n

\\[\\mathrm{P}(\\mathrm{E}) +\\mathrm{P}(\\bar{\\mathrm{E}}) = 1.\\]

\n

Rearranging this equation gives:

\n

\\[\\mathrm{P}(\\bar{\\mathrm{E}}) = 1 - \\mathrm{P}(\\mathrm{E})\\]

\n

We can think of this game as having two possible outcomes: either {pname} wins or {pname} doesn't win.

\n

This means that

\n

\\[\\mathrm{P}(\\var{pname}) + \\mathrm{P}(\\text{not } \\var{pname}) = 1 \\text{.}\\]

\n

\n

a)

\n

If {pname} doesn't win the game then that means that one of the other four players must win the game.

\n

So the probability of {pname} not winning the game is the same as the probability of any of the other four players winning the game.

\n

Therefore

\n

\\begin{align}
\\mathrm{P}(\\text{not }\\var{pname}) &= \\mathrm{P}(\\var{people[0]['name']})+\\mathrm{P}(\\var{people[1]['name']})+\\mathrm{P}(\\var{people[3]['name']})+\\mathrm{P}(\\var{people[4]['name']}) \\\\
&= \\var{latex(join(probs,' + '))}\\\\
&= \\var{sum(probs)}.
\\end{align}

\n

b)

\n

Rearranging the equation above gives

\n

\\[\\mathrm{P}(\\var{pname}) = 1 - \\mathrm{P}(\\text{not } \\var{pname}).\\]

\n

We know from a) that $\\mathrm{P}(\\text{not } \\var{pname}) = \\var{sum(probs)}$.

\n

Therefore

\n

\\begin{align}
\\mathrm{P}(\\var{pname}) &= 1 - \\mathrm{P}(\\text{not } \\var{pname})\\\\
&= 1 - \\var{sum(probs)}\\\\
&= \\var{1-sum(probs)}.
\\end{align}

", "rulesets": {}, "extensions": ["random_person"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"probs": {"name": "probs", "group": "Ungrouped variables", "definition": "map(precround(raw_probs[j]/sum(raw_probs),2),j,0..3)", "description": "

The probability of each of the first 4 friends winning the game. The missing person isn't included, so their probability can be 1 minus the sum of the rest, accumulating any rounding errors.

", "templateType": "anything", "can_override": false}, "pname": {"name": "pname", "group": "Ungrouped variables", "definition": "person['name']", "description": "", "templateType": "anything", "can_override": false}, "person": {"name": "person", "group": "Ungrouped variables", "definition": "people[2]", "description": "

The person whose probability is not given.

", "templateType": "anything", "can_override": false}, "raw_probs": {"name": "raw_probs", "group": "Ungrouped variables", "definition": "repeat(random(0..1#0),5)", "description": "

Uniform random values for each of the five friends. Their winning probabilities will be in proportion to this.

", "templateType": "anything", "can_override": false}, "people": {"name": "people", "group": "Ungrouped variables", "definition": "random_people(5)", "description": "", "templateType": "anything", "can_override": false}, "p_not_name": {"name": "p_not_name", "group": "Ungrouped variables", "definition": "sum(probs)", "description": "

The probability that the chosen person does not win.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["people", "raw_probs", "probs", "person", "pname", "p_not_name"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $\\mathrm{P}(\\text{not } \\var{pname})$?

\n

[[0]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "P(not {name})", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "p_not_name", "maxValue": "p_not_name", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is $\\mathrm{P}(\\var{pname})$?

\n

[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "P({name})", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "p_not_name", "part": "p0g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "1-p_not_name", "maxValue": "1-p_not_name", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Elliott Fletcher", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1591/"}]}