// 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": {}, "parts": [{"variableReplacements": [], "gaps": [{"variableReplacements": [], "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "minValue": "{answer1}", "correctAnswerFraction": false, "maxValue": "{answer1}", "mustBeReducedPC": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "showPrecisionHint": true, "allowFractions": false, "precisionType": "dp", "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precision": "3", "correctAnswerStyle": "plain", "strictPrecision": false, "showFeedbackIcon": true, "precisionPartialCredit": 0, "showCorrectAnswer": true, "marks": 1}], "variableReplacementStrategy": "originalfirst", "type": "gapfill", "showCorrectAnswer": true, "marks": 0, "showFeedbackIcon": true, "scripts": {}, "prompt": "

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

"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": ""}, "name": "binomial 2", "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

", "variables": {"prob_a": {"name": "prob_a", "definition": "{prob_0}+{prob_1}", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "n2": {"name": "n2", "definition": "random(1..2#1)", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "answer1": {"name": "answer1", "definition": "if(n2=1,prob_a,prob_b)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "prob_0": {"name": "prob_0", "definition": "(1-{p1})^({n1})", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "prob_1": {"name": "prob_1", "definition": "{n1}*{p1}*(1-{p1})^({n1}-1)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "prob_b": {"name": "prob_b", "definition": "prob_a+prob_2", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "n1": {"name": "n1", "definition": "random(12..36#1)", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}, "q": {"name": "q", "definition": "1-{p1}", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "prob_2": {"name": "prob_2", "definition": "comb({n1},2)*{p1}^2*(1-{p1})^({n1}-2)", "group": "Ungrouped variables", "templateType": "anything", "description": ""}, "p1": {"name": "p1", "definition": "random(0.05..0.25#0.01)", "group": "Ungrouped variables", "templateType": "randrange", "description": ""}}, "functions": {}, "preamble": {"css": "", "js": ""}, "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

", "tags": [], "ungrouped_variables": ["n1", "n2", "p1", "prob_0", "prob_1", "prob_2", "prob_a", "prob_b", "answer1", "q"], "extensions": [], "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}