// Numbas version: exam_results_page_options {"name": "Alex's copy of Binomial (practice of formula)", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Alex's copy of Binomial (practice of formula)", "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["stats"], "functions": {}, "ungrouped_variables": ["w", "ans1", "ans2", "n", "p", "v3", "v4", "tol", "x2", "x1", "tans1", "tans2"], "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"]}, "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"], "variables": {"n": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(6..20)", "name": "n"}, "p": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(0.1..0.9#0.1)", "name": "p"}, "x2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2,3,4)", "name": "x2"}, "ans2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "precround(tans2,3)", "name": "ans2"}, "v3": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "switch(x2>2,1,0)", "name": "v3"}, "tol": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "0.001", "name": "tol"}, "tans1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "binomialPDF(x1,n,p)", "name": "tans1"}, "ans1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "precround(tans1,3)", "name": "ans1"}, "v4": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "switch(x2>3,1,0)", "name": "v4"}, "w": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..100)", "name": "w"}, "x1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "round((w+(100-w)*(n-1))/100)", "name": "x1"}, "tans2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "binomialCDF(x2,n,p)", "name": "tans2"}}, "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}$.

", "preamble": {"css": "", "js": ""}, "variable_groups": [], "parts": [{"variableReplacements": [], "marks": 0, "type": "gapfill", "prompt": "\n \n \n

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

\n \n \n ", "variableReplacementStrategy": "originalfirst", "gaps": [{"variableReplacements": [], "minValue": "{ans1-tol}", "type": "numberentry", "scripts": {}, "maxValue": "{ans1+tol}", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "marks": 1, "showPrecisionHint": false, "showCorrectAnswer": true, "correctAnswerFraction": false}], "scripts": {}, "showCorrectAnswer": true}, {"variableReplacements": [], "marks": 0, "type": "gapfill", "prompt": "

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

", "variableReplacementStrategy": "originalfirst", "gaps": [{"variableReplacements": [], "minValue": "{ans2-tol}", "type": "numberentry", "scripts": {}, "maxValue": "{ans2+tol}", "variableReplacementStrategy": "originalfirst", "allowFractions": false, "marks": 1, "showPrecisionHint": false, "showCorrectAnswer": true, "correctAnswerFraction": false}], "scripts": {}, "showCorrectAnswer": true}], "type": "question", "showQuestionGroupNames": false, "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"}, "question_groups": [{"pickQuestions": 0, "name": "", "pickingStrategy": "all-ordered", "questions": []}], "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}]}], "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}