// Numbas version: exam_results_page_options {"name": "Probability, expectation and standard deviation of binomial distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "parts": [{"gaps": [{"marks": 0.25, "type": "numberentry", "maxValue": "number1", "showPrecisionHint": false, "minValue": "number1", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}, {"marks": 0.25, "type": "numberentry", "maxValue": "prob", "showPrecisionHint": false, "minValue": "prob", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}, {"marks": 0.5, "type": "numberentry", "maxValue": "number1*thismany/100", "showPrecisionHint": false, "minValue": "number1*thismany/100", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}, {"marks": 1, "type": "numberentry", "maxValue": "sd+tol", "showPrecisionHint": false, "minValue": "sd-tol", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}], "marks": 0, "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 ", "showCorrectAnswer": true, "scripts": {}}, {"gaps": [{"marks": 1, "type": "numberentry", "maxValue": "prob1+tol", "showPrecisionHint": false, "minValue": "prob1-tol", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}, {"marks": 1, "type": "numberentry", "maxValue": "prob2+tol", "showPrecisionHint": false, "minValue": "prob2-tol", "allowFractions": false, "showCorrectAnswer": true, "correctAnswerFraction": false, "scripts": {}}], "marks": 0, "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 ", "showCorrectAnswer": true, "scripts": {}}], "showQuestionGroupNames": false, "tags": ["checked2015", "MAS1403"], "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"thisnumber": {"group": "Ungrouped variables", "description": "", "definition": "if(number1<6,random(2..3), if(number1<8,random(2..4),random(3..6)))", "name": "thisnumber", "templateType": "anything"}, "v": {"group": "Ungrouped variables", "description": "", "definition": "if(thatnumber=1,0,1)", "name": "v", "templateType": "anything"}, "post": {"group": "Ungrouped variables", "description": "", "definition": "\"% of biscuits made by a baker are chocolate chip cookies.\"", "name": "post", "templateType": "anything"}, "thisaswell": {"group": "Ungrouped variables", "description": "", "definition": "\"our selection contains no more than \"", "name": "thisaswell", "templateType": "anything"}, "tprob2": {"group": "Ungrouped variables", "description": "", "definition": "binomialcdf(thatnumber,number1,prob)", "name": "tprob2", "templateType": "anything"}, "descx1": {"group": "Ungrouped variables", "description": "", "definition": "\"number of chocolate chip cookies in our sample:\"", "name": "descx1", "templateType": "anything"}, "tol": {"group": "Ungrouped variables", "description": "", "definition": "0.001", "name": "tol", "templateType": "anything"}, "sd": {"group": "Ungrouped variables", "description": "", "definition": "precround(sqrt(number1*prob*(1-prob)),3)", "name": "sd", "templateType": "anything"}, "thismany": {"group": "Ungrouped variables", "description": "", "definition": "random(15..20)", "name": "thismany", "templateType": "anything"}, "descx": {"group": "Ungrouped variables", "description": "", "definition": "\"the number of chocolate chip cookies\"", "name": "descx", "templateType": "anything"}, "pre": {"group": "Ungrouped variables", "description": "", "definition": "' '", "name": "pre", "templateType": "anything"}, "this": {"group": "Ungrouped variables", "description": "", "definition": "\"our selection contains exactly \"", "name": "this", "templateType": "anything"}, "something": {"group": "Ungrouped variables", "description": "", "definition": "''", "name": "something", "templateType": "anything"}, "prob1": {"group": "Ungrouped variables", "description": "", "definition": "precround(tprob1,3)", "name": "prob1", "templateType": "anything"}, "else": {"group": "Ungrouped variables", "description": "", "definition": "\"biscuits are selected at random.\"", "name": "else", "templateType": "anything"}, "prob": {"group": "Ungrouped variables", "description": "", "definition": "thismany/100", "name": "prob", "templateType": "anything"}, "prob2": {"group": "Ungrouped variables", "description": "", "definition": "precround(tprob2,3)", "name": "prob2", "templateType": "anything"}, "number1": {"group": "Ungrouped variables", "description": "", "definition": "random(5..12)", "name": "number1", "templateType": "anything"}, "tprob1": {"group": "Ungrouped variables", "description": "", "definition": "binomialpdf(thisnumber,number1,prob)", "name": "tprob1", "templateType": "anything"}, "things": {"group": "Ungrouped variables", "description": "", "definition": "\"chocolate chip cookies.\"", "name": "things", "templateType": "anything"}, "what": {"group": "Ungrouped variables", "description": "", "definition": "\"daily sales.\"", "name": "what", "templateType": "anything"}, "thatnumber": {"group": "Ungrouped variables", "description": "", "definition": "random(1,2)", "name": "thatnumber", "templateType": "anything"}}, "functions": {}, "rulesets": {}, "preamble": {"css": "", "js": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "\n \t\t

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

\n \t\t

Finding probabilities using the binomial distribution.

\n \t\t", "notes": "

31/12/2012:

\n

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

\n

Not as yet properly tested.

\n

13/01/2013:

\n

Used stats extension functions binomialpdf and binomialcdf instead of calculating insitu.

"}, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 0, "name": "", "questions": []}], "type": "question", "statement": "

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

\n

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

\n

 

\n

 

\n

 

\n

 

", "ungrouped_variables": ["pre", "descx1", "something", "thisnumber", "what", "things", "descx", "tol", "prob", "thisaswell", "else", "thismany", "number1", "post", "prob2", "prob1", "thatnumber", "this", "v", "tprob1", "tprob2", "sd"], "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 ", "name": "Probability, expectation and standard deviation of binomial distribution", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}