// Numbas version: exam_results_page_options {"name": "binomial 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "tags": [], "functions": {}, "name": "binomial 2", "ungrouped_variables": ["n1", "n2", "p1", "prob_0", "prob_1", "prob_2", "prob_a", "prob_b", "answer1", "q"], "parts": [{"variableReplacementStrategy": "originalfirst", "gaps": [{"notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReduced": false, "strictPrecision": false, "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "minValue": "{answer1}", "scripts": {}, "marks": 1, "showFeedbackIcon": true, "showPrecisionHint": true, "precisionPartialCredit": 0, "precisionType": "dp", "type": "numberentry", "correctAnswerFraction": false, "maxValue": "{answer1}", "precision": "3"}], "showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "prompt": "

What is the probability that at most \\(\\var{n2}\\) of them will develop symptoms?  [[0]]

", "variableReplacements": [], "scripts": {}, "marks": 0}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"prob_a": {"name": "prob_a", "description": "", "definition": "{prob_0}+{prob_1}", "templateType": "anything", "group": "Ungrouped variables"}, "n2": {"name": "n2", "description": "", "definition": "random(1..2#1)", "templateType": "randrange", "group": "Ungrouped variables"}, "prob_2": {"name": "prob_2", "description": "", "definition": "comb({n1},2)*{p1}^2*(1-{p1})^({n1}-2)", "templateType": "anything", "group": "Ungrouped variables"}, "prob_b": {"name": "prob_b", "description": "", "definition": "prob_a+prob_2", "templateType": "anything", "group": "Ungrouped variables"}, "prob_1": {"name": "prob_1", "description": "", "definition": "{n1}*{p1}*(1-{p1})^({n1}-1)", "templateType": "anything", "group": "Ungrouped variables"}, "p1": {"name": "p1", "description": "", "definition": "random(0.05..0.25#0.01)", "templateType": "randrange", "group": "Ungrouped variables"}, "answer1": {"name": "answer1", "description": "", "definition": "if(n2=1,prob_a,prob_b)", "templateType": "anything", "group": "Ungrouped variables"}, "prob_0": {"name": "prob_0", "description": "", "definition": "(1-{p1})^({n1})", "templateType": "anything", "group": "Ungrouped variables"}, "q": {"name": "q", "description": "", "definition": "1-{p1}", "templateType": "anything", "group": "Ungrouped variables"}, "n1": {"name": "n1", "description": "", "definition": "random(12..36#1)", "templateType": "randrange", "group": "Ungrouped variables"}}, "extensions": [], "type": "question", "preamble": {"js": "", "css": ""}, "advice": "

The probability of succumbing to a particular virus is \\(\\var{p1}\\).

\n

The probability that at most \\(\\var{n2}\\) of them will develop symptoms is expressed as \\(P(X\\le \\var{n2})\\)

\n

\n

The binomial distribution gives: \\(P(X=k)=\\binom{n}{k}p^k(1-p)^{n-k}\\)

\n

\n

\\(P(X=0)=\\binom{\\var{n1}}{0}(\\var{p1})^{0}(\\var{q})^{\\var{n1}}\\)

\n

\\(P(X=0)=(1)(1)(\\simplify{{q}^{{n1}}})\\)

\n

\\(P(X=0)=\\var{prob_0}\\)

\n

Similarly

\n

\\(P(X=1)=\\binom{\\var{n1}}{1}(\\var{p1})^{1}(\\var{q})^{\\simplify{{n1}-1}}\\)

\n

\\(P(X=1)=\\var{prob_1}\\)

\n

And

\n

\\(P(X=2)=\\binom{\\var{n1}}{2}(\\var{p1})^{2}(\\var{q})^{\\simplify{{n1}-2}}\\)

\n

\\(P(X=2)=\\var{prob_2}\\)

\n

So

\n

\\(P(X\\le 1)=\\var{prob_0}+\\var{prob_1}=\\var{prob_a}\\)

\n

\\(P(X\\le 2)=\\var{prob_0}+\\var{prob_1}+\\var{prob_2}=\\var{prob_b}\\)

\n

", "statement": "

The probability of succumbing to a particular virus is \\(\\var{p1}\\).

\n

A group of \\(\\var{n1}\\) patients were exposed to the virus. 

\n

", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}