// Numbas version: finer_feedback_settings {"name": "Tom 1341cba2b extra", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"p2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..p1-0.1)", "name": "p2", "description": ""}, "tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.001", "name": "tol", "description": ""}, "n": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(7..12)", "name": "n", "description": ""}, "p1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.5..0.8)", "name": "p1", "description": ""}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..5)", "name": "m", "description": ""}, "q": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.05..0.2)", "name": "q", "description": ""}, "pcont": {"templateType": "anything", "group": "Ungrouped variables", "definition": "binomialpdf(m,n,p2)*q/psurvive", "name": "pcont", "description": ""}, "psurvive": {"templateType": "anything", "group": "Ungrouped variables", "definition": "binomialpdf(m,n,p1)*(1-q)+ binomialpdf(m,n,p2)*q", "name": "psurvive", "description": ""}, "anspcont": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pcont,3)", "name": "anspcont", "description": ""}, "anspsurvive": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(psurvive,3)", "name": "anspsurvive", "description": ""}}, "ungrouped_variables": ["p2", "p1", "psurvive", "m", "n", "q", "pcont", "tol", "anspsurvive", "anspcont"], "rulesets": {}, "name": "Tom 1341cba2b extra", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["

Binomial

", "

Geometric

", "

Poisson

", "

Other

"], "matrix": [1, 0, 0, 0], "distractors": ["", "", "", ""], "shuffleChoices": true, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "displayColumns": 0, "marks": 0}], "type": "gapfill", "prompt": "

Which probability distribution is best suited to represent the number of cells that die (assuming you know whether or not the equipment is contaminated)?[[0]]

\n

 

", "showCorrectAnswer": true, "marks": 0}, {"showCorrectAnswer": true, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "anspsurvive-tol", "prompt": "

If it's not known whether the equipment is contaminated, what is the probability that $\\var{m}$ cultures survive longer than a week?

\n

Probability = ? (to 3 decimal places).

", "marks": 1, "maxValue": "anspsurvive+tol"}, {"showCorrectAnswer": true, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "correctAnswerFraction": false, "minValue": "anspcont-tol", "prompt": "

Given that $\\var{m}$ cultures survive longer than a week, what is the probability that the equipment was contaminated? (Use the value to at least 5 decimal places from part b) rather than the value to 3 decimal places).

\n

Probability=? (to 3 decimal places).

", "marks": 1, "maxValue": "anspcont+tol"}], "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

In a laboratory experiment $\\var{n}$ yeast cultures are grown and the number that are still alive after one week is counted. Each culture independently survives longer than a week with probability $p = \\var{p1}$. However, there is a probability $\\var{q}$ that the laboratory equipment is contaminated. If that is the case, then all the cultures are affected, and the probability of survival after one week drops to $p = \\var{p2}$.

\n

 

", "tags": ["checked2015", "junk"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": ""}, "advice": "

a) The binomial distribution.

\n

b) Using the law of total probability:

\n

\\[\\begin{eqnarray*}\\operatorname{Pr}(\\var{m}\\;\\text{ survive})&=&\\operatorname{Pr}(\\var{m}\\; \\text{survive|uncontaminated})\\operatorname{Pr}(\\text{uncontaminated})+\\operatorname{Pr}(\\var{m} \\;\\text{survive|contaminated})\\operatorname{Pr}(\\text{contaminated})\\\\&=&{\\var{n} \\choose\\var{m}}\\var{p1}^{\\var{m}}(1-\\var{p1})^{\\var{n-m}} \\times (1-\\var{q})+{\\var{n} \\choose\\var{m}}\\var{p2}^{\\var{m}}(1-\\var{p2})^{\\var{n-m}} \\times \\var{q}\\\\&=&\\var{psurvive}\\\\&=&\\var{anspsurvive}\\end{eqnarray*}\\] to 3 decimal places.

\n

c) By Baye's theorem:

\n

\\[\\begin{eqnarray*}\\operatorname{Pr}\\text{contaminated|}\\var{m}\\;\\text{survive})&=&\\frac{\\operatorname{Pr}(\\var{m} \\;\\text{survive|contaminated})\\operatorname{Pr}(\\text{contaminated})}{\\operatorname{Pr}(\\var{m}\\;\\text{ survive})}\\\\&=&\\frac{{\\var{n} \\choose\\var{m}}\\var{p2}^{\\var{m}}(1-\\var{p2})^{\\var{n-m}} \\times \\var{q}}{\\var{psurvive}}\\\\&=&\\var{anspcont}\\end{eqnarray*}\\] to 3 decimal places.

\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/"}]}