// Numbas version: exam_results_page_options {"name": "Calculate probabilities from binomial distribution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"thisnumber": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(number1<6,random(2..3), if(number1<8,random(2..4),random(3..6)))", "description": "", "name": "thisnumber"}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "description": "", "name": "tol"}, "descx1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"number of chocolate chip cookies in our sample:\"", "description": "", "name": "descx1"}, "thismany": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15..20)", "description": "", "name": "thismany"}, "post": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"% of biscuits made by a baker are chocolate chip cookies.\"", "description": "", "name": "post"}, "prob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tprob1,3)", "description": "", "name": "prob1"}, "this": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"our selection contains exactly \"", "description": "", "name": "this"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(thatnumber=1,0,1)", "description": "", "name": "v"}, "prob": {"templateType": "anything", "group": "Ungrouped variables", "definition": "thismany/100", "description": "", "name": "prob"}, "tprob1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "comb(number1,thisnumber)*prob^thisnumber*(1-prob)^(number1-thisnumber)", "description": "", "name": "tprob1"}, "else": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"biscuits are selected at random.\"", "description": "", "name": "else"}, "something": {"templateType": "anything", "group": "Ungrouped variables", "definition": "''", "description": "", "name": "something"}, "thisaswell": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"our selection contains no more than \"", "description": "", "name": "thisaswell"}, "things": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"chocolate chip cookies.\"", "description": "", "name": "things"}, "descx": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"the number of chocolate chip cookies\"", "description": "", "name": "descx"}, "sd": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sqrt(number1*prob*(1-prob)),3)", "description": "", "name": "sd"}, "thatnumber": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "name": "thatnumber"}, "tprob2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(thatnumber=2,(1-prob)^number1+number1*prob*(1-prob)^(number1-1)+number1*(number1-1)*prob^2*(1-prob)^(number1-2)/2,(1-prob)^number1+number1*prob*(1-prob)^(number1-1))", "description": "", "name": "tprob2"}, "prob2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(tprob2,3)", "description": "", "name": "prob2"}, "what": {"templateType": "anything", "group": "Ungrouped variables", "definition": "\"daily sales.\"", "description": "", "name": "what"}, "pre": {"templateType": "anything", "group": "Ungrouped variables", "definition": "' '", "description": "", "name": "pre"}, "number1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..12)", "description": "", "name": "number1"}}, "ungrouped_variables": ["pre", "descx1", "something", "thisnumber", "what", "things", "descx", "tol", "prob", "thisaswell", "else", "thismany", "number1", "post", "prob2", "prob1", "thatnumber", "this", "v", "tprob1", "tprob2", "sd"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Calculate probabilities from binomial distribution", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "number1", "minValue": "number1", "correctAnswerFraction": false, "marks": 0.25, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "prob", "minValue": "prob", "correctAnswerFraction": false, "marks": 0.25, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "number1*thismany/100", "minValue": "number1*thismany/100", "correctAnswerFraction": false, "marks": 0.5, "showPrecisionHint": false}, {"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sd+tol", "minValue": "sd-tol", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n

Assuming a binomial distribution for $X$ , {descX}, write down the values of $n$ and $p$.

\n

$X \\sim \\operatorname{bin}(n,p)$

\n

$n=\\; $?[[0]]        $p=\\;$?[[1]]

\n

Find $\\operatorname{E}[X]$ the expected {descX1}

\n

$\\operatorname{E}[X]=$?[[2]]

\n

Find the standard deviation for the {descX1}

\n

Standard deviation = ? [[3]] (to 3 decimal places).

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

Find the probability that {this} $\\var{thisnumber}$ {things}

\n

$\\operatorname{P}(X=\\var{thisnumber})=$? [[0]] (to 3 decimal places).

\n

 

\n

Find the probability that {thisaswell} {thatnumber} {things}

\n

Probability = ? [[1]] (to 3 decimal places).

\n\n \n \n", "showCorrectAnswer": true, "marks": 0}], "statement": "\n

{pre} $\\var{thismany}$ {post}

\n

{something} $\\var{number1}$ {else}

\n

 

\n\n \n \n", "tags": ["acc1012", "ACC1012", "binomial distribution", "Binomial Distribution", "Binomial distribution", "checked2015", "expectation", "expected number", "probabilities", "probability", "Probability", "sc", "standard deviation", "statistical distributions", "statistics"], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n\t\t \t\t \t\t \t\t \t\t

31/12/2012:

\n\t\t \t\t \t\t \t\t \t\t

Can be configured to other applications using the string variables supplied. Hence added tag sc.

\n\t\t \t\t \t\t \t\t \t\t

Not as yet properly tested.

\n\t\t \t\t \t\t \t\t \n\t\t \t\t \t\t \n\t\t \t\t \n\t\t \n\t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "\n\t\t \t\t \t\t \t\t

Application of the binomial distribution given probabilities of success of an event.

\n\t\t \t\t \t\t \t\t

Finding probabilities using the binomial distribution.

\n\t\t \t\t \t\t \n\t\t \t\t \n\t\t \n\t\t"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n

a)

\n

1. $X \\sim \\operatorname{bin}(\\var{number1},\\var{prob})$, so $n= \\var{number1},\\;\\;p=\\var{prob}$.

\n

2. The expectation is given by $\\operatorname{E}[X]=n\\times p=\\var{number1}\\times \\var{prob}=\\var{number1*prob}$

\n

3. $\\operatorname{stdev}(X)=\\sqrt{n\\times p \\times (1-p)}=\\sqrt{\\var{number1}\\times \\var{prob} \\times \\var{1-prob}}=\\var{sd}$ to 3 decimal places.

\n

b)

\n

1. \\[ \\begin{eqnarray*}\\operatorname{P}(X = \\var{thisnumber}) &=& \\dbinom{\\var{number1}}{\\var{thisnumber}}\\times\\var{prob}^{\\var{thisnumber}}\\times(1-\\var{prob})^{\\var{number1-thisnumber}}\\\\& =& \\var{comb(number1,thisnumber)} \\times\\var{prob}^{\\var{thisnumber}}\\times\\var{1-prob}^{\\var{number1-thisnumber}}\\\\&=&\\var{prob1}\\end{eqnarray*} \\] to 3 decimal places.

\n

 

\n

2. 

\n

\\[ \\begin{eqnarray*}\\operatorname{P}(X \\leq \\var{thatnumber})& =& \\simplify[all,!collectNumbers]{P(X = 0) + P(X = 1) + {v}*P(X = 2)}\\\\& =& \\simplify[zeroFactor,zeroTerm,unitFactor]{{1 -prob} ^ {number1}+ {number1} *{prob} *{1 -prob} ^ {number1 -1} + {v} * ({number1} * {number1 -1}/2)* {prob} ^ 2 *( {1 -prob} ^ {number1 -2})}\\\\& =& \\var{prob2}\\end{eqnarray*} \\]

\n

to 3 decimal places.

\n

 

\n\n \n \n", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}