// Numbas version: exam_results_page_options {"name": "Probability: Binomial Distribution 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Probability: Binomial Distribution 1", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

A teacher has a small class of 4 students. On any given day there is a probability of $\\var{prob}$ that they will be asked a question by a student.

\n

The event of a student asking a question is independent of whether or not any other student asks a question.

", "advice": "

The answers involve binomial distributions because there are only 2 cases - a student either asks a question or they do not.

\n

Therefore, we want to apply the binomial distribution \\[ P(X=r) =\\, ^nC_r \\, p^r \\, (1-p)^{n-r}.\\]

\n

Let $X$ be the number of students who ask a question.

\n

Part (a):

\n

\\[ \\begin{split} P(X=4) &\\,= \\binom{4}{4} \\times \\var{prob}^4 \\times \\var{1-prob}^0 \\\\ &\\,= \\var{prob}^4 \\\\ &\\,= \\var{sol1}. \\end{split} \\]

\n

Part (b):

\n

{partb}

\n

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"prob": {"name": "prob", "group": "Ungrouped variables", "definition": "random(0.1..0.4 #0.1)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2,3)", "description": "", "templateType": "anything", "can_override": false}, "sol2": {"name": "sol2", "group": "Ungrouped variables", "definition": "if(n=2,6*prob^2*(1-prob)^2+4*prob^3*(1-prob)+sol1,4*prob^3*(1-prob)+sol1)", "description": "", "templateType": "anything", "can_override": false}, "sol1": {"name": "sol1", "group": "Ungrouped variables", "definition": "prob^4", "description": "", "templateType": "anything", "can_override": false}, "partb": {"name": "partb", "group": "Ungrouped variables", "definition": "if(n=2,'{b1}','{b2}')", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "\"

If the teacher is asked questions from at least 2 students, we are interested in \\\\[ P(X \\\\geq 2) = P(X=2) + P(X=3) + P(X=4).\\\\]

\\n

\\\\[ \\\\begin{split} &\\\\, P(X=2) = \\\\binom{4}{2} \\\\times \\\\var{prob}^2 \\\\times \\\\var{1-prob}^2 = \\\\var{6*prob^2*(1-prob)^2} \\\\\\\\ &\\\\, P(X=3) = \\\\binom{4}{3} \\\\times \\\\var{prob}^3 \\\\times \\\\var{1-prob} = \\\\var{4*prob^3*(1-prob)} \\\\\\\\\\\\\\\\ &\\\\, P(X=4) = \\\\var{prob}^4= \\\\var{sol1} .  \\\\end{split} \\\\]

\\n

Therefore,

\\n

\\\\[ P(X \\\\geq 2) = \\\\var{sol2}. \\\\]

\"", "description": "", "templateType": "long string", "can_override": false}, "b2": {"name": "b2", "group": "Ungrouped variables", "definition": "\"

If the teacher is asked questions from at least 3 students, we are interested in \\\\[ P(X \\\\geq 3) = P(X=3) + P(X=4).\\\\]

\\n

\\\\[ \\\\begin{split} &\\\\, P(X=3) = \\\\binom{4}{3} \\\\times \\\\var{prob}^3 \\\\times \\\\var{1-prob} = \\\\var{4*prob^3*(1-prob)} \\\\\\\\\\\\\\\\ &\\\\, P(X=4) = \\\\var{prob}^4= \\\\var{sol1} .  \\\\end{split} \\\\]

\\n

Therefore,

\\n

\\\\[ P(X \\\\geq 3) = \\\\var{sol2}. \\\\]

\"", "description": "", "templateType": "long string", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["prob", "n", "sol2", "sol1", "partb", "b1", "b2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the probability that on a particular day,

"}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The teacher is asked a question from all 4 students.

\n

[[0]]

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

The teacher is asked a question from at least $\\var{n}$ students.

\n

[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{sol2}", "maxValue": "{sol2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}]}], "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}