// Numbas version: finer_feedback_settings {"name": "BS3.3", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["pre", "descx1", "something", "thisnumber", "what", "things", "descx", "tol", "prob", "thisaswell", "else", "thismany", "number1", "post", "prob2", "prob1", "thatnumber", "this", "v", "tprob1", "tprob2", "sd"], "name": "BS3.3", "tags": ["Binomial Distribution", "Binomial distribution", "Probability", "binomial distribution", "expectation", "expected number", "probabilities", "probability", "sc", "standard deviation", "statistical distributions", "statistics"], "preamble": {"css": "", "js": ""}, "advice": "
1. $X \\sim \\operatorname{bin}(\\var{number1},\\var{prob})$, so $n= \\var{number1},\\;\\;p=\\var{prob}$.
\n2. The expectation is given by $\\operatorname{E}[X]=n\\times p=\\var{number1}\\times \\var{prob}=\\var{number1*prob}$
\n3. $\\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.
\n1. \\[ \\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.
\n2.
\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*} \\]
\nto 3 decimal places.
\n", "rulesets": {}, "parts": [{"prompt": "
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]]
\nFind $\\operatorname{E}[X]$ the expected {descX1}
\n$\\operatorname{E}[X]=$ [[2]]
\nFind the standard deviation for the {descX1}
\nStandard deviation = [[3]] (to 3 decimal places).
", "marks": 0, "gaps": [{"allowFractions": false, "marks": 0.25, "maxValue": "number1", "minValue": "number1", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.25, "maxValue": "prob", "minValue": "prob", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "number1*thismany/100", "minValue": "number1*thismany/100", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "sd+tol", "minValue": "sd-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "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}
\nProbability = [[1]] (to 3 decimal places).
", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "prob1+tol", "minValue": "prob1-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "prob2+tol", "minValue": "prob2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n{pre} $\\var{thismany}$ {post}
\n{something} $\\var{number1}$ {else}
\n\n \n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"pre": {"definition": "' '", "templateType": "anything", "group": "Ungrouped variables", "name": "pre", "description": ""}, "descx1": {"definition": "\"number of chocolate chip cookies in our sample:\"", "templateType": "anything", "group": "Ungrouped variables", "name": "descx1", "description": ""}, "something": {"definition": "''", "templateType": "anything", "group": "Ungrouped variables", "name": "something", "description": ""}, "thisnumber": {"definition": "if(number1<6,random(2..3), if(number1<8,random(2..4),random(3..6)))", "templateType": "anything", "group": "Ungrouped variables", "name": "thisnumber", "description": ""}, "what": {"definition": "\"daily sales.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "what", "description": ""}, "things": {"definition": "\"chocolate chip cookies.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "things", "description": ""}, "descx": {"definition": "\"the number of chocolate chip cookies\"", "templateType": "anything", "group": "Ungrouped variables", "name": "descx", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "prob": {"definition": "thismany/100", "templateType": "anything", "group": "Ungrouped variables", "name": "prob", "description": ""}, "thisaswell": {"definition": "\"our selection contains no more than \"", "templateType": "anything", "group": "Ungrouped variables", "name": "thisaswell", "description": ""}, "else": {"definition": "\"biscuits are selected at random.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "else", "description": ""}, "thismany": {"definition": "random(15..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "thismany", "description": ""}, "number1": {"definition": "random(5..12)", "templateType": "anything", "group": "Ungrouped variables", "name": "number1", "description": ""}, "post": {"definition": "\"% of biscuits made by a baker are chocolate chip cookies.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "post", "description": ""}, "prob2": {"definition": "precround(tprob2,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob2", "description": ""}, "prob1": {"definition": "precround(tprob1,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob1", "description": ""}, "thatnumber": {"definition": "random(1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "thatnumber", "description": ""}, "this": {"definition": "\"our selection contains exactly \"", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "v": {"definition": "if(thatnumber=1,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "description": ""}, "tprob1": {"definition": "comb(number1,thisnumber)*prob^thisnumber*(1-prob)^(number1-thisnumber)", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob1", "description": ""}, "tprob2": {"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))", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob2", "description": ""}, "sd": {"definition": "precround(sqrt(number1*prob*(1-prob)),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "sd", "description": ""}}, "metadata": {"notes": "\n \t\t \t\t \t\t
31/12/2012:
\n \t\t \t\t \t\tCan be configured to other applications using the string variables supplied. Hence added tag sc.
\n \t\t \t\t \t\tNot as yet properly tested.
\n \t\t \t\t \n \t\t \n \t\t", "description": "\n \t\t \t\tApplication of the binomial distribution given probabilities of success of an event.
\n \t\t \t\tFinding probabilities using the binomial distribution.
\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}