// Numbas version: exam_results_page_options {"name": "Binomial (practice of formula)", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Binomial (practice of formula)", "tags": ["binomial distribution", "Binomial Distribution", "Binomial distribution", "CDF", "cdf", "CDF of binomial distribution", "cr1", "cumulative density function", "Discrete random variables.", "distributions", "Expectation of binomial distribution", "probability", "Probability", "random variables", "REBEL", "rebel", "Rebel", "rebelmaths", "statistics", "tested1", "variance of binomial distribution"], "metadata": {"description": "

$X \\sim \\operatorname{Binomial}(n,p)$. Find $P(X=a)$, $P(X \\leq b)$, $E[X],\\;\\operatorname{Var}(X)$.

\n

rebelmaths

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

Answer the following questions on the Binomial Distribution.

\n

Suppose \\[X \\sim \\operatorname{Binomial}(\\var{n},\\var{p}),\\]

\n

that is $n=\\var{n}$ and $p=\\var{p}$.

", "advice": "

a)
\\[\\simplify[std,!otherNumbers]{P(X = {x1}) = {n}! / ({n -x1}! * {x1}!) * {p} ^ {x1} * (1 -{p}) ^ {n -x1}} = \\var{ans1}\\]

\n

to 3 decimal places.

\n

b)

\n

We have:

\n

\\[ \\begin{eqnarray*} F_X (\\var{x2}) &=& P(X \\le \\var{x2}) =\\simplify[std]{ P(X = 0) + P(X = 1) + P(X = 2) + {v3} * P(X = 3) + {v4} * P(X = 4)}\\\\ &=& \\simplify[unitFactor,zeroTerm,zeroFactor]{(1 -{p}) ^ {n} + {n} * (1 -{p}) ^ {n -1} * {p} + {(n * (n -1)) / 2} * (1 -{p}) ^ {n -2} * {p} ^ 2 + {v3} * {Comb(n , 3)} * (1 -{p}) ^ {n -3} * {p} ^ 3 + {v4} * {Comb(n , 4)} * (1 -{p}) ^ {n -4} * {p} ^ 4}\\\\ &=&\\var{ans2} \\end{eqnarray*} \\]
to 3 decimal places.

\n

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "extensions": ["stats"], "variables": {"w": {"name": "w", "group": "Ungrouped variables", "definition": "random(1..100)", "description": "", "templateType": "anything"}, "ans1": {"name": "ans1", "group": "Ungrouped variables", "definition": "precround(tans1,3)", "description": "", "templateType": "anything"}, "ans2": {"name": "ans2", "group": "Ungrouped variables", "definition": "precround(tans2,3)", "description": "", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(6..20)", "description": "", "templateType": "anything"}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(0.1..0.9#0.1)", "description": "", "templateType": "anything"}, "v3": {"name": "v3", "group": "Ungrouped variables", "definition": "switch(x2>2,1,0)", "description": "", "templateType": "anything"}, "v4": {"name": "v4", "group": "Ungrouped variables", "definition": "switch(x2>3,1,0)", "description": "", "templateType": "anything"}, "tol": {"name": "tol", "group": "Ungrouped variables", "definition": "0.001", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(2,3,4)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Ungrouped variables", "definition": "round((w+(100-w)*(n-1))/100)", "description": "", "templateType": "anything"}, "tans1": {"name": "tans1", "group": "Ungrouped variables", "definition": "binomialPDF(x1,n,p)", "description": "", "templateType": "anything"}, "tans2": {"name": "tans2", "group": "Ungrouped variables", "definition": "binomialCDF(x2,n,p)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["w", "ans1", "ans2", "n", "p", "v3", "v4", "tol", "x2", "x1", "tans1", "tans2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Compute $P(r=\\var{x1})=\\;\\;$[[0]] (to 3 decimal places).

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{ans1-tol}", "maxValue": "{ans1+tol}", "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, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Compute $P(r\\le\\var{x2})=\\;\\;$[[0]] (to 3 decimal places).

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{ans2-tol}", "maxValue": "{ans2+tol}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}]}