// Numbas version: finer_feedback_settings {"name": "Binomial Distribution 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Binomial Distribution 2", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "
A commuter gets a train each weekday morning, and {n} out of 5 days the train is delayed.
", "advice": "The answers involve binomial distributions because there are only 2 cases - the train is either delayed or it is not.
\nTherefore, we want to apply the binomial distribution \\[ P(X=r) =\\, ^nC_r \\, p^r \\, (1-p)^{n-r}.\\]
\nLet $X$ be the number of days a train is delayed in a week.
\nPart (a):
\n\\[ \\begin{split} P(X=0) &\\,= \\binom{5}{0} \\times \\var{prob}^0 \\times \\var{1-prob}^5 \\\\ &\\,= \\var{1-prob}^5 \\\\ &\\,= \\var{sol1}. \\end{split} \\]
\nPart (b):
\n{partb}
\n", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"n": {"name": "n", "group": "Ungrouped variables", "definition": "random(1,2,3,4)", "description": "", "templateType": "anything", "can_override": false}, "sol2": {"name": "sol2", "group": "Ungrouped variables", "definition": "if(numd=2,10*prob^3*(1-prob)^2+5*prob^4*(1-prob)+prob^5,5*prob^4*(1-prob)+prob^5)", "description": "", "templateType": "anything", "can_override": false}, "sol1": {"name": "sol1", "group": "Ungrouped variables", "definition": "(1-prob)^5", "description": "", "templateType": "anything", "can_override": false}, "partb": {"name": "partb", "group": "Ungrouped variables", "definition": "if(numd=2,'{b1}','{b2}')", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "\"If the train is delayed more than 2 times in a week, we are interested in
\\n\\\\[ P(X > 2) = P(X=3) + P(X=4) + P(X=5).\\\\]
\\n\\\\[ \\\\begin{split} &\\\\, P(X=3) = \\\\binom{5}{3} \\\\times \\\\var{prob}^3 \\\\times \\\\var{1-prob}^2 = \\\\var{10*prob^3*(1-prob)^2} \\\\\\\\ &\\\\, P(X=4) = \\\\binom{5}{4} \\\\times \\\\var{prob}^4 \\\\times \\\\var{1-prob} = \\\\var{5*prob^4*(1-prob)} \\\\\\\\ &\\\\,P(X=5) = \\\\binom{5}{5} \\\\times \\\\var{prob}^5 = \\\\var{prob^5} . \\\\end{split} \\\\]
\\nTherefore,
\\n\\\\[ P(X > 2) = \\\\var{sol2}. \\\\]
\"", "description": "", "templateType": "long string", "can_override": false}, "b2": {"name": "b2", "group": "Ungrouped variables", "definition": "\"If the train is delayed more than 3 times in a week, we are interested in
\\n\\\\[ P(X > 3) = P(X=4) + P(X=5).\\\\]
\\n\\\\[ \\\\begin{split} &\\\\, P(X=4) = \\\\binom{5}{4} \\\\times \\\\var{prob}^4 \\\\times \\\\var{1-prob} = \\\\var{5*prob^4*(1-prob)} \\\\\\\\ &\\\\,P(X=5) = \\\\binom{5}{5} \\\\times \\\\var{prob}^5 = \\\\var{prob^5} . \\\\end{split} \\\\]
\\nTherefore,
\\n\\\\[ P(X > 3) = \\\\var{sol2}. \\\\]
\"", "description": "", "templateType": "long string", "can_override": false}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "n/5", "description": "", "templateType": "anything", "can_override": false}, "numd": {"name": "numd", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "sol2", "sol1", "partb", "b1", "b2", "prob", "numd"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "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 the probability that,
"}, {"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": "The commuter has no delays for a week?
\n[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{sol1}", "maxValue": "{sol1}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "The train is delayed more than {numd} times in a week?
\n\n[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Gap 1", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{sol2}", "maxValue": "{sol2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "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": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}], "resources": []}]}], "contributors": [{"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}, {"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}