// Numbas version: exam_results_page_options {"name": "IP3.1", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["strexceed", "idef", "period", "episodes", "rdexp", "u2", "check", "n9", "u1", "u3", "probexceed", "ecom", "d", "p2", "p3", "p0", "p1", "p6", "p7", "p4", "p5", "p8", "t2", "t1", "n8", "thing", "s", "r", "t", "activity", "n1", "n2", "n3", "n4", "n5", "n6", "n7"], "name": "IP3.1", "tags": ["PMF", "Probability", "discrete distribution", "expectation", "expected value", "mass function", "pmf", "probability", "probability mass function", "query", "sc", "statistics", "tested1"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

The expected number is given by:

\n

\\[\\simplify[]{{p0 / 100} * {n1} + {p1 / 100} * {n2} + {p2 / 100} * {n3} + {p3 / 100} * {n4} + {p4 / 100} * {n5} + {p5 / 100} * {n6} + {p6 / 100} * {n7} + {p7 / 100} * {n8} + {p8 / 100} * {n9} = {ecom}}\\]

\n

b)

\n

We want the probability that the number of {episodes} exceeds $\\var{ecom}$

\n

This is the probability that the number exceeds $\\var{rdexp}$ and is

\n

\\[\\sum_{i=\\var{rdexp+1}}^{i=8}\\left( \\mbox{Probability complaints}=i\\right)=\\simplify[]{{strexceed} }= \\var{probexceed/100}\\]

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "

Find the expected number of {episodes} per {period}.

\n

Answer to $2$ decimal places

\n

Expected number = [[0]]

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 2, "maxValue": "{ecom+0.01}", "minValue": "{ecom-0.01}", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

What is the probability that the number of {episodes} will exceed the expected number?

\n

Answer to $2$ decimal places.

\n

Probability = [[0]]

", "marks": 0, "gaps": [{"allowFractions": false, "marks": 2, "maxValue": "{probexceed/100+0.01}", "minValue": "{probexceed/100-0.01}", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

The probabilities that {idef} {thing} will receive {episodes} per {period} about its {activity} are given by the following table:

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Complaints012345678
Probability$\\var{p0/100}$$\\var{p1/100}$$\\var{p2/100}$$\\var{p3/100}$$\\var{p4/100}$$\\var{p5/100}$$\\var{p6/100}$$\\var{p7/100}$$\\var{p8/100}$
\n

Answer the following two parts:

\n ", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"strexceed": {"definition": "if(ecom>3,p4/100+'+'+p5/100+'+'+p6/100+'+'+p7/100+'+'+p8/100,if(ecom>4,p5/100+'+'+p6/100+'+'+p7/100+'+'+p8/100,if(ecom>5,p6/100+'+'+p7/100+'+'+p8/100,p3/100+'+'+p4/100+'+'+p5/100+'+'+p6/100+'+'+p7/100+'+'+p8/100)))", "templateType": "anything", "group": "Ungrouped variables", "name": "strexceed", "description": ""}, "idef": {"definition": "'an'", "templateType": "anything", "group": "Ungrouped variables", "name": "idef", "description": ""}, "period": {"definition": "'day'", "templateType": "anything", "group": "Ungrouped variables", "name": "period", "description": ""}, "episodes": {"definition": "'complaints'", "templateType": "anything", "group": "Ungrouped variables", "name": "episodes", "description": ""}, "rdexp": {"definition": "floor(ecom)", "templateType": "anything", "group": "Ungrouped variables", "name": "rdexp", "description": ""}, "probexceed": {"definition": "if(ecom>3,p4+p5+p6+p7+p8,if(ecom>4,p5+p6+p7+p8,if(ecom>5,p6+p7+p8,100-p0-p1-p2)))", "templateType": "anything", "group": "Ungrouped variables", "name": "probexceed", "description": ""}, "check": {"definition": "p0+p1+p2+p3+p4+p5+p6+p7+p8", "templateType": "anything", "group": "Ungrouped variables", "name": "check", "description": ""}, "thing": {"definition": "'airline'", "templateType": "anything", "group": "Ungrouped variables", "name": "thing", "description": ""}, "u1": {"definition": "round(d*random(70..100)/100)", "templateType": "anything", "group": "Ungrouped variables", "name": "u1", "description": ""}, "u3": {"definition": "u1", "templateType": "anything", "group": "Ungrouped variables", "name": "u3", "description": ""}, "u2": {"definition": "u1", "templateType": "anything", "group": "Ungrouped variables", "name": "u2", "description": ""}, "ecom": {"definition": "(n1*p0+n2*p1+n3*p2+n4*p3+n5*p4+n6*p5+n7*p6+n8*p7+n9*p8)/100", "templateType": "anything", "group": "Ungrouped variables", "name": "ecom", "description": ""}, "p7": {"definition": "p8+u1", "templateType": "anything", "group": "Ungrouped variables", "name": "p7", "description": ""}, "p2": {"definition": "p1+t2", "templateType": "anything", "group": "Ungrouped variables", "name": "p2", "description": ""}, "p3": {"definition": "r-p0-p1-p2", "templateType": "anything", "group": "Ungrouped variables", "name": "p3", "description": ""}, "p0": {"definition": "s", "templateType": "anything", "group": "Ungrouped variables", "name": "p0", "description": ""}, "p1": {"definition": "p0+t1", "templateType": "anything", "group": "Ungrouped variables", "name": "p1", "description": ""}, "p6": {"definition": "p7+u2", "templateType": "anything", "group": "Ungrouped variables", "name": "p6", "description": ""}, "d": {"definition": "round(t/15)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "p4": {"definition": "t-p8-p7-p6-p5", "templateType": "anything", "group": "Ungrouped variables", "name": "p4", "description": ""}, "p5": {"definition": "p6+u3", "templateType": "anything", "group": "Ungrouped variables", "name": "p5", "description": ""}, "p8": {"definition": "d", "templateType": "anything", "group": "Ungrouped variables", "name": "p8", "description": ""}, "t2": {"definition": "t1", "templateType": "anything", "group": "Ungrouped variables", "name": "t2", "description": ""}, "t1": {"definition": "round(s*random(70..100)/100)", "templateType": "anything", "group": "Ungrouped variables", "name": "t1", "description": ""}, "n8": {"definition": "7", "templateType": "anything", "group": "Ungrouped variables", "name": "n8", "description": ""}, "n9": {"definition": "8", "templateType": "anything", "group": "Ungrouped variables", "name": "n9", "description": ""}, "s": {"definition": "round(r/10)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "r": {"definition": "random(45..65)", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}, "t": {"definition": "100-r", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "activity": {"definition": "'luggage handling'", "templateType": "anything", "group": "Ungrouped variables", "name": "activity", "description": ""}, "n1": {"definition": "0", "templateType": "anything", "group": "Ungrouped variables", "name": "n1", "description": ""}, "n2": {"definition": "1", "templateType": "anything", "group": "Ungrouped variables", "name": "n2", "description": ""}, "n3": {"definition": "2", "templateType": "anything", "group": "Ungrouped variables", "name": "n3", "description": ""}, "n4": {"definition": "3", "templateType": "anything", "group": "Ungrouped variables", "name": "n4", "description": ""}, "n5": {"definition": "4", "templateType": "anything", "group": "Ungrouped variables", "name": "n5", "description": ""}, "n6": {"definition": "5", "templateType": "anything", "group": "Ungrouped variables", "name": "n6", "description": ""}, "n7": {"definition": "6", "templateType": "anything", "group": "Ungrouped variables", "name": "n7", "description": ""}}, "metadata": {"notes": "\n \t\t

7/07/2012:

\n \t\t

Added tags.

\n \t\t

Checked calculation.

\n \t\t

22/07/2012:

\n \t\t

Added description.

\n \t\t

Ticked stats extension box.

\n \t\t

31/07/2012:

\n \t\t

Added tags.

\n \t\t

Question appears to be working correctly.

\n \t\t

20/12/2012:

\n \t\t

Could increase the number of scenarios by using random string variables. Query tag added for that.

\n \t\t

Also very cumbersome use of variables. But no change proposed for now.

\n \t\t

Checked calculation, OK. Added tested1 tag.

\n \t\t

21/12/2012:

\n \t\t

Although asks for solution to 2 dps, there is no rounding as the raw values are to 2 dps. Added sc tag for possible scenarios.

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

Given a probability mass function $P(X=i)$ with outcomes $i \\in \\{0,1,2,\\ldots 8\\}$, find the expectation $E$ and $P(X \\gt E)$.

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}