// Numbas version: exam_results_page_options {"feedback": {"showactualmark": true, "allowrevealanswer": true, "intro": "", "feedbackmessages": [], "showanswerstate": true, "showtotalmark": true, "advicethreshold": 0}, "navigation": {"preventleave": true, "allowregen": true, "reverse": true, "browse": true, "showfrontpage": true, "showresultspage": "oncompletion", "onleave": {"message": "", "action": "none"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

This quiz poses questions on basic probability and statistics.

"}, "name": "Mohini's copy of Praneetha's copy of Introduction to probability", "timing": {"timeout": {"message": "", "action": "none"}, "timedwarning": {"message": "", "action": "none"}, "allowPause": true}, "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Statistics", "questions": [{"name": "Mean & Standard deviation of a set of nine numbers", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a2": {"description": "", "templateType": "randrange", "name": "a2", "group": "Ungrouped variables", "definition": "random(1..15#1)"}, "a8": {"description": "", "templateType": "randrange", "name": "a8", "group": "Ungrouped variables", "definition": "random(1..11#1)"}, "mean": {"description": "", "templateType": "anything", "name": "mean", "group": "Ungrouped variables", "definition": "(a1+a2+a3+a4+a5+a6+a7+a8+a9)/9"}, "a3": {"description": "", "templateType": "randrange", "name": "a3", "group": "Ungrouped variables", "definition": "random(1..15#1)"}, "a7": {"description": "", "templateType": "randrange", "name": "a7", "group": "Ungrouped variables", "definition": "random(10..20#1)"}, "a4": {"description": "", "templateType": "randrange", "name": "a4", "group": "Ungrouped variables", "definition": "random(1..15#1)"}, "a1": {"description": "", "templateType": "randrange", "name": "a1", "group": "Ungrouped variables", "definition": "random(1..12#1)"}, "a5": {"description": "", "templateType": "randrange", "name": "a5", "group": "Ungrouped variables", "definition": "random(2..19#1)"}, "sd": {"description": "", "templateType": "anything", "name": "sd", "group": "Ungrouped variables", "definition": "sqrt(((a1-mean)^2+(a2-mean)^2+(a3-mean)^2+(a4-mean)^2+(a5-mean)^2+(a6-mean)^2+(a7-mean)^2+(a8-mean)^2+(a9-mean)^2)/9)"}, "a9": {"description": "", "templateType": "randrange", "name": "a9", "group": "Ungrouped variables", "definition": "random(2..20#1)"}, "a6": {"description": "", "templateType": "randrange", "name": "a6", "group": "Ungrouped variables", "definition": "random(3..18#1)"}}, "rulesets": {}, "ungrouped_variables": ["mean", "a4", "a3", "a2", "a1", "sd", "a9", "a5", "a6", "a7", "a8"], "functions": {}, "statement": "

Given a set of nine random numbers:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
 {a1} {a2} {a3} {a4} {a5} {a6} {a7} {a8} {a9}
\n

", "tags": [], "parts": [{"type": "gapfill", "prompt": "

Calculate the mean.  [[0]]

", "showFeedbackIcon": true, "marks": 0, "gaps": [{"mustBeReduced": false, "minValue": "{mean}", "type": "numberentry", "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": 1, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "precision": "2", "precisionPartialCredit": 0, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{mean}", "correctAnswerFraction": false, "showCorrectAnswer": true, "showPrecisionHint": true, "variableReplacements": [], "showFeedbackIcon": true, "strictPrecision": false}], "showCorrectAnswer": true, "variableReplacements": [], "scripts": {}, "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "prompt": "

", "showFeedbackIcon": true, "marks": 0, "gaps": [{"mustBeReduced": false, "minValue": "{sd}", "type": "numberentry", "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": 1, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "precision": "2", "precisionPartialCredit": 0, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{sd}", "correctAnswerFraction": false, "showCorrectAnswer": true, "showPrecisionHint": true, "variableReplacements": [{"must_go_first": false, "part": "p0g0", "variable": "mean"}], "showFeedbackIcon": true, "strictPrecision": false}], "showCorrectAnswer": true, "variableReplacements": [{"must_go_first": false, "part": "p0", "variable": "mean"}], "scripts": {}, "variableReplacementStrategy": "originalfirst"}], "metadata": {"description": "

My first attempt at using adaptive marking.

\n

This question asks students to calculate the mean of four numbers and using their answer to calculate the standard deviation.

\n

When the answer to the mean is incorrect, I want to correct part (b) based on their answer to part(a) in order not to penalise twice for the one mistake.

", "licence": "None specified"}, "advice": "

The formula for the mean is given by:     \$$\\bar{x}=\\frac{\\sum{x_i} }{n}\$$

\n

\n

The formula for the population standard deviation is given by:    \$$\\sigma=\\sqrt{\\frac{\\sum{(x_i-\\bar{x})^2}}{n}}\$$

\n

Calculate the mean number of goals scored per match.

\n

mean =  [[0]]

\n

If X represents the number of goals scored per match, calculate its standard deviation.

\n

st.dev. = [[1]]

\n

"}], "variables": {"r": {"definition": "vector(repeat(random(0..10),n))", "templateType": "anything", "name": "r", "group": "Ungrouped variables", "description": ""}, "mean": {"definition": "inner_product/sum(r)", "templateType": "anything", "name": "mean", "group": "Ungrouped variables", "description": ""}, "sample_variance": {"definition": "(freq_s_sqrd-(sum_r)*mean^2)/(sum_r)", "templateType": "anything", "name": "sample_variance", "group": "Ungrouped variables", "description": ""}, "sum_r": {"definition": "sum(r)", "templateType": "anything", "name": "sum_r", "group": "Ungrouped variables", "description": ""}, "n": {"definition": "9", "templateType": "number", "name": "n", "group": "Ungrouped variables", "description": ""}, "deviation": {"definition": "sqrt(sample_variance)", "templateType": "anything", "name": "deviation", "group": "Ungrouped variables", "description": ""}, "s_squared": {"definition": "vector(0,1,4,9,16,25,36,49,64)", "templateType": "anything", "name": "s_squared", "group": "Ungrouped variables", "description": ""}, "inner_product": {"definition": "dot(r,s)", "templateType": "anything", "name": "inner_product", "group": "Ungrouped variables", "description": ""}, "s": {"definition": "vector(0,1,2,3,4,5,6,7,8)", "templateType": "anything", "name": "s", "group": "Ungrouped variables", "description": ""}, "freq_s_sqrd": {"definition": "dot(r,s_squared)", "templateType": "anything", "name": "freq_s_sqrd", "group": "Ungrouped variables", "description": ""}}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "metadata": {"licence": "None specified", "description": ""}, "rulesets": {}, "statement": "

The number of goals scored per match in a hockey tournament was recorded and is shown in the table below.

\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
 # goals scored {s[0]} {s[1]} {s[2]} {s[3]} {s[4]} {s[5]} {s[6]} {s[7]} {s[8]} frequency {r[0]} {r[1]} {r[2]} {r[3]} {r[4]} {r[5]} {r[6]} {r[7]} {r[8]}
\n
\n

The formula for the mean is given by:     \$$\\bar{x}=\\frac{\\sum{f_ix_i} }{\\sum{f_i}}\$$

\n

where \$$f_i\$$ are the frequencies and \$${x_i}\$$ are the number of goals scored.

\n

\n

The formula for the population standard deviation is given by:    \$$s=\\sqrt{\\frac{\\sum{f_i(x_i-\\bar{x})^2}}{\\sum{f_i}}}\$$

\n

", "tags": [], "type": "question"}, {"name": "Sample Mean & Sample Standard deviation 2", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["n", "r", "s", "inner_product", "mean", "s_squared", "freq_s_sqrd", "sum_r", "sample_variance", "deviation"], "tags": [], "advice": "

The formula for the sample mean is given by:     \$$\\bar{x}=\\frac{\\sum{f_ix_i} }{\\sum{f_i}}\$$

\n

where \$$f_i\$$ are the frequencies and \$${x_i}\$$ are the number of goals scored.

\n

\n

The formula for the sample deviation is given by:    \$$s=\\sqrt{\\frac{\\sum{f_i(x_i-\\bar{x})^2}}{\\sum{f_i}-1}}\$$

\n

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

Calculate the mean number of goals scored per match.

\n

mean =  [[0]]

\n

If X is the number of goals scored per match, calculate its sample standard deviation.

\n

st.dev. = [[1]]

\n

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

The number of goals scored in a selection of matches in a soccer tournament was recorded and is shown in the table below.

\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
 # goals scored {s[0]} {s[1]} {s[2]} {s[3]} {s[4]} {s[5]} {s[6]} {s[7]} {s[8]} frequency {r[0]} {r[1]} {r[2]} {r[3]} {r[4]} {r[5]} {r[6]} {r[7]} {r[8]}
\n
\n
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"deviation": {"definition": "sqrt(sample_variance)", "templateType": "anything", "group": "Ungrouped variables", "name": "deviation", "description": ""}, "inner_product": {"definition": "dot(r,s)", "templateType": "anything", "group": "Ungrouped variables", "name": "inner_product", "description": ""}, "n": {"definition": "9", "templateType": "number", "group": "Ungrouped variables", "name": "n", "description": ""}, "s": {"definition": "vector(0,1,2,3,4,5,6,7,8)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "r": {"definition": "vector(repeat(random(0..10),n))", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}, "sample_variance": {"definition": "(freq_s_sqrd-(sum_r)*mean^2)/(sum_r-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sample_variance", "description": ""}, "freq_s_sqrd": {"definition": "dot(r,s_squared)", "templateType": "anything", "group": "Ungrouped variables", "name": "freq_s_sqrd", "description": ""}, "sum_r": {"definition": "sum(r)", "templateType": "anything", "group": "Ungrouped variables", "name": "sum_r", "description": ""}, "s_squared": {"definition": "vector(0,1,4,9,16,25,36,49,64)", "templateType": "anything", "group": "Ungrouped variables", "name": "s_squared", "description": ""}, "mean": {"definition": "inner_product/sum(r)", "templateType": "anything", "group": "Ungrouped variables", "name": "mean", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}]}, {"pickQuestions": 1, "pickingStrategy": "random-subset", "name": "relative frequency", "questions": [{"name": "Relative frequency #2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["n1", "n2", "n3"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

\n

(a)     P(both are \$$\\var{n3}\$$'s) = P( 1st is a \$$\\var{n3}\$$ and the 2nd is a \$$\\var{n3}\$$)

\n

= P( 1st is a \$$\\var{n3}\$$)*P(2nd is a \$$\\var{n3}\$$ given that we know the 1st is a \$$\\var{n3}\$$)

\n

= \$$\\frac{\\var{n2}}{\\var{n1}}*\\frac{\\simplify{{n2}-1}}{\\simplify{{n1}-1}}\$$

\n

= \$$\\simplify{{n2}*({n2}-1)/({n1}*({n1}-1))}\$$

\n

\n

(b)     P(neither are \$$\\var{n3}\$$'s) = P( 1st is not a \$$\\var{n3}\$$ and the 2nd is not a \$$\\var{n3}\$$)

\n

= P( 1st is not a \$$\\var{n3}\$$)*P(2nd is not a \$$\\var{n3}\$$ given that we know the 1st is not a \$$\\var{n3}\$$)

\n

= \$$\\frac{\\simplify{{n1}-{n2}}}{\\var{n1}}*\\frac{\\simplify{{n1}-{n2}-1}}{\\simplify{{n1}-1}}\$$

\n

= \$$\\simplify{({n1}-{n2})*({n1}-{n2}-1)/({n1}*({n1}-1))}\$$

\n

\n

(c)     P(exactly one card is a \$$\\var{n3}\$$) = P( 1st is a \$$\\var{n3}\$$ and the 2nd is not a \$$\\var{n3}\$$)  or  P( 1st is not a \$$\\var{n3}\$$ and the 2nd is a \$$\\var{n3}\$$)

\n

= P( 1st is a \$$\\var{n3}\$$)*P(2nd is not a \$$\\var{n3}\$$ given the 1st is a \$$\\var{n3}\$$)  +  P( 1st is not a \$$\\var{n3}\$$)*P(2nd is a \$$\\var{n3}\$$ given the 1st is not a \$$\\var{n3}\$$)

\n

=\$$\\frac{\\var{n2}}{\\var{n1}}*\\frac{\\simplify{{n1}-{n2}}}{\\simplify{{n1}-1}}+ \\frac{\\simplify{{n1}-{n2}}}{\\var{n1}}*\\frac{\\simplify{{n2}}}{\\simplify{{n1}-1}}\$$

\n

=\$$\\simplify{2*{n2}*({n1}-{n2})/({n1}*({n1}-1))}\$$

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

Two cards are chosen without replacement find the probabilities that

\n

(a)      both are \$$\\var{n3}\$$'s  [[0]]

\n

(b)      neither is a \$$\\var{n3}\$$  [[1]]

\n

(c)      exactly one is a \$$\\var{n3}\$$.  [[2]]

A standard deck of playing cards contains 52 cards.

\n

There are 13 cards in each of four suits: Spades, Hearts, Clubs and Diamonds.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"n1": {"definition": "52", "templateType": "number", "group": "Ungrouped variables", "name": "n1", "description": ""}, "n2": {"definition": "4", "templateType": "number", "group": "Ungrouped variables", "name": "n2", "description": ""}, "n3": {"definition": "random(2..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "n3", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}, {"name": "Relative frequency", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["n1", "n2"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

A box contains \$$\\var{n1}\$$ fuses of which \$$\\var{n2}\$$ are defective.

\n

(a)     P(both are defective) = P( 1st is defective and the 2nd is defective)

\n

= P( 1st is defective)*P(2nd is defective given that we know the 1st is defective)

\n

= \$$\\frac{\\var{n2}}{\\var{n1}}*\\frac{\\simplify{{n2}-1}}{\\simplify{{n1}-1}}\$$

\n

= \$$\\simplify{{n2}*({n2}-1)/({n1}*({n1}-1))}\$$

\n

\n

(b)     P(neither are defective) = P( 1st is not defective and the 2nd is not defective)

\n

= P( 1st is not defective)*P(2nd is not defective given that we know the 1st is not defective)

\n

= \$$\\frac{\\simplify{{n1}-{n2}}}{\\var{n1}}*\\frac{\\simplify{{n1}-{n2}-1}}{\\simplify{{n1}-1}}\$$

\n

= \$$\\simplify{({n1}-{n2})*({n1}-{n2}-1)/({n1}*({n1}-1))}\$$

\n

(c)     P(exactly one defective) = P( 1st is defective and the 2nd is not defective) or  P( 1st is not defective and the 2nd is defective)

\n

= P( 1st is defective)*P(2nd is not defective given the 1st is defective) + P( 1st is not defective)*P(2nd is defective given the 1st is not defective)

\n

=\$$\\frac{\\var{n2}}{\\var{n1}}*\\frac{\\simplify{{n1}-{n2}}}{\\simplify{{n1}-1}}+ \\frac{\\simplify{{n1}-{n2}}}{\\var{n1}}*\\frac{\\simplify{{n2}}}{\\simplify{{n1}-1}}\$$

\n

=\$$\\simplify{2*{n2}*({n1}-{n2})/({n1}*({n1}-1))}\$$

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

Two fuses are chosen without replacement find the probabilities that

\n

(a)      both are defective  [[0]]

\n

(b)      neither is defective  [[1]]

\n

(c)      exactly one is defective.  [[2]]

A box contains \$$\\var{n1}\$$ fuses of which \$$\\var{n2}\$$ are defective.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"n1": {"definition": "random(50..100#5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "n1", "description": ""}, "n2": {"definition": "random(2..5#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "n2", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}]}, {"pickQuestions": 1, "pickingStrategy": "random-subset", "name": "Independent probabilities", "questions": [{"name": "Independent probabilities #1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["n1", "prob_0", "prob_2", "prob_1", "nc2"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

A dice is rolled \$$\\var{n1}\$$ times.

\n

P(getting a Low score on a single roll) = \$$\\frac{1}{3}\$$   and   P(not getting a Low score on a single roll) = \$$\\frac{2}{3}\$$

\n

\n

\n

(a)

\n

Being incorrect every time can only happen in one way.

\n

P(being incorrect every time) = P(not getting a Low score on 1st roll) and P(not getting a Low score on 2nd roll) and ... and P(not getting a Low score on \$$\\var{n1}\$$th roll)

\n

P(being incorrect every time) = P(not getting a Low score on 1st roll) * P(not getting a Low score on 2nd roll) * ... * P(not getting a Low score on \$$\\var{n1}\$$th roll)

\n

P(being incorrect every time) = \$$(P(not\\,getting\\,a\\,Low\\,score\\,on\\,1st\\,roll))^\\var{n1}\$$

\n

= \$$(\\frac{2}{3})^\\var{n1}\$$

\n

= \$$\\simplify{2^{n1}/3^{n1}}\$$

\n

=\$$\\var{prob_0}\$$

\n

\n

\n

(b)     Being correct exacly twice means also being incorrect exactly \$$\\simplify{{n1}-2}\$$ times

\n

This can occur in \$$^\\var{n1}C_2=\\var{nc2}\$$ different arrangements.

\n

Each arrangement has a probability = \$$(\\frac{1}{3})^2*(\\frac{2}{3})^\\simplify{{n1}-2}\$$

\n

P(being correct exactly twice) =  \$$\\var{nc2}*(\\frac{1}{3})^2*(\\frac{2}{3})^\\simplify{{n1}-2}\$$

\n

= \$$\\simplify{{nc2}*2^({n1}-2)/3^{n1}}\$$

\n

=\$$\\var{prob_2}\$$

\n

\n

\n

(c)      Being correct at least two times is being correct 2 time or 3 times or ... or \$$\\var{n1}\$$ times

\n

= 1 - P(being correct < 2 times)

\n

= 1 - [ P(being correct zero times) + P(being correct exactly 1 time) ]

\n

We have evaluated P(being correct zero times) in part (a)

\n

Being correct exactly 1 time means also being incorrect exactly \$$\\simplify{{n1}-1}\$$ times

\n

This can occur in \$$^\\var{n1}C_1=\\var{n1}\$$ different arrangements.

\n

Each arrangement has a probability = \$$(\\frac{1}{3})*(\\frac{2}{3})^\\simplify{{n1}-1}\$$

\n

P(being correct exactly once) =  \$$\\var{n1}*(\\frac{1}{3})*(\\frac{2}{3})^\\simplify{{n1}-1}\$$

\n

= \$$\\simplify{{n1}*2^({n1}-1)/3^{n1}}\$$

\n

=\$$\\var{prob_1}\$$

\n

P(being correct at least twice) = 1 - \$$[\\var{prob_0} + \\var{prob_1}]\$$

\n

= \$$\\simplify{1-{prob_0}-{prob_1}}\$$

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

If he always guesses Low, what is the probability that he will

\n

(a)     be incorrect every time;    [[0]]

\n

(b)     be correct exactly twice;     [[1]]

\n

(c)     be correct at least twice.     [[2]]

\n

A dice is rolled \$$\\var{n1}\$$ times.

\n

A High roll occurs if a 5 or 6 is the result. A Low roll corresponds to the numbers 1 or 2 showing.

\n

Before each roll a gambler guesses the outcome.

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"prob_2": {"definition": "comb(n1,2)*(1/3^2)*(2/3)^(n1-2)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_2", "description": ""}, "n1": {"definition": "random(4..8#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "n1", "description": ""}, "prob_0": {"definition": "comb(n1,0)*(2/3)^n1", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_0", "description": ""}, "prob_1": {"definition": "comb(n1,1)*(1/3)*(2/3)^(n1-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_1", "description": ""}, "nc2": {"definition": "comb(n1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "nc2", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}, {"name": "Independent probabilities #2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["p1", "p2", "prob_a", "prob_b", "prob_c"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

\n

P(a component is made by machine A) = \$$\\frac{\\var{p1}}{100}\$$

\n

P(a component is made by machine B) = \$$\\frac{\\var{p2}}{100}\$$

\n

P(a component is made by machine C) = \$$\\frac{\\simplify{100-{p1}-{p2}}}{100}\$$

\n

\n

Recall:    And means you multiply   and   Or means you add.

\n

\n

(a)    P(Both components made by machine C) = P(First component is made by machine C) and P(Second component is made by machine C)

\n

=\$$\\frac{\\simplify{100-{p1}-{p2}}}{100}*\\frac{\\simplify{100-{p1}-{p2}}}{100}\$$

\n

=\$$\\frac{\\simplify{(100-{p1}-{p2})^2}}{10000}\$$

\n

=\$$\\var{prob_a}\$$

\n

\n

\n

(b)     Exactly one component being made by machine A has two possible cases:

\n

The first component is made by machine A and the second is not made by machine A or The first component is not made by machine A and the second is made by machine A.

\n

= \$$\\frac{\\var{p1}}{100}*\\frac{\\simplify{100-{p1}}}{100}+\\frac{\\simplify{100-{p1}}}{100}*\\frac{\\var{p1}}{100}\$$

\n

=\$$\\frac{\\simplify{{p1}*(100-{p1})}}{10000}+\\frac{\\simplify{{p1}*(100-{p1})}}{10000}\$$

\n

=\$$\\var{prob_b}\$$

\n

\n

(c)      P(two components are made by different machines) = 1 - P(both components made by the same machine)

\n

\n

= 1 - [ \$$\\frac{\\var{p1}}{100}*\\frac{\\var{p1}}{100}+\\frac{\\var{p2}}{100}*\\frac{\\var{p2}}{100}+\\frac{\\simplify{100-{p1}-{p2}}}{100}*\\frac{\\simplify{100-{p1}-{p2}}}{100}\$$]

\n

= 1- \$$\\frac{\\simplify{{p1}^2+{p2}^2+(100-{p1}-{p2})^2}}{10000}\$$

\n

= \$$\\var{prob_c}\$$

\n

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

Two components are chosen at random.

\n

Calculate the probability that

\n

(a)     both components are made by machine C;    [[0]]

\n

(b)     exactly one component is made by machine A;     [[1]]

\n

(c)     both components are made by different machines.     [[2]]

\n

Components are manufactured by one of three machines. We label the machines A, B and C.

\n

Machine A makes \$$\\var{p1}\$$% of the components, machine B makes \$$\\var{p2}\$$% of the components and machine C makes the rest.

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"p2": {"definition": "random(15..35#5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p2", "description": ""}, "prob_b": {"definition": "2*{p1}*(100-{p1})/10000", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_b", "description": ""}, "p1": {"definition": "random(25..50#5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p1", "description": ""}, "prob_c": {"definition": "1-({p1}*{p1}+{p2}*{p2}+(100-{p1}-{p2)^2)/10000", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_c", "description": ""}, "prob_a": {"definition": "(100-{p1}-{p2})^2/10000", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_a", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}]}, {"pickQuestions": 1, "pickingStrategy": "random-subset", "name": "Probability trees", "questions": [{"name": "probability tree 1", "extensions": [], "custom_part_types": [], "resources": [["question-resources/tree1.jpg", "/srv/numbas/media/question-resources/tree1.jpg"], ["question-resources/tree.jpg", "/srv/numbas/media/question-resources/tree.jpg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "statement": "

A small city airport is served by two airlines. An extensive customer satisfaction survey was carried out interviewing customers who travel through the airport on a weekly basis.

\n

The results revealed that \$$\\var{p1}\$$% of customers who travelled with Ryanair would travel with them again the following week whereas \$$\\var{p2}\$$% of customers who flew with Aer Lingus would use them again the following week.

\n

The customers who were dissatisfied with the experience would move their custom to the rival airline.

\n

Use a probability tree to determine the percentage of customers each airline would have after two weeks if they both start with an equal share of the market.

\n

\n

Ryanair =  [[0]]

\n

Aer Lingus = [[1]]

", "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true}], "advice": "

The probability a Ryanair customer is again a Ryanair customer next week is p1 = \$$\\frac{\\var{p1}}{100}\$$ and the probability that that customer moves to AerLingus is 1 - p1 = \$$\\frac{\\simplify{100-{p1}}}{100}\$$.

\n

Similarly the probability an AerLingus customer is again an AerLingus customer next week is p2 = \$$\\frac{\\var{p2}}{100}\$$ and the probability that that customer moves to Ryanair is 1 - p2 = \$$\\frac{\\simplify{100-{p1}}}{100}\$$.

\n

\n

Sketch your probability trees and evaluate the probabilities of each final position by multiplying the probabilities together that occur along each path.

\n

The tree for those customers who are initially Ryanair customers could look like this:

\n

\n

Sketch a similar tree for those who are initially Aerlingus passengers

", "type": "question"}, {"name": "Probability tree 2", "extensions": [], "custom_part_types": [], "resources": [["question-resources/tree2.jpg", "/srv/numbas/media/question-resources/tree2.jpg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["p11", "p12", "p13", "p21", "p22", "p23", "p31", "p33", "p32", "prob_a", "prob_b", "prob_c"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

Sketch your probability trees and evaluate the probabilities of each final position by multiplying the probabilities together that occur along each path. Add together all those ending in V, and all those ending in M and all those ending in 3 to find the required probabilities.

\n

The tree for those customers who are initially Vodafone customers could look like this:

\n

\n

\n

\n

where V is for Vodafone, M is for Meteor and T is for 3.

\n

\n

\n

\n

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

Calculate the probability that after two years

\n

(a)     the customer will once again be a Vodafone customer;    [[0]]

\n

(b)     the customer will be a Meteor customer;    [[1]]

\n

(c)     the customer will be a Three customer   [[2]]

\n

\n

\n

An extensive customer satisfaction survey was carried out by interviewing a large sample of customers of three different mobile phone operators. The customers surveyed were customers that take out 12-month contracts.

\n

Each person was asked if they would be happy to renew their contract with their current provider. If they were unwilling to remain with their current provider they were asked to indicate the provider they would move to.

\n

The resulting probabilities are given in the table below.

\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
 Vodafone Meteor 3 Vodafone \$$\\var{p11}\$$ \$$\\var{p12}\$$ \$$\\var{p13}\$$ Meteor \$$\\var{p21}\$$ \$$\\var{p22}\$$ \$$\\var{p23}\$$ 3 \$$\\var{p31}\$$ \$$\\var{p32}\$$ \$$\\var{p33}\$$
\n

\n

Consider a customer that is initially a Vodafone customer.

\n

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"prob_a": {"definition": "{p11}*{p11}+{p12}*{p21}+{p13}*{p31}", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_a", "description": "

prob_a

"}, "p33": {"definition": "random(0.7..0.8#0.025)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p33", "description": ""}, "p32": {"definition": "1-{p31}-{p33}", "templateType": "anything", "group": "Ungrouped variables", "name": "p32", "description": ""}, "p11": {"definition": "random(0.5..0.8#0.04)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p11", "description": ""}, "p12": {"definition": "random(0..0.2#0.1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p12", "description": ""}, "p13": {"definition": "1-{p11}-{p12}", "templateType": "anything", "group": "Ungrouped variables", "name": "p13", "description": ""}, "p21": {"definition": "random(0.02..0.2#0.03)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p21", "description": ""}, "p23": {"definition": "1-{p21}-{p22}", "templateType": "anything", "group": "Ungrouped variables", "name": "p23", "description": ""}, "p22": {"definition": "random(0.6..0.75#0.05)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p22", "description": ""}, "prob_b": {"definition": "{p11}*{p12}+{p12}*{p22}+{p13}*{p32}", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_b", "description": ""}, "prob_c": {"definition": "{p11}*{p13}+{p12}*{p23}+{p13}*{p33}", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_c", "description": ""}, "p31": {"definition": "random(0.05..0.2#0.05)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p31", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}]}, {"pickQuestions": 1, "pickingStrategy": "random-subset", "name": "Baye's", "questions": [{"name": "Baye's 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "functions": {}, "ungrouped_variables": ["pd3", "p1", "p1a", "p2", "p2a", "p3", "p3a", "pd1", "pd1a", "pd2", "pd2a", "pd3a", "prob_a", "prob_b", "prob_c"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

(a)   P(keyboard made in factory A given that it is faulty)=\$$P(A|f)\$$

\n

According to Baye's theorem

\n

\$$P(A|f)=\\frac{P(f|A)*P(A)}{P(f|A)*P(A)+P(f|B)*P(B)+P(f|C)*P(C)}\$$

\n

\$$P(A|f)=\\frac{\\var{pd1}*\\var{p1}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}}\$$

\n

\$$P(A|f)=\\frac{\\var{pd1}*\\var{p1}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}}\$$

\n

\$$P(A|f)=\\frac{\\simplify{{pd1}*{p1}}}{\\simplify{{pd1}*{p1}}+\\simplify{{pd2}*{p2}}+\\simplify{{pd3}*{p3}}}\$$

\n

\$$P(A|f)=\\simplify{({pd1}*{p1})/({pd1}*{p1}+{pd2}*{p2}+{pd3}*{p3})}\$$

\n

\$$P(A|f)=\\var{prob_a}\$$

\n

\n

(b)    P(keyboard made in factory B given that it is faulty)=\$$P(B|f)\$$

\n

\$$P(B|f)=\\frac{P(f|B)*P(B)}{P(f|A)*P(A)+P(f|B)*P(B)+P(f|C)*P(C)}\$$

\n

\$$P(B|f)=\\frac{\\var{pd2}*\\var{p2}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}}\$$

\n

\$$P(B|f)=\\frac{\\var{pd2}*\\var{p2}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}}\$$

\n

\$$P(B|f)=\\frac{\\simplify{{pd2}*{p2}}}{\\simplify{{pd1}*{p1}}+\\simplify{{pd2}*{p2}}+\\simplify{{pd3}*{p3}}}\$$

\n

\$$P(B|f)=\\simplify{({pd2}*{p2})/({pd1}*{p1}+{pd2}*{p2}+{pd3}*{p3})}\$$

\n

\$$P(B|f)=\\var{prob_b}\$$

\n

\n

(c)    P(keyboard made in factory C given that it is faulty)=\$$P(C|f)\$$

\n

\$$P(C|f)=1-P(A|f)-P(B|f)\$$

\n

\$$P(C|f)=1-\\var{prob_a}-\\var{prob_b}\$$

\n

\$$P(C|f)=1-\\simplify{{prob_a}+{prob_b}}\$$

\n

\$$P(C|f)=\\var{prob_c}\$$

\n

\n

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

Calculate the probability that

\n

(a)     the keyboard was made in factory A;    [[0]]

\n

(b)     the keyboard was made in factory B;    [[1]]

\n

(c)     the keyboard was made in factory C;    [[2]]

\n

A wireless keyboard made by a computer company was returned by a retailer and found to be faulty.

\n

The keyboards are made at three different locations.

\n

A quality control manager is responsible for investigating the source of the discovered defects. The percentage of total stock produced by each factory and the expected percentage of defective product produced there is tabulated below.

\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
 Factory % total production % of defects expected A \$$\\var{p1a}\$$% \$$\\var{pd1a}\$$% B \$$\\var{p2a}\$$% \$$\\var{pd2a}\$$% C \$$\\var{p3a}\$$% \$$\\var{pd3a}\$$%
\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"p2": {"definition": "{p2a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "p2", "description": ""}, "p1a": {"definition": "random(25..50#5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p1a", "description": ""}, "pd1a": {"definition": "random(0.5..3#0.5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "pd1a", "description": ""}, "p1": {"definition": "{p1a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "p1", "description": ""}, "p2a": {"definition": "random(15..35#5)", "templateType": "randrange", "group": "Ungrouped variables", "name": "p2a", "description": ""}, "p3": {"definition": "{p3a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "p3", "description": ""}, "pd3a": {"definition": "random(0.5..4#0.4)", "templateType": "randrange", "group": "Ungrouped variables", "name": "pd3a", "description": ""}, "p3a": {"definition": "100-{p2a}-{p1a}", "templateType": "anything", "group": "Ungrouped variables", "name": "p3a", "description": ""}, "pd3": {"definition": "{pd3a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "pd3", "description": ""}, "pd2": {"definition": "{pd2a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "pd2", "description": ""}, "pd1": {"definition": "{pd1a}/100", "templateType": "anything", "group": "Ungrouped variables", "name": "pd1", "description": ""}, "pd2a": {"definition": "random(0.6..2.8#0.2)", "templateType": "randrange", "group": "Ungrouped variables", "name": "pd2a", "description": ""}, "prob_b": {"definition": "({pd2a}*{p2})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3})", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_b", "description": ""}, "prob_c": {"definition": "({pd3a}*{p3})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3})", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_c", "description": ""}, "prob_a": {"definition": "({pd1a}*{p1})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3})", "templateType": "anything", "group": "Ungrouped variables", "name": "prob_a", "description": ""}}, "metadata": {"description": "", "licence": "None specified"}, "type": "question"}, {"name": "Baye's 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

A person is tested at random and found to have a blood disorder.

\n

Studies have shown that the probability that a person has the disorder varies with blood type.

\n

The table below gives the percentage breakdown for the four main blood types among Irish people and the percentage of each blood type likely to have the disorder.

\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\n
 Blood type % of population % carriers O \$$\\var{p1a}\$$ \$$\\var{pd1a}\$$ A \$$\\var{p2a}\$$ \$$\\var{pd2a}\$$ B \$$\\var{p3a}\$$ \$$\\var{pd3a}\$$ AB \$$\\var{p4a}\$$ \$$\\var{pd4a}\$$

(a)   P(person has type O given that he is a Carrier)=\$$P(O|C)\$$

\n

According to Baye's theorem

\n

\$$P(O|C)=\\frac{P(C|O)*P(O)}{P(C|O)*P(O)+P(C|A)*P(A)+P(C|B)*P(B)+P(C|AB)*P(AB)}\$$

\n

\$$P(O|C)=\\frac{\\var{pd1}*\\var{p1}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}+\\var{pd4}*\\var{p4}}\$$

\n

\$$P(O|C)=\\frac{\\simplify{{pd1}*{p1}}}{\\simplify{{pd1}*{p1}}+\\simplify{{pd2}*{p2}}+\\simplify{{pd3}*{p3}}+\\simplify{{pd4}*{p4}}}\$$

\n

\$$P(O|C)=\\simplify{({pd1}*{p1})/({pd1}*{p1}+{pd2}*{p2}+{pd3}*{p3}+{pd4}*{p4})}\$$

\n

\$$P(O|C)=\\var{prob_a}\$$

\n

\n

(b)   P(person has type A given that he is a Carrier)=\$$P(A|C)\$$

\n

\$$P(A|C)=\\frac{P(C|A)*P(A}{P(C|O)*P(O)+P(C|A)*P(A)+P(C|B)*P(B)+P(C|AB)*P(AB)}\$$

\n

\$$P(A|C)=\\frac{\\var{pd2}*\\var{p2}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}+\\var{pd4}*\\var{p4}}\$$

\n

\$$P(A|C)=\\frac{\\simplify{{pd2}*{p2}}}{\\simplify{{pd1}*{p1}}+\\simplify{{pd2}*{p2}}+\\simplify{{pd3}*{p3}}+\\simplify{{pd4}*{p4}}}\$$

\n

\$$P(A|C)=\\simplify{({pd2}*{p2})/({pd1}*{p1}+{pd2}*{p2}+{pd3}*{p3}+{pd4}*{p4})}\$$

\n

\$$P(A|C)=\\var{prob_b}\$$

\n

\n

\n

(c)  P(person has type B given that he is a Carrier)=\$$P(B|C)\$$

\n

\$$P(B|C)=\\frac{P(C|B)*P(B}{P(C|O)*P(O)+P(C|A)*P(A)+P(C|B)*P(B)+P(C|AB)*P(AB)}\$$

\n

\$$P(B|C)=\\frac{\\var{pd3}*\\var{p3}}{\\var{pd1}*\\var{p1}+\\var{pd2}*\\var{p2}+\\var{pd3}*\\var{p3}+\\var{pd4}*\\var{p4}}\$$

\n

\$$P(B|C)=\\frac{\\simplify{{pd3}*{p3}}}{\\simplify{{pd1}*{p1}}+\\simplify{{pd2}*{p2}}+\\simplify{{pd3}*{p3}}+\\simplify{{pd4}*{p4}}}\$$

\n

\$$P(B|C)=\\simplify{({pd3}*{p3})/({pd1}*{p1}+{pd2}*{p2}+{pd3}*{p3}+{pd4}*{p4})}\$$

\n

\$$P(B|C)=\\var{prob_c}\$$

\n

\n

(d)   P(person has type AB given that he is a Carrier)=1-P(person is not type AB given that he is a Carrier)

\n

= 1-P(person is type O given that he is a Carrier or person is type A given that he is a Carrier or person is type B given that he is a carrier)

\n

= 1 - \$$\\var{prob_a}+\\var{prob_b}+\\var{prob_c})\$$

\n

= \$$\\var{prob_d}\$$

\n

\n

", "rulesets": {}, "variables": {"p4a": {"name": "p4a", "group": "Ungrouped variables", "definition": "random(2 .. 4#0.5)", "description": "", "templateType": "randrange"}, "prob_d": {"name": "prob_d", "group": "Ungrouped variables", "definition": "({pd4a}*{p4})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3}+{pd4a}*{p4})", "description": "", "templateType": "anything"}, "prob_c": {"name": "prob_c", "group": "Ungrouped variables", "definition": "({pd3a}*{p3})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3}+{pd4a}*{p4})", "description": "", "templateType": "anything"}, "pd3": {"name": "pd3", "group": "Ungrouped variables", "definition": "{pd3a}/100", "description": "", "templateType": "anything"}, "prob_a": {"name": "prob_a", "group": "Ungrouped variables", "definition": "({pd1a}*{p1})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3}+{pd4a}*{p4})", "description": "", "templateType": "anything"}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "{p3a}/100", "description": "", "templateType": "anything"}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "{p2a}/100", "description": "", "templateType": "anything"}, "p4": {"name": "p4", "group": "Ungrouped variables", "definition": "{p4a}/100", "description": "", "templateType": "anything"}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "{p1a}/100", "description": "", "templateType": "anything"}, "pd1a": {"name": "pd1a", "group": "Ungrouped variables", "definition": "random(0.5 .. 3#0.5)", "description": "", "templateType": "randrange"}, "pd3a": {"name": "pd3a", "group": "Ungrouped variables", "definition": "random(3.5 .. 8#0.5)", "description": "", "templateType": "randrange"}, "p2a": {"name": "p2a", "group": "Ungrouped variables", "definition": "random(29 .. 32#0.5)", "description": "", "templateType": "randrange"}, "pd2": {"name": "pd2", "group": "Ungrouped variables", "definition": "{pd2a}/100", "description": "", "templateType": "anything"}, "p3a": {"name": "p3a", "group": "Ungrouped variables", "definition": "random(9.5 .. 12.5#0.5)", "description": "", "templateType": "randrange"}, "prob_b": {"name": "prob_b", "group": "Ungrouped variables", "definition": "({pd2a}*{p2})/({pd1a}*{p1}+{pd2a}*{p2}+{pd3a}*{p3}+{pd4a}*{p4})", "description": "", "templateType": "anything"}, "pd4": {"name": "pd4", "group": "Ungrouped variables", "definition": "{pd4a}/100", "description": "", "templateType": "anything"}, "pd2a": {"name": "pd2a", "group": "Ungrouped variables", "definition": "random(0.6 .. 2.8#0.2)", "description": "", "templateType": "randrange"}, "pd4a": {"name": "pd4a", "group": "Ungrouped variables", "definition": "random(8 .. 12#0.5)", "description": "", "templateType": "randrange"}, "pd1": {"name": "pd1", "group": "Ungrouped variables", "definition": "{pd1a}/100", "description": "", "templateType": "anything"}, "p1a": {"name": "p1a", "group": "Ungrouped variables", "definition": "100-{p2a}-{p3a}-{p4a}", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["pd3", "p1", "p1a", "p2", "p2a", "p3", "p3a", "pd1", "pd1a", "pd2", "pd2a", "pd3a", "prob_a", "prob_b", "prob_c", "p4a", "pd4a", "pd4", "prob_d", "p4"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

Calculate the probability that

\n

(a)     the person chosen has blood type O;    [[0]]

\n

(b)     the person chosen has blood type A;    [[1]]

\n

(c)     the person chosen has blood type B;    [[2]]

\n

(d)     the person chosen has blood type AB;  [[3]]

\n