// Numbas version: exam_results_page_options {"type": "exam", "allQuestions": true, "pickQuestions": 0, "showQuestionGroupNames": false, "duration": 0, "navigation": {"reverse": true, "onleave": {"action": "none", "message": ""}, "preventleave": false, "browse": true, "showfrontpage": false, "allowregen": true, "showresultspage": "never"}, "questions": [], "question_groups": [{"pickingStrategy": "all-ordered", "name": "", "pickQuestions": 0, "questions": [{"name": "BS3.1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": ["Binomial Distribution", "Binomial distribution", "binomial distribution", "poisson distribution", "Poisson distribution", "random variables", "sc", "statistical distributions", "statistics"], "metadata": {"description": "

Given descriptions of  3 random variables, decide whether or not each is from a Poisson or Binomial distribution.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "\n

Which of the following random variables could be modelled with a binomial distribution and which could be modelled with a Poisson distribution?

\n

You will lose 1 mark for every incorrect answer. The minimum mark is 0.

\n ", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"p2": {"name": "p2", "group": "Ungrouped variables", "definition": "switch(t=0,random(0..abs(b)-1 except p1),random(0..abs(pd)-1 except p3))", "description": "", "templateType": "anything", "can_override": false}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "random(0..abs(pd)-1)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "\n [\"20% of eggs from a family-run farm are bad. X is the number of bad eggs in a box of a dozen.\",\n \"A salesperson has a 50% chance of making a sale on a customer visit and she arranges 10 visits in a day. Let X be the number of sales that day.\",\n \"30% of items off a factory production line have been shown to have defects. Let A be the number of defectives in a box of 20 such items.\",\n \"One in ten new small businesses in the north-east goes bust within a year. Let X be the number of small businesses that fail in the next year out of thirty that have been set up.\",\n \"The probability that an office photocopier will fail on any given day is 0.15. The human resources office at Newcastle University has ten such photocopiers; Let Y be the number of photocopiers that fail today.\",\n \"Callers to the Vodaphone call centre will get through to an operator immediately with probability 0.25. X is the number of callers that speak to an operator immediately out of thirty such callers.\",\n \"Experience has shown that two in every ten components produced by a circuitboard company will be defective. A random sample of 100 components is inspected for defects, and D is the number of defectives in this sample.\"]\n ", "description": "", "templateType": "anything", "can_override": false}, "mm": {"name": "mm", "group": "Ungrouped variables", "definition": "[[1,-1],[1-2*t,2*t-1],[-1,1]]", "description": "", "templateType": "anything", "can_override": false}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "random(0..abs(b)-1)", "description": "", "templateType": "anything", "can_override": false}, "ch1": {"name": "ch1", "group": "Ungrouped variables", "definition": "b[p1]", "description": "", "templateType": "anything", "can_override": false}, "ch2": {"name": "ch2", "group": "Ungrouped variables", "definition": "switch(t=0,b[p2],pd[p2])", "description": "", "templateType": "anything", "can_override": false}, "ch3": {"name": "ch3", "group": "Ungrouped variables", "definition": "pd[p3]", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}, "pd": {"name": "pd", "group": "Ungrouped variables", "definition": "\n [\"Y is the number of flights sold per hour by an online travel agency. This travel agency usually sells 10 flights per hour.\",\n \"X is the number of cars sold by a local garage in a month. This garage usually sells about 10 cars per month.\",\n \"The number of calls, Y, received at the British Passport Office in Durham occurs at the rate of 10 a minute.\",\n \"We are interested in X, the number of machine breakdowns in a day. Such breakdowns at a particular IT company occur at a rate of eight per week.\",\n \"Lemons are packed in boxes; the probability that a lemon is bad once a box is opened is 0.05. Let X be the number of boxes with at least one bad lemon.\",\n \"On average, three patients arrive at a local Accident and Emergency department every hour. We count the number, X, of patients in an hour period.\",\n \"About five customers arrive at a fish shop queue every ten minutes during the lunch time rush. We count X, the number of customers arriving during the lunch time rush.\"]\n ", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["p2", "p3", "b", "mm", "ch3", "ch1", "ch2", "p1", "t", "pd"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "shuffleAnswers": false, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["{ch1}", "{ch2}", "{ch3}"], "matrix": "mm", "layout": {"type": "all", "expression": ""}, "answers": ["Binomial Distribution", "Poisson Distribution"]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "BS3.2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["pre", "what", "this", "things", "number1", "descx", "else", "thismany", "something", "tol", "v", "tprob1", "sd", "tprob2", "prob2", "thisnumber", "thisaswell", "prob1"], "tags": ["Poisson distribution", "Probability", "expectation", "expected number", "poisson distribution", "probabilities", "probability", "sc", "standard deviation", "statistical distributions", "statistics"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

1. $X \\sim \\operatorname{Poisson}(\\var{thismany})$, so $\\lambda = \\var{thismany}$.

\n

2. The expectation is given by $\\operatorname{E}[X]=\\lambda=\\var{thismany}$

\n

3. $\\operatorname{stdev}(X)=\\sqrt{\\lambda}=\\sqrt{\\var{thismany}}=\\var{sd}$ to 3 decimal places.

\n

b)

\n

1. \\[ \\begin{eqnarray*}\\operatorname{P}(X = \\var{thisnumber}) &=& \\frac{e ^ { -\\var{thismany}}\\var{thismany} ^ {\\var{thisnumber}}} {\\var{thisnumber}!}\\\\& =& \\var{prob1} \\end{eqnarray*} \\] to 3 decimal places.

\n

2. If an employee receives a warning then he or she must have sold less than {number1}.

\n

Hence we need to find:

\n

\\[ \\begin{eqnarray*}\\operatorname{P}(X < \\var{number1})& =& \\simplify[all,!collectNumbers]{P(X = 0) + P(X = 1) + {v}*P(X = 2)}\\\\& =& \\simplify[all,!collectNumbers]{e ^ { -thismany} + {thismany} * e ^ { -thismany} + {v} * (({thismany} ^ 2 * e ^ { -thismany}) / 2)} \\\\&=& \\var{prob2} \\end{eqnarray*} \\]

\n

to 3 decimal places.

\n

 

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

Assuming a Poisson distribution for $X$, {descX}, write down the value of $\\lambda$.

\n

$X \\sim \\operatorname{Poisson}(\\lambda)$

\n

$\\lambda = $ [[0]]

\n

Find $\\operatorname{E}[X]$ the expected {descX}.

\n

$\\operatorname{E}[X]=$ [[1]]

\n

Find the standard deviation for {what}.

\n

Standard deviation = [[2]] (to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 0.25, "maxValue": "thismany", "minValue": "thismany", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.25, "maxValue": "thismany", "minValue": "thismany", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "sd+tol", "minValue": "sd-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

Find the probability that {this} $\\var{thisnumber}$ {things}

\n

$\\operatorname{P}(X=\\var{thisnumber})=$ [[0]] (to 3 decimal places).

\n

 

\n

Find the probability that {thisaswell}

\n

Probability = [[1]] (to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "prob1+tol", "minValue": "prob1-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "prob2+tol", "minValue": "prob2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

{pre} $\\var{thismany}$.

\n

{something} $\\var{number1}$ {else}

\n

 

\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"pre": {"definition": "\"The mean number of sales per day at a telecommunications centre is \"", "templateType": "anything", "group": "Ungrouped variables", "name": "pre", "description": ""}, "what": {"definition": "\"daily sales.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "what", "description": ""}, "this": {"definition": "\"a randomly selected employee makes exactly \"", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "things": {"definition": "\"sales.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "things", "description": ""}, "prob1": {"definition": "precround(tprob1,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob1", "description": ""}, "v": {"definition": "if(number1=2,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "description": ""}, "descx": {"definition": "\"the number of sales per day\"", "templateType": "anything", "group": "Ungrouped variables", "name": "descx", "description": ""}, "else": {"definition": "\"per day.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "else", "description": ""}, "thismany": {"definition": "random(5..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "thismany", "description": ""}, "something": {"definition": "\"Employees receive a warning if they make less than \"", "templateType": "anything", "group": "Ungrouped variables", "name": "something", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "number1": {"definition": "if(thismany<8,2, 3)", "templateType": "anything", "group": "Ungrouped variables", "name": "number1", "description": ""}, "tprob1": {"definition": "(thismany^thisnumber)*e^(-thismany)/fact(thisnumber)", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob1", "description": ""}, "tprob2": {"definition": "if(number1=2,e^(-thismany)*(1+thismany),e^(-thismany)*(1+thismany+thismany^2/2))", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob2", "description": ""}, "prob2": {"definition": "precround(tprob2,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob2", "description": ""}, "thisnumber": {"definition": "if(thismany<8,thismany-1, random(3..7))", "templateType": "anything", "group": "Ungrouped variables", "name": "thisnumber", "description": ""}, "thisaswell": {"definition": "\"a randomly selected employee receives a warning.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "thisaswell", "description": ""}, "sd": {"definition": "precround(sqrt(thismany),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "sd", "description": ""}}, "metadata": {"notes": "\n \t\t

31/12/2012:

\n \t\t

Can be configured to other applications using the string variables supplied. Hence added tag sc.

\n \t\t

Not as yet properly tested.

\n \t\t", "description": "\n \t\t

Application of the Poisson distribution given expected number of events per interval.

\n \t\t

Finding probabilities using the Poisson distribution.

\n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS3.3", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["pre", "descx1", "something", "thisnumber", "what", "things", "descx", "tol", "prob", "thisaswell", "else", "thismany", "number1", "post", "prob2", "prob1", "thatnumber", "this", "v", "tprob1", "tprob2", "sd"], "tags": ["Binomial Distribution", "Binomial distribution", "Probability", "binomial distribution", "expectation", "expected number", "probabilities", "probability", "sc", "standard deviation", "statistical distributions", "statistics"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

1. $X \\sim \\operatorname{bin}(\\var{number1},\\var{prob})$, so $n= \\var{number1},\\;\\;p=\\var{prob}$.

\n

2. The expectation is given by $\\operatorname{E}[X]=n\\times p=\\var{number1}\\times \\var{prob}=\\var{number1*prob}$

\n

3. $\\operatorname{stdev}(X)=\\sqrt{n\\times p \\times (1-p)}=\\sqrt{\\var{number1}\\times \\var{prob} \\times \\var{1-prob}}=\\var{sd}$ to 3 decimal places.

\n

b)

\n

1. \\[ \\begin{eqnarray*}\\operatorname{P}(X = \\var{thisnumber}) &=& \\dbinom{\\var{number1}}{\\var{thisnumber}}\\times\\var{prob}^{\\var{thisnumber}}\\times(1-\\var{prob})^{\\var{number1-thisnumber}}\\\\& =& \\var{comb(number1,thisnumber)} \\times\\var{prob}^{\\var{thisnumber}}\\times\\var{1-prob}^{\\var{number1-thisnumber}}\\\\&=&\\var{prob1}\\end{eqnarray*} \\] to 3 decimal places.

\n

2. 

\n

\\[ \\begin{eqnarray*}\\operatorname{P}(X \\leq \\var{thatnumber})& =& \\simplify[all,!collectNumbers]{P(X = 0) + P(X = 1) + {v}*P(X = 2)}\\\\& =& \\simplify[zeroFactor,zeroTerm,unitFactor]{{1 -prob} ^ {number1}+ {number1} *{prob} *{1 -prob} ^ {number1 -1} + {v} * ({number1} * {number1 -1}/2)* {prob} ^ 2 *( {1 -prob} ^ {number1 -2})}\\\\& =& \\var{prob2}\\end{eqnarray*} \\]

\n

to 3 decimal places.

\n

 

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

Assuming a binomial distribution for $X$ , {descX}, write down the values of $n$ and $p$.

\n

$X \\sim \\operatorname{bin}(n,p)$

\n

$n=$ [[0]]        $p=$ [[1]]

\n

Find $\\operatorname{E}[X]$ the expected {descX1}

\n

$\\operatorname{E}[X]=$ [[2]]

\n

Find the standard deviation for the {descX1}

\n

Standard deviation = [[3]] (to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 0.25, "maxValue": "number1", "minValue": "number1", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.25, "maxValue": "prob", "minValue": "prob", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "number1*thismany/100", "minValue": "number1*thismany/100", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "sd+tol", "minValue": "sd-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

Find the probability that {this} $\\var{thisnumber}$ {things}

\n

$\\operatorname{P}(X=\\var{thisnumber})=$ [[0]] (to 3 decimal places).

\n

 

\n

Find the probability that {thisaswell} {thatnumber} {things}

\n

Probability = [[1]] (to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "prob1+tol", "minValue": "prob1-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "prob2+tol", "minValue": "prob2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

{pre} $\\var{thismany}$ {post}

\n

{something} $\\var{number1}$ {else}

\n

 

\n \n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"pre": {"definition": "' '", "templateType": "anything", "group": "Ungrouped variables", "name": "pre", "description": ""}, "descx1": {"definition": "\"number of chocolate chip cookies in our sample:\"", "templateType": "anything", "group": "Ungrouped variables", "name": "descx1", "description": ""}, "something": {"definition": "''", "templateType": "anything", "group": "Ungrouped variables", "name": "something", "description": ""}, "thisnumber": {"definition": "if(number1<6,random(2..3), if(number1<8,random(2..4),random(3..6)))", "templateType": "anything", "group": "Ungrouped variables", "name": "thisnumber", "description": ""}, "what": {"definition": "\"daily sales.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "what", "description": ""}, "things": {"definition": "\"chocolate chip cookies.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "things", "description": ""}, "descx": {"definition": "\"the number of chocolate chip cookies\"", "templateType": "anything", "group": "Ungrouped variables", "name": "descx", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "prob": {"definition": "thismany/100", "templateType": "anything", "group": "Ungrouped variables", "name": "prob", "description": ""}, "thisaswell": {"definition": "\"our selection contains no more than \"", "templateType": "anything", "group": "Ungrouped variables", "name": "thisaswell", "description": ""}, "else": {"definition": "\"biscuits are selected at random.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "else", "description": ""}, "thismany": {"definition": "random(15..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "thismany", "description": ""}, "number1": {"definition": "random(5..12)", "templateType": "anything", "group": "Ungrouped variables", "name": "number1", "description": ""}, "post": {"definition": "\"% of biscuits made by a baker are chocolate chip cookies.\"", "templateType": "anything", "group": "Ungrouped variables", "name": "post", "description": ""}, "prob2": {"definition": "precround(tprob2,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob2", "description": ""}, "prob1": {"definition": "precround(tprob1,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob1", "description": ""}, "thatnumber": {"definition": "random(1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "thatnumber", "description": ""}, "this": {"definition": "\"our selection contains exactly \"", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "v": {"definition": "if(thatnumber=1,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "description": ""}, "tprob1": {"definition": "comb(number1,thisnumber)*prob^thisnumber*(1-prob)^(number1-thisnumber)", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob1", "description": ""}, "tprob2": {"definition": "if(thatnumber=2,(1-prob)^number1+number1*prob*(1-prob)^(number1-1)+number1*(number1-1)*prob^2*(1-prob)^(number1-2)/2,(1-prob)^number1+number1*prob*(1-prob)^(number1-1))", "templateType": "anything", "group": "Ungrouped variables", "name": "tprob2", "description": ""}, "sd": {"definition": "precround(sqrt(number1*prob*(1-prob)),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "sd", "description": ""}}, "metadata": {"notes": "\n \t\t \t\t \t\t

31/12/2012:

\n \t\t \t\t \t\t

Can be configured to other applications using the string variables supplied. Hence added tag sc.

\n \t\t \t\t \t\t

Not as yet properly tested.

\n \t\t \t\t \n \t\t \n \t\t", "description": "\n \t\t \t\t

Application of the binomial distribution given probabilities of success of an event.

\n \t\t \t\t

Finding probabilities using the binomial distribution.

\n \t\t \n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS3.4", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["units1", "upper", "lower", "p1", "m", "amount", "p", "s", "stuff", "tol", "prob2", "prob1"], "tags": ["Normal distribution", "continuous random variable", "mean", "normal distribution", "normal tables", "probabilities", "random variable", "sc", "standard deviation", "statistical distributions", "statistics", "z-scores"], "preamble": {"css": "", "js": ""}, "advice": "\n

1. Converting to $\\operatorname{N}(0,1)$

\n

$\\simplify[all,!collectNumbers]{P(X < {lower}) = P(Z < ({lower} -{m}) / {s}) = P(Z < {lower-m}/{s}) = 1 -P(Z < {m-lower}/{s})} = 1 -\\var{p} = \\var{precround(1 -p,4)}$ to 4 decimal places.

\n

2. Converting to $\\operatorname{N}(0,1)$

\n

$\\simplify[all,!collectNumbers]{P(X > {upper}) = P(Z > ({upper} -{m}) / {s}) = P(Z > {upper-m}/{s}) = 1 -P(Z < {upper-m}/{s})} = 1-\\var{p1} = \\var{precround(1 -p1,4)}$ to 4 decimal places.

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

Find the probability that in a particular week the {amount} is less than {lower} {units1}:

\n

Probability = [[0]] (to 4  decimal places)

\n

Find the probability that in a particular week the {amount} is greater than {upper} {units1}:

\n

Probability = [[1]] (to 4  decimal places)

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "prob1+tol", "minValue": "prob1-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "prob2+tol", "minValue": "prob2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

The {amount}, $X$, of {stuff}  is normally distributed with mean {m}k and standard deviation {s}{units1}.

\n

i.e.   \\[X \\sim \\operatorname{N}(\\var{m},\\var{s}^2)\\]

\n

 

\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"units1": {"definition": "\"k Wh\"", "templateType": "anything", "group": "Ungrouped variables", "name": "units1", "description": ""}, "upper": {"definition": "random(m+0.5s..m+1.5*s#5)", "templateType": "anything", "group": "Ungrouped variables", "name": "upper", "description": ""}, "lower": {"definition": "random(m-1.5*s..m-0.5s#5)", "templateType": "anything", "group": "Ungrouped variables", "name": "lower", "description": ""}, "p1": {"definition": "normalcdf((upper-m)/s,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "p1", "description": ""}, "m": {"definition": "random(750..1250#50)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "s": {"definition": "random(60..100#10)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "p": {"definition": "normalcdf((m-lower)/s,0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "amount": {"definition": "\"electricity consumption\"", "templateType": "anything", "group": "Ungrouped variables", "name": "amount", "description": ""}, "stuff": {"definition": "\"a frozen foods warehouse each week in the summer months \"", "templateType": "anything", "group": "Ungrouped variables", "name": "stuff", "description": ""}, "tol": {"definition": "0.0001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "prob2": {"definition": "precround(1-normalcdf(upper,m,s),4)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob2", "description": ""}, "prob1": {"definition": "precround(normalcdf(lower,m,s),4)", "templateType": "anything", "group": "Ungrouped variables", "name": "prob1", "description": ""}}, "metadata": {"notes": "\n \t\t

1/1/2012:

\n \t\t

Can be configured to other applications using the string variables suppplied. Included tag sc.

\n \t\t", "description": "

Given a random variable $X$  normally distributed as $\\operatorname{N}(m,\\sigma^2)$ find probabilities $P(X \\gt a),\\; a \\gt m;\\;\\;P(X \\lt b),\\;b \\lt m$.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS3.5", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["upper", "lower", "ans1", "ans2", "ans3", "thisdis", "t", "tol"], "tags": ["continuous distributions", "expectation", "probabilities", "sc", "statistical distributions", "statistics", "uniform distribution", "uniformly distributed", "variance"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

For a uniform distribution \\[X \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\] we have:

\n

$\\displaystyle \\operatorname{E}[X] = \\frac{\\var{lower}+\\var{upper}}{2}=\\var{ans1}$m

\n

$\\displaystyle \\operatorname{Var}[X] = \\frac{(\\var{upper}-\\var{lower})^2}{12}=\\frac{(\\var{upper-lower})^2}{12}=\\var{ans2}$ to 3 decimal places.

\n

b)

\n

$\\displaystyle P(X \\le \\var{thisdis}\\textrm{km})=\\frac{\\var{thisdis}\\times 1000 -\\var{lower}}{\\var{upper}-\\var{lower}}=\\var{ans3}$ to 3 decimal places.

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

Find $\\operatorname{E}[X]$, the expected distance in metres of the new supermarket from the town centre:

\n

$\\operatorname{E}[X]=$ [[0]]m (to 3 decimal places).

\n

Also find the variance $\\operatorname{Var}(X)$:

\n

 $\\operatorname{Var}(X)=$ [[1]] (to 3 decimal places).

\n

 

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "ans1", "minValue": "ans1", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "ans2+tol", "minValue": "ans2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

Find the probability that the supermarket opens within $\\var{thisdis}$ kilometres of the town centre.

\n

$P(X \\le \\var{thisdis}\\textrm{km})=$ [[0]] (to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "ans3+tol", "minValue": "ans3-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

A new supermarket plans to open somewhere on the outskirts of a town. In fact, $X$, the distance of a new supermarket from the town centre is Uniformly distributed between $\\var{lower}$ metres and $\\var{upper}$ metres i.e. 

\n

\\[X \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\]

\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"upper": {"definition": "lower+random(300..500#50)", "templateType": "anything", "group": "Ungrouped variables", "name": "upper", "description": ""}, "lower": {"definition": "random(500..1000#50)", "templateType": "anything", "group": "Ungrouped variables", "name": "lower", "description": ""}, "ans1": {"definition": "(upper+lower)/2", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}, "ans2": {"definition": "precround((upper-lower)^2/12,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "ans3": {"definition": "precround((thisdis*1000-lower)/(upper-lower),3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans3", "description": ""}, "thisdis": {"definition": "precround((t*lower+(100-t)*upper)/100000,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "thisdis", "description": ""}, "t": {"definition": "random(20..80)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}}, "metadata": {"notes": "

1/01/2013:

\n

Although this application is fixed, it could be made into a \"scenario\" based question by introducing string variables, so added tag sc.

\n

25/01/2013:

\n

Included missed out request to calculate to 3 decimal places.

", "description": "\n \t\t

Exercise using a given uniform distribution $X$, calculating the expectation and variance. Also finding $P(X \\le a)$ for a given value $a$.

\n \t\t

 

\n \t\t", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "BS3.6", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["that", "this", "ans1", "ans2", "ans3", "period", "ra", "tol", "tans3", "thistime"], "tags": ["Probability", "continuous distributions", "distributions", "expectation", "exponential distribution", "probability", "sc", "statistical distributions", "statistics", "variance"], "preamble": {"css": "", "js": ""}, "advice": "

If $X \\sim \\operatorname{exp}(\\lambda)$ then $\\displaystyle \\operatorname{E}[X] =\\frac{1}{\\lambda}$ and  $\\displaystyle \\operatorname{Var}(X)=\\frac{1}{\\lambda^2}$.

\n

Also $P(X \\lt a)=1-e^{-\\lambda a}$.

\n

a)

\n

If $X \\sim \\operatorname{exp}(\\var{ra})$ then:

\n

$\\displaystyle \\operatorname{E}[X] =\\frac{1}{\\lambda}=\\frac{1}{\\var{ra}}=\\var{ans1}$ to 3 decimal places.

\n

$\\displaystyle \\operatorname{Var}(X) =\\frac{1}{\\lambda^2}=\\frac{1}{\\var{ra}^2}=\\var{ans2}$ to 3 decimal places.

\n

b)

\n

$P(X \\lt \\var{thistime}) = 1 -(e ^ {-\\var{ ra} \\times \\var{thistime}}) = 1 -(e ^ { -\\var{ra * thistime}}) = \\var{ans3}$ to 3 decimal places.

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

Find $\\operatorname{E}[X]$ between {this}:

\n

$\\operatorname{E}[X]=$ [[0]]{period} (enter as a decimal correct to 3 decimal places).

\n

Find $\\operatorname{Var}(X)$:

\n

$\\operatorname{Var}(X)=$ [[1]] (enter as a decimal correct to 3 decimal places).

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "ans1+tol", "minValue": "ans1-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 1, "maxValue": "ans2+tol", "minValue": "ans2-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

Find the probability that the time between {that} is less than $\\var{thistime}$ {period}:

\n

 $P(X \\lt \\var{thistime})=$ [[0]](enter as a decimal correct to 3 decimal places)

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "ans3+tol", "minValue": "ans3-tol", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

The time,  in {period} between {this} follows an exponential distribution with rate $\\var{ra}$ i.e. 

\n

\\[X \\sim \\operatorname{exp}(\\var{ra})\\]

\n \n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"that": {"definition": "\"two customers arriving \"", "templateType": "anything", "group": "Ungrouped variables", "name": "that", "description": ""}, "this": {"definition": "\"customer arrivals at the RyanJet check-in desk at Newcastle Airport \"", "templateType": "anything", "group": "Ungrouped variables", "name": "this", "description": ""}, "ans1": {"definition": "precround(1/ra,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}, "ans2": {"definition": "precround(1/ra^2,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "ans3": {"definition": "precround(tans3,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans3", "description": ""}, "period": {"definition": "\"minutes\"", "templateType": "anything", "group": "Ungrouped variables", "name": "period", "description": ""}, "ra": {"definition": "random(0.2..1.2#0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "ra", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "tans3": {"definition": "1-exp(-ra*thistime)", "templateType": "anything", "group": "Ungrouped variables", "name": "tans3", "description": ""}, "thistime": {"definition": "random(0.8..1.8#0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "thistime", "description": ""}}, "metadata": {"notes": "\n \t\t \t\t

1/01/2013:

\n \t\t \t\t

This question can be changed to other applications via string variables. Added tag sc.

\n \t\t \n \t\t", "description": "

Question on the exponential distribution involving a time intervals and arrivals application, finding expectation and variance. Also finding the probability that a time interval between arrivals is less than a given period. All parameters and times randomised. 

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "\n \t\t

6 questions on standard statistical distributions.

\n \t\t

Binomial, Poisson, Normal, Uniform, Exponential.

\n \t\t"}, "percentPass": 0, "shuffleQuestions": false, "timing": {"timeout": {"action": "none", "message": ""}, "allowPause": true, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"allowrevealanswer": true, "advicethreshold": 0, "showtotalmark": true, "showactualmark": true, "showanswerstate": true}, "name": "Maria's copy of mathcentre: Probability distributions", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}