// Numbas version: finer_feedback_settings {"name": "STAT7008 (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 at least 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

", "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"}, "extensions": [], "rulesets": {}, "parts": [{"maxValue": "(q^n)+0.001", "correctAnswerFraction": false, "variableReplacements": [], "marks": "3", "correctAnswerStyle": "plain", "minValue": "(q^n)-0.001", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "unitTests": [], "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "type": "numberentry", "allowFractions": false, "scripts": {}, "showFeedbackIcon": true, "prompt": "

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

", "showCorrectAnswer": true}, {"maxValue": "answer2 +0.001", "correctAnswerFraction": false, "variableReplacements": [], "marks": "5", "correctAnswerStyle": "plain", "minValue": "answer2 -0.001", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "unitTests": [], "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "mustBeReduced": false, "type": "numberentry", "allowFractions": false, "scripts": {}, "showFeedbackIcon": true, "prompt": "

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

", "showCorrectAnswer": true}], "advice": "

Part (a)

\n

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

\n

where $p$ is the probability of success for each trial and $q$ is the probability of failure for each trial.

\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(\\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)

\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})=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

\n

Then 

\n

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

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

probability that r = 1

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

more than r of the students cycle to college

"}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(0.1..0.4#0.05)", "templateType": "anything", "description": "

the probability that an individual student cycles to college

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

probability that r = 0

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

probability that r = 2

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

probability tha an individual does not cycle to college

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

probability that r = 3

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

sample size

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

percentage of students that cycle to college

"}}, "variable_groups": [], "functions": {}, "ungrouped_variables": ["p", "p_perc", "n", "q", "r", "pr0", "pr1", "pr2", "pr3", "answer1", "answer2", "qn", "r0", "n2"], "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/"}]}]}], "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/"}]}