// Numbas version: finer_feedback_settings {"name": "Hugh's copy of 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": [{"parts": [{"prompt": "
\nWhat is $\\mathrm{P}(\\text{not } \\var{name})$?
\n[[0]]
\n", "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "mustBeReducedPC": 0, "marks": 1, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "sum(probs)", "minValue": "sum(probs)", "variableReplacements": [], "showFeedbackIcon": true, "mustBeReduced": false, "scripts": {}, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "marks": 0, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "scripts": {}}, {"prompt": "
What is $\\mathrm{P}(\\var{name})$?
\n[[0]]
", "gaps": [{"correctAnswerFraction": false, "allowFractions": false, "mustBeReducedPC": 0, "marks": 1, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "1-sum(probs)", "minValue": "1-sum(probs)", "variableReplacements": [], "showFeedbackIcon": true, "mustBeReduced": false, "scripts": {}, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "showFeedbackIcon": true, "marks": 0, "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "scripts": {}}], "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["random_person"], "advice": "All probability situations can be reduced to two possible outcomes: success or failure.
\nWhen we express the outcomes in this way we say that they are complementary.
\nThe sum of the probability of an event and its complement is always $1$.
\nIf $\\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.\\]
\nRearranging this equation gives:
\n\\[\\mathrm{P}(\\bar{\\mathrm{E}}) = 1 - \\mathrm{P}(\\mathrm{E})\\]
\nWe can think of this game as having two possible outcomes: either Dexter wins or Dexter doesn't win.
\nThis means that
\n\\[\\mathrm{P}(\\var{name}) + \\mathrm{P}(\\text{not } \\var{name}) = 1 \\text{.}\\]
\n\nIf {name} doesn't win the game then that means that one of the other four players must win the game.
\nSo the probability of {name} not winning the game is the same as the probability of any of the other four players winning the game.
\nTherefore
\n\\begin{align}
\\mathrm{P}(\\text{not }\\var{name}) &= \\mathrm{P}(\\var{people[0]['name']})+\\mathrm{P}(\\var{people[1]['name']})+\\mathrm{P}(\\var{people[1]['name']})+\\mathrm{P}(\\var{people[1]['name']}) \\\\
&= \\var{latex(join(probs,' + '))}\\\\
&= \\var{sum(probs)}.
\\end{align}
Rearranging the equation above gives
\n\\[\\mathrm{P}(\\var{name}) = 1 - \\mathrm{P}(\\text{not } \\var{name}).\\]
\nWe know from a) that $\\mathrm{P}(\\text{not } \\var{name}) = \\var{sum(probs)}$.
\nTherefore
\n\\begin{align}
\\mathrm{P}(\\var{name}) &= 1 - \\mathrm{P}(\\text{not } \\var{name})\\\\
&= 1 - \\var{sum(probs)}\\\\
&= \\var{1-sum(probs)}.
\\end{align}
Uniform random values for each of the five friends. Their winning probabilities will be in proportion to this.
", "definition": "repeat(random(0..1#0),5)", "group": "Ungrouped variables", "templateType": "anything"}, "people": {"name": "people", "description": "", "definition": "random_people(5)", "group": "Ungrouped variables", "templateType": "anything"}, "person": {"name": "person", "description": "The person whose probability is not given.
", "definition": "people[2]", "group": "Ungrouped variables", "templateType": "anything"}, "probs": {"name": "probs", "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.
", "definition": "map(precround(raw_probs[j]/sum(raw_probs),2),j,0..3)", "group": "Ungrouped variables", "templateType": "anything"}}, "functions": {}, "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"}, "variable_groups": [], "tags": ["Complement", "complement", "complementary", "Probabilities sum to 1", "Probability", "probability", "taxonomy"], "ungrouped_variables": ["people", "raw_probs", "probs", "person", "name"], "name": "Hugh's copy of The probability of an event not happening - five friends play mini golf", "rulesets": {}, "statement": "Five friends are playing a game of mini-golf.
\nThe probability that each person wins the game, $\\mathrm{P}(\\text{Person})$, is given in the table.
\nPerson | \n{people[0]['name']} | \n{people[1]['name']} | \n{people[2]['name']} | \n{people[3]['name']} | \n{people[4]['name']} | \n
$\\mathrm{P}(\\text{Person})$ | \n$\\var{probs[0]}$ | \n$\\var{probs[1]}$ | \n\n | $\\var{probs[2]}$ | \n$\\var{probs[3]}$ | \n