// Numbas version: finer_feedback_settings {"name": "Binomial Distribution (Cycling)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Binomial Distribution (Cycling)", "tags": ["Binomial", "binomial", "rebel", "REBEL", "Rebel", "rebelmaths"], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "
Please give your answer to at least 3 decimal places.
\nIt is estimated that $\\var{p_perc}$% of all maths students cycle to college. A random sample of $\\var{n}$ maths students is chosen.
\nHint: for this question use the binomial distribution.
\n", "advice": "Part (a)
\nIf a random variable $X$ follows a binomial distribution with parameters $n$ and $p$. The probability of $r$ successes out of $n$ trials is given by:
\n$P(X=r)=P(r,n)=C^n_{r}p^{r}q^{n-r}$
\nwhere $p$ is the probability of success for each trial and $q$ is the probability of failure for each trial.
\nThe probability that a student cycles to college is $\\var{p}$, therefore $p=\\var{p}$ and $q=1-\\var{p}=\\var{q}$.
\nWe are interested in claculating the probability that none of the sample of $\\var{n}$ students cycle to college so $r=0$ and $n=\\var{n}$
\n$P(\\var{r0}, \\var{n})= C^\\var{n}_{\\var{r0}}$ $\\var{p}^\\var{r0}$ $\\var{q}^{\\var{n}-\\var{r0}}$
\n$P(\\var{r0}, \\var{n})= \\var{pr0}$
\n\n
Part (b)
\nWe are interested in claculating the probability that at least $\\var{r}$ of the $\\var{n}$ students cycle to college. Let $X$ represent the number of students that cycle to college. We need to calculate:
\n$P(X \\geq \\var{r}) = P(X= \\var{r}) + P(X= \\var{r+1})+...+ P(X=\\var{n})$
\n\n
Since $P(X=\\var{r0})+P(X=\\var{r0+1})+...+P(X=\\var{n})=\\var{r0+1}$
\nWe may write
\n$P(X \\geq \\var{r}) = 1-P(X= \\var{r0}) - P(X=\\var{r0+1})-...- P(X=\\var{r-1})$
\n\n
where
\n$P(X= \\var{r0})=P(\\var{r0}, \\var{n})= C^\\var{n}_{\\var{r0}}$ $\\var{p}^\\var{r0}$ $\\var{q}^{\\var{n}-\\var{r0}}=\\var{pr0}$
\n$P(X=1) =P(1, \\var{n})= C^\\var{n}_{1}$ $\\var{p}^{1}$ $\\var{q}^{\\var{n}-1}$ $=\\var{pr1}$
\n$P(X=2) = P(2, \\var{n})=$ $C^\\var{n}_{2}$ $\\var{p}^{2}$ $\\var{q}^{\\var{n}-2}$ $=\\var{pr2}$
\n\nThen
\n$P(X \\geq \\var{r}) = 1-\\var{qn}-\\var{pr1}-\\var{pr2}=\\var{answer2}$
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"pr1": {"name": "pr1", "group": "Ungrouped variables", "definition": "n*p*q^(n-1)", "description": "probability that r = 1
", "templateType": "anything", "can_override": false}, "r0": {"name": "r0", "group": "Ungrouped variables", "definition": "0", "description": "", "templateType": "anything", "can_override": false}, "p_perc": {"name": "p_perc", "group": "Ungrouped variables", "definition": "p*100", "description": "percentage of students that cycle to college
", "templateType": "anything", "can_override": false}, "pr2": {"name": "pr2", "group": "Ungrouped variables", "definition": "((n*(n-1))/2)*(p^2)*q^(n-2)", "description": "probability that r = 2
", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "1-p", "description": "probability tha an individual does not cycle to college
", "templateType": "anything", "can_override": false}, "answer2": {"name": "answer2", "group": "Ungrouped variables", "definition": "1-answer1", "description": "", "templateType": "anything", "can_override": false}, "pr3": {"name": "pr3", "group": "Ungrouped variables", "definition": "((n*(n-1)*(n-2))/6)*(p^3)*(q^(n-3))", "description": "probability that r = 3
", "templateType": "anything", "can_override": false}, "r": {"name": "r", "group": "Ungrouped variables", "definition": "3", "description": "more than r of the students cycle to college
", "templateType": "anything", "can_override": false}, "n2": {"name": "n2", "group": "Ungrouped variables", "definition": "n-2", "description": "", "templateType": "anything", "can_override": false}, "answer1": {"name": "answer1", "group": "Ungrouped variables", "definition": "if(r=2,pr0+pr1, pr0+pr1+pr2)", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(0.1..0.4#0.05)", "description": "the probability that an individual student cycles to college
", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(6..12)", "description": "sample size
", "templateType": "anything", "can_override": false}, "qn": {"name": "qn", "group": "Ungrouped variables", "definition": "q^n", "description": "", "templateType": "anything", "can_override": false}, "pr0": {"name": "pr0", "group": "Ungrouped variables", "definition": "q^n", "description": "probability that r = 0
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["p", "p_perc", "n", "q", "r", "pr0", "pr1", "pr2", "pr3", "answer1", "answer2", "qn", "r0", "n2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the probability that none of the $\\var{n}$ students in the sample cycle to college.
", "minValue": "(q^n)-0.001", "maxValue": "(q^n)+0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the probability that at least $\\var{r}$ of the $\\var{n}$ students cycle to college.
", "minValue": "answer2 -0.001", "maxValue": "answer2 +0.001", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Yvonne Wancke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3703/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "Yvonne Wancke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3703/"}]}