// Numbas version: exam_results_page_options {"name": "Simon's copy of Binomial Distribution (Cycling)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

Please give your answer to 3 decimal places.

\n

It is estimated that $\\var{p_perc}$% of all CIT students cycle to college. A random sample of $\\var{n}$ CIT students is chosen.

\n

", "parts": [{"minValue": "(q^n)", "precision": "3", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false, "showPrecisionHint": true, "prompt": "

Calculate the probability that none of the $\\var{n}$ students in the sample cycle to college.

", "scripts": {}, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "precisionPartialCredit": 0, "allowFractions": false, "precisionType": "dp", "mustBeReducedPC": 0, "type": "numberentry", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "(q^n)", "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "marks": "1"}, {"minValue": "answer2 ", "precision": "3", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "mustBeReduced": false, "variableReplacements": [], "correctAnswerFraction": false, "showPrecisionHint": true, "prompt": "

Calculate the probability that at least $\\var{r}$ of the $\\var{n}$ students cycle to college.

", "scripts": {}, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "precisionPartialCredit": 0, "allowFractions": false, "precisionType": "dp", "mustBeReducedPC": 0, "type": "numberentry", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "answer2 ", "showFeedbackIcon": true, "precisionMessage": "You have not given your answer to the correct precision.", "showCorrectAnswer": true, "marks": "2"}], "variables": {"pr2": {"name": "pr2", "description": "

probability that r = 2

", "definition": "((n*(n-1))/2)*(p^2)*q^(n-2)", "group": "Ungrouped variables", "templateType": "anything"}, "p_perc": {"name": "p_perc", "description": "

percentage of students that cycle to college

", "definition": "p*100", "group": "Ungrouped variables", "templateType": "anything"}, "q": {"name": "q", "description": "

probability tha an individual does not cycle to college

", "definition": "1-p", "group": "Ungrouped variables", "templateType": "anything"}, "n": {"name": "n", "description": "

sample size

", "definition": "random(6..12)", "group": "Ungrouped variables", "templateType": "anything"}, "pr3": {"name": "pr3", "description": "

probability that r = 3

", "definition": "((n*(n-1)*(n-2))/6)*(p^3)*(q^(n-3))", "group": "Ungrouped variables", "templateType": "anything"}, "p": {"name": "p", "description": "

the probability that an individual student cycles to college

", "definition": "random(0.1..0.4#0.05)", "group": "Ungrouped variables", "templateType": "anything"}, "answer2": {"name": "answer2", "description": "", "definition": "1-answer1", "group": "Ungrouped variables", "templateType": "anything"}, "answer1": {"name": "answer1", "description": "", "definition": "if(r=2,pr0+pr1, pr0+pr1+pr2)", "group": "Ungrouped variables", "templateType": "anything"}, "qn": {"name": "qn", "description": "", "definition": "q^n", "group": "Ungrouped variables", "templateType": "anything"}, "pr0": {"name": "pr0", "description": "

probability that r = 0

", "definition": "q^n", "group": "Ungrouped variables", "templateType": "anything"}, "r": {"name": "r", "description": "

more than r of the students cycle to college

", "definition": "3", "group": "Ungrouped variables", "templateType": "anything"}, "r0": {"name": "r0", "description": "", "definition": "0", "group": "Ungrouped variables", "templateType": "anything"}, "n2": {"name": "n2", "description": "", "definition": "n-2", "group": "Ungrouped variables", "templateType": "anything"}, "pr1": {"name": "pr1", "description": "

probability that r = 1

", "definition": "n*p*q^(n-1)", "group": "Ungrouped variables", "templateType": "anything"}}, "tags": [], "preamble": {"js": "", "css": ""}, "rulesets": {}, "functions": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"description": "

It is estimated that 30% of all CIT students cycle to college. If a random sample of eight CIT students is chosen, calculate the probability that...

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "name": "Simon's copy of Binomial Distribution (Cycling)", "ungrouped_variables": ["p", "p_perc", "n", "q", "r", "pr0", "pr1", "pr2", "pr3", "answer1", "answer2", "qn", "r0", "n2"], "variable_groups": [], "extensions": [], "advice": "

(a)

\n

If a random variable $X$ follows a binomial distribution with parameters $n$ and $p$, then the probability of $r$ successes out of $n$ trials is given by:

\n

$P(X=r)=\\binom{n}{r}p^{r}q^{n-r}$

\n

where

\n

$p=$ probability of success for each trial, $q=1-p=$probability of failure for each trial, and $\\binom{n}{r} = ^nC_r= \\frac{n!}{r!(n-r)!}$

\n

\n

The probability that a student cycles to college is $\\var{p}$, therefore $p=\\var{p}$ and $q=1-\\var{p}=\\var{q}$.

\n

We 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(X=\\var{r0})= \\binom{\\var{n}}{\\var{r0}}\\times \\var{p}^0 \\times \\var{q}^{\\var{n}-0}=\\var{precround(pr0,5)}$

\n

\n

(b)

\n

We 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}$ 

\n

We 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})= \\binom{\\var{n}}{\\var{r0}}$ $\\var{p}^\\var{r0}$ $\\var{q}^{\\var{n}-\\var{r0}}=\\var{precround(pr0,5)}$ 

\n

$P(X=1) = \\binom{\\var{n}}{\\var{1}}$ $\\var{p}^{1}$ $\\var{q}^{\\var{n}-1}$ $=\\var{precround(pr1,5)}$

\n

$P(X=2) =\\binom{\\var{n}}{\\var{2}}$ $\\var{p}^{2}$ $\\var{q}^{\\var{n}-2}$ $=\\var{precround(pr2,5)}$

\n

\n

Then 

\n

$P(X \\geq \\var{r}) = 1-\\var{precround(qn,5)}-\\var{precround(pr1,5)}-\\var{precround(pr2,5)}=\\var{precround(answer2,5)}$

", "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}