// Numbas version: exam_results_page_options {"name": "CMPU2012-Probability", "question_groups": [{"name": "Group", "pickQuestions": 1, "pickingStrategy": "all-ordered", "questions": [{"name": "Calculate probability of either of two events occurring based on frequency", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}], "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

Out of $\\var{ptotal}$ people, $\\var{p1}$ play Go, $\\var{p2}$ play Chess, $\\var{p3}$ play both, and $\\var{p4}$ play neither.

\n

", "tags": [], "metadata": {"description": "

Example showing how to calculate the probability of A or B using the law $p(A \\;\\textrm{or}\\; B)=p(A)+p(B)-p(A\\;\\textrm{and}\\;B)$.

\n

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"customMarkingAlgorithm": "", "marks": "1.5", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans1}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a person selected at random plays Go. Write your answer as a fraction.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}, {"customMarkingAlgorithm": "", "marks": "3", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans2}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a randomly selected person plays Chess or Go. Give your answer as a fraction.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}, {"customMarkingAlgorithm": "", "marks": "4.5", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans3}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a randomly selected person plays Chess but not Go.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}], "ungrouped_variables": ["p1", "p3", "p2", "p4", "ptotal", "ans1", "ans2", "ans3"], "advice": "", "functions": {}, "variables": {"p4": {"description": "", "templateType": "anything", "definition": "random(10..40)", "name": "p4", "group": "Ungrouped variables"}, "ptotal": {"description": "", "templateType": "anything", "definition": "p1+p2-p3+p4", "name": "ptotal", "group": "Ungrouped variables"}, "p1": {"description": "", "templateType": "anything", "definition": "random(40..70)", "name": "p1", "group": "Ungrouped variables"}, "p2": {"description": "", "templateType": "anything", "definition": "random(30..50)", "name": "p2", "group": "Ungrouped variables"}, "p3": {"description": "", "templateType": "anything", "definition": "random(10..25)", "name": "p3", "group": "Ungrouped variables"}, "ans2": {"description": "", "templateType": "anything", "definition": "1-(p4/ptotal)", "name": "ans2", "group": "Ungrouped variables"}, "ans3": {"description": "", "templateType": "anything", "definition": "(p2-p3)/ptotal", "name": "ans3", "group": "Ungrouped variables"}, "ans1": {"description": "", "templateType": "anything", "definition": "p1/ptotal", "name": "ans1", "group": "Ungrouped variables"}}, "variable_groups": [], "preamble": {"css": "", "js": ""}}, {"name": "Probability independent 2 events", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "functions": {}, "ungrouped_variables": ["y", "thing", "x", "a1d", "a2", "a3", "a4", "a1", "a2d", "a3d", "a4d"], "tags": ["rebelmaths"], "preamble": {"css": "", "js": ""}, "advice": "

(a) P({thing[0]})xP({thing[1]})={x}x{y}={a1}

\n

Next round to 2 decimal places to get {a1d}

\n

(b) P(not - {thing[0]})xP(not - {thing[1]})$=(1-\\var{x})\\times (1-\\var{y})=\\var{a2}$

\n

Next round to 2 decimal places to get {a2d}

\n

(c) 1- (answer to part (b))=1-{a2d}={a3d}

\n

(d) ( (1-{x})x {y})+( (1-{y})x {x})={a4}

\n

Next round to 2 decimal places to get {a4d}

\n

", "rulesets": {}, "parts": [{"precisionType": "dp", "prompt": "

What is the probabilty that both of these events occur?

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": "2", "maxValue": "{x}*{y}", "minValue": "{x}*{y}", "type": "numberentry"}, {"precisionType": "dp", "prompt": "

What is the probabilty that neither of these events occur?

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": "2", "maxValue": "(1-{x})*(1-{y})", "minValue": "(1-{x})*(1-{y})", "type": "numberentry"}, {"precisionType": "dp", "prompt": "

What is the probabilty that at least one of these two events will occur?

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": "0", "scripts": {}, "marks": "2", "maxValue": "1-(1-{x})*(1-{y})", "minValue": "1-(1-{x})*(1-{y})", "type": "numberentry"}, {"precisionType": "dp", "prompt": "

What is the probabilty that only one of the two events occur?

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "showCorrectAnswer": true, "precisionPartialCredit": 0, "scripts": {}, "marks": "2", "maxValue": "(1-{x})*{y}+(1-{y})*{x}", "minValue": "(1-{x})*{y}+(1-{y})*{x}", "type": "numberentry"}], "statement": "

The probability that {thing[0]} is {x}, while the probability that {thing[1]} is {y}. Assume that these two events are independent. Give all answers correct to two decimal places.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a4d": {"definition": "precround((1-x)*y+(1-y)*x,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "a4d", "description": ""}, "a1d": {"definition": "precround(x*y,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "a1d", "description": ""}, "a1": {"definition": "x*y", "templateType": "anything", "group": "Ungrouped variables", "name": "a1", "description": ""}, "thing": {"definition": "random(['there will be a change in government in Ireland next year ', 'Ireland will win the rugby world cup next year'],['it will rain in Qumar on any given day','it will rain in Timbucktoo on any given day'],['shares in the Bank of Lapland will rise on any given day','shares in the Bank of Never Never Land will rise on any given day'])", "templateType": "anything", "group": "Ungrouped variables", "name": "thing", "description": ""}, "a3": {"definition": "1-a2", "templateType": "anything", "group": "Ungrouped variables", "name": "a3", "description": ""}, "a2": {"definition": "(1-x)*(1-y)", "templateType": "anything", "group": "Ungrouped variables", "name": "a2", "description": ""}, "a2d": {"definition": "precround((1-x)*(1-y),2)", "templateType": "anything", "group": "Ungrouped variables", "name": "a2d", "description": ""}, "a4": {"definition": "(1-x)*y+(1-y)*x", "templateType": "anything", "group": "Ungrouped variables", "name": "a4", "description": ""}, "a3d": {"definition": "precround(1-a2,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "a3d", "description": ""}, "y": {"definition": "random(0.01..0.99#0.01)", "templateType": "randrange", "group": "Ungrouped variables", "name": "y", "description": ""}, "x": {"definition": "random(0.01..0.9#0.01)", "templateType": "randrange", "group": "Ungrouped variables", "name": "x", "description": ""}}, "metadata": {"description": "

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Roll a pair of dice - find probability at least one die shows a given number.", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}], "preamble": {"css": "", "js": ""}, "statement": "

Two fair six-sided dice are rolled.

", "functions": {}, "advice": "\n \n \n

Let $A$ be the event that first dice shows a $\\var{number}$ $\\Rightarrow P(A)=\\frac{1}{6}$.

\n \n \n \n

Let $B$ be the event that second dice shows a $\\var{number}$ $\\Rightarrow P(B)=\\frac{1}{6}$.

\n \n \n \n

$A$ and $B$ are independent events so $P(A\\cap B) = P(A)\\times P(B)$.

\n \n \n \n

We want the probability $P(A \\cup B)$ of either $A$ or $B$ showing $\\var{number}$ and

\n \n \n \n

\$\\begin{eqnarray*}\n \n P(A \\cup B) &=& P(A)+P(B)-P(A \\cap B)\\\\\n \n &=& P(A)+P(B)-P(A)P(B)\\\\\n \n &=&\\frac{1}{6}+ \\frac{1}{6}-\\frac{1}{36}\\\\\n \n &=& \\frac{11}{36}\n \n \\end{eqnarray*}\n \n \$

\n \n \n ", "ungrouped_variables": ["number"], "type": "question", "parts": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "type": "gapfill", "scripts": {}, "marks": 0, "customMarkingAlgorithm": "", "unitTests": [], "sortAnswers": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"checkingAccuracy": 0.001, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false, "answerSimplification": "std, fractionNumbers", "notallowed": {"strings": ["."], "message": "

", "showStrings": false, "partialCredit": 0}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "expectedVariableNames": [], "checkingType": "absdiff", "showFeedbackIcon": true, "type": "jme", "vsetRangePoints": 5, "failureRate": 1, "marks": 1, "unitTests": [], "showPreview": true, "vsetRange": [0, 1], "musthave": {"strings": ["/", 11, 36], "message": "

Input as a fraction.

", "showStrings": false, "partialCredit": 0}, "answer": "11/36"}], "extendBaseMarkingAlgorithm": true, "prompt": "

What is the probability of at least one die showing a $\\var{number}$?

\n

Probability = [[0]]

\n

"}], "variable_groups": [], "variables": {"number": {"definition": "random(1..6)", "templateType": "anything", "name": "number", "description": "", "group": "Ungrouped variables"}}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Rolling a pair of dice. Find probability that at least one die shows a given number.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": ["checked2015", "dice", "die", "elementary probability", "events", "independence", "independent events", "Probability", "probability", "probability dice", "statistics", "tested1"]}, {"name": "nuExam07 - Binomial Distribution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}], "statement": "

\n

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

\n

", "ungrouped_variables": ["p", "p_perc", "n", "q", "r", "pr0", "pr1", "pr2", "pr3", "answer1", "answer2", "qn", "r0", "n2"], "preamble": {"css": "", "js": ""}, "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 walk 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 walk to college. Let $X$ represent the number of students that walk 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}$

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "rulesets": {}, "functions": {}, "variables": {"pr3": {"definition": "((n*(n-1)*(n-2))/6)*(p^3)*(q^(n-3))", "description": "

probability that r = 3

", "templateType": "anything", "name": "pr3", "group": "Ungrouped variables"}, "r0": {"definition": "0", "description": "", "templateType": "anything", "name": "r0", "group": "Ungrouped variables"}, "answer1": {"definition": "if(r=2,pr0+pr1, pr0+pr1+pr2)", "description": "", "templateType": "anything", "name": "answer1", "group": "Ungrouped variables"}, "p": {"definition": "random(0.1..0.2#0.05)", "description": "

the probability that an individual student cycles to college

", "templateType": "anything", "name": "p", "group": "Ungrouped variables"}, "r": {"definition": "3", "description": "

more than r of the students cycle to college

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

probability that r = 1

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

probability that r = 2

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

sample size

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

probability that r = 0

", "templateType": "anything", "name": "pr0", "group": "Ungrouped variables"}, "qn": {"definition": "q^n", "description": "", "templateType": "anything", "name": "qn", "group": "Ungrouped variables"}, "answer2": {"definition": "1-answer1", "description": "", "templateType": "anything", "name": "answer2", "group": "Ungrouped variables"}, "p_perc": {"definition": "p*100", "description": "

percentage of students that cycle to college

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

probability tha an individual does not cycle to college

", "templateType": "anything", "name": "q", "group": "Ungrouped variables"}}, "tags": [], "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"}, "parts": [{"notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "mustBeReduced": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "variableReplacements": [], "type": "numberentry", "customMarkingAlgorithm": "", "useCustomName": false, "showFeedbackIcon": true, "showFractionHint": true, "allowFractions": false, "marks": "3", "unitTests": [], "minValue": "(q^n)-0.001", "maxValue": "(q^n)+0.001", "customName": "", "prompt": "

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

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

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

"}], "type": "question"}, {"name": "Conditional probability ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Blathnaid Sheridan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/447/"}], "functions": {}, "ungrouped_variables": ["y", "z", "x", "y2", "z2", "x2"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "parts": [{"precisionType": "dp", "prompt": "

A student has been selected at random from last year’s BS1 class. Calculate the probability that this student passed the examination.

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": "2", "maxValue": "x*y + (1-x)*z", "strictPrecision": false, "minValue": "x*y + (1-x)*z", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "3", "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"precisionType": "dp", "prompt": "

Sam MacLeinn was one of the students who passed the examination. Calculate the probability that Sam attended lectures regularly.

", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": 1, "maxValue": "(x*y)/(x*y + (1-x)*z)", "strictPrecision": false, "minValue": "(x*y)/(x*y + (1-x)*z)", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "3", "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "statement": "

\n

Last year, $\\var{x2}$% of the students in a statistics class attended lectures regularly. $\\var{y2}$% of students who attended lectures regularly passed the examination at the end of the module, but only $\\var{z2}$% of the students who did not attend lectures regularly passed the examination.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"y2": {"definition": "y*100", "templateType": "anything", "group": "Ungrouped variables", "name": "y2", "description": "

percentage

"}, "x2": {"definition": "x*100", "templateType": "anything", "group": "Ungrouped variables", "name": "x2", "description": "

x percentage

"}, "y": {"definition": "random(0.87..0.97#0.02)", "templateType": "anything", "group": "Ungrouped variables", "name": "y", "description": "

percetage of students who attended lectures and passed the exam

"}, "x": {"definition": "random(0.75..0.95#0.02)", "templateType": "anything", "group": "Ungrouped variables", "name": "x", "description": "

percentage of students that attended lectures regularly

"}, "z": {"definition": "random(0.05..0.35 #0.02)", "templateType": "anything", "group": "Ungrouped variables", "name": "z", "description": "

percetage of students who did not attend lectures and passed the exam

"}, "z2": {"definition": "z*100", "templateType": "anything", "group": "Ungrouped variables", "name": "z2", "description": "

z percentage

"}}, "metadata": {"notes": "", "description": "

Last year, x% of the students in the BS1 class attended lectures regularly.

\n

y% of students who attended lectures regularly passed the examination at the end of the module, but only z% of the students who did not attend lectures regularly passed the examination.

\n

A student has been selected at random from last year’s statistics class. Calculate the probability that this student passed the examination.

\n

Sam MacLeinn was one of the students who passed the examination. Calculate the probability that Sam attended lectures regularly.

", "licence": "None specified"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Conditional probability from frequency table v2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}], "variable_groups": [], "metadata": {"description": "

Asks students to compute conditional probabilities based on a frequency table.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"showCorrectAnswer": true, "answer": "{values[ar][ac]}/({values[0][ac]}+{values[1][ac]}+{values[2][ac]})", "showpreview": true, "marks": "6", "scripts": {}, "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showFeedbackIcon": true, "checkingaccuracy": 0.001, "type": "jme", "checkingtype": "absdiff", "checkvariablenames": false, "prompt": "

Calculate the probability that a randomly selected person likes {rows[ar]} given they like the {cols[ac]}. Enter your answer as a fraction.

", "vsetrangepoints": 5, "variableReplacements": []}, {"showCorrectAnswer": true, "answer": "{values[br][bc]}/({values[br][0]}+{values[br][1]}+{values[br][2]})", "showpreview": true, "marks": "6", "scripts": {}, "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showFeedbackIcon": true, "checkingaccuracy": 0.001, "type": "jme", "checkingtype": "absdiff", "checkvariablenames": false, "prompt": "

Calculate the probability that a randomly selected person likes the {cols[bc]} given they like {rows[br]}. Enter your answer as a fraction.

", "vsetrangepoints": 5, "variableReplacements": []}], "rulesets": {}, "statement": "

200 people were asked about their favourite Western Canadian ice hockey teams and their favourite 15th century explorer. The following table shows the results.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 Canucks Flames Oilers Magellan {a1} {a2} {a3} Columbus {a4} {b1} {b2} da Gama {a5} {b3} {b4}
", "functions": {}, "advice": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "ungrouped_variables": ["a1", "a2", "a3", "a4", "a5", "b1", "b2", "b3", "b4", "values", "rows", "cols", "ar", "ac", "br", "bc"], "preamble": {"css": "", "js": ""}, "variables": {"values": {"description": "", "definition": "matrix([a1,a2,a3],[a4,b1,b2],[a5,b3,b4])", "group": "Ungrouped variables", "templateType": "anything", "name": "values"}, "ac": {"description": "", "definition": "random(0..2)", "group": "Ungrouped variables", "templateType": "anything", "name": "ac"}, "br": {"description": "", "definition": "random(0..2 except ar)", "group": "Ungrouped variables", "templateType": "anything", "name": "br"}, "bc": {"description": "", "definition": "random(0..2 except ac)", "group": "Ungrouped variables", "templateType": "anything", "name": "bc"}, "a3": {"description": "", "definition": "random(1..20)", "group": "Ungrouped variables", "templateType": "anything", "name": "a3"}, "b3": {"description": "", "definition": "random(1..30)", "group": "Ungrouped variables", "templateType": "anything", "name": "b3"}, "cols": {"description": "", "definition": "[\"Canucks\", \"Flames\", \"Oilers\"]", "group": "Ungrouped variables", "templateType": "anything", "name": "cols"}, "a1": {"description": "", "definition": "random(1..20)", "group": "Ungrouped variables", "templateType": "anything", "name": "a1"}, "b4": {"description": "", "definition": "100-(b1+b2+b3)", "group": "Ungrouped variables", "templateType": "anything", "name": "b4"}, "ar": {"description": "", "definition": "random(0..2)", "group": "Ungrouped variables", "templateType": "anything", "name": "ar"}, "a2": {"description": "", "definition": "random(1..20)", "group": "Ungrouped variables", "templateType": "anything", "name": "a2"}, "a4": {"description": "", "definition": "random(1..20)", "group": "Ungrouped variables", "templateType": "anything", "name": "a4"}, "b2": {"description": "", "definition": "random(1..30)", "group": "Ungrouped variables", "templateType": "anything", "name": "b2"}, "b1": {"description": "", "definition": "random(1..30)", "group": "Ungrouped variables", "templateType": "anything", "name": "b1"}, "rows": {"description": "", "definition": "[\"Magellan\", \"Columbus\", \"da Gama\"]", "group": "Ungrouped variables", "templateType": "anything", "name": "rows"}, "a5": {"description": "", "definition": "100-(a1+a2+a3+a4)", "group": "Ungrouped variables", "templateType": "anything", "name": "a5"}}, "type": "question"}]}], "timing": {"allowPause": true, "timedwarning": {"action": "none", "message": ""}, "timeout": {"action": "none", "message": ""}}, "duration": 0, "percentPass": 0, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Calculations involving elementary probability, and several questions designed to draw out misconceptions to do with probability.

"}, "navigation": {"preventleave": true, "allowregen": true, "browse": true, "allowsteps": true, "onleave": {"action": "none", "message": ""}, "reverse": true, "showresultspage": "oncompletion", "showfrontpage": true, "startpassword": ""}, "feedback": {"showanswerstate": true, "showtotalmark": true, "advicethreshold": 0, "intro": "", "allowrevealanswer": true, "showactualmark": true, "feedbackmessages": []}, "showQuestionGroupNames": false, "showstudentname": true, "contributors": [{"name": "Blathnaid Sheridan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/447/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}