// Numbas version: finer_feedback_settings {"name": "IP3.3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"scale": {"definition": "map(b*x+c,x,a)", "type": "list", "language": "jme", "parameters": [["a", "list"], ["b", "number"], ["c", "number"]]}}, "ungrouped_variables": ["a", "b", "d", "p", "pmf", "q", "twice", "x8", "expx", "t", "m2", "x2", "x3", "x0", "x1", "x6", "x7", "x4", "x5"], "name": "IP3.3", "tags": ["PMF", "Probability", "choose without replacement", "expectation", "expected value", "mass function", "pmf", "probabilities", "probability", "probability mass function", "random choice", "statistics", "tested1", "udf", "without replacement"], "preamble": {"css": "", "js": ""}, "advice": "
First we find the sums that can occur by simply adding two different numbers together from the given.
\nNote that these are pairs of different numbers as we choose without replacement.
\nWe get:
\n$X=x$ | \n$\\var{pmf[0]}$ | \n$\\var{pmf[1]}$ | \n$\\var{pmf[2]}$ | \n$\\var{pmf[3]}$ | \n$\\var{pmf[4]}$ | \n$\\var{pmf[5]}$ | \n$\\var{pmf[6]}$ | \n$\\var{pmf[7]}$ | \n$\\var{pmf[8]}$ | \n
We have to find the probabilities that each of these sums occur.
\nThere are $10$ ways of selecting $2$ numbers from the $5$ given, but it may be the case that two different pairs produce the same sum.
\nIn this case we find that there are two ways of producing the sum $\\var{twice}$. All other sums have only one way.
\nSo since each selection of a pair of numbers has probability $0.1$.
\nThe probability of producing the sum $\\var{twice}$ is $0.2$ , and the other sums have probability $0.1$ .
\nThe expectation is given by:
\n\\[ \\begin{eqnarray*} E[X]&=& \\sum xP(X=x)\\\\ &=&\\simplify[]{ {pmf[0]}*{x0}+{pmf[1]}*{x1}+{pmf[2]}*{x2}+{pmf[3]}*{x3}+{pmf[4]}*{x4}+{pmf[5]}*{x5}+{pmf[6]}*{x6}+{pmf[7]}*{x7}+{pmf[8]}*{x8}}\\\\ &=&\\var{expx} \\end{eqnarray*} \\]
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n \n \nInput the possible values of $X$ in the following table.
\n \n \n \nYou have to input these in increasing order.
\n \n \n \nAlso find the probability mass function $P(X=x)$ values and input them into the table.
\n \n \n \nInput all values as exact values.
\n \n \n \n$X=x$ | [[0]] | [[1]] | [[2]] | [[3]] | [[4]] | [[5]] | [[6]] | [[7]] | [[8]] |
---|---|---|---|---|---|---|---|---|---|
$P(X=x)$ | [[9]] | [[10]] | [[11]] | [[12]] | [[13]] | [[14]] | [[15]] | [[16]] | [[17]] |
Find the expectation, $E[X]$ of $X$.
\nInput as an exact decimal.
\n$E[X]=\\;\\;$[[0]]
\n ", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1.2, "maxValue": "{expx}", "minValue": "{expx}", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\nTwo of the integers $\\var{d[0]},\\;\\var{d[1]}, \\;\\var{d[2]}, \\;\\var{d[3]}, \\;\\var{d[4]} $ are chosen at random, without replacement.
\nLet $X$ denote the sum of the chosen two values.
\nAnswer the following two parts:
\n ", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "[[0,1,2,3,7],[0,1,2,4,6],[0,1,3,5,7]]", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "b": {"definition": "[[1,2,3,4,5,7,8,9,10],[1,2,3,4,5,6,7,8,10],[1,3,4,5,6,7,8,10,12]]", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "scale(a[t],p,q)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "twice": {"definition": "switch(t=0,pmf[2],t=1,pmf[5],pmf[6])", "templateType": "anything", "group": "Ungrouped variables", "name": "twice", "description": ""}, "x8": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x8", "description": ""}, "q": {"definition": "random(-9..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "q", "description": ""}, "p": {"definition": "random(1,2,3,4)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "pmf": {"definition": "scale(b[t],p,2*q)", "templateType": "anything", "group": "Ungrouped variables", "name": "pmf", "description": ""}, "expx": {"definition": "x0*pmf[0]+x1*pmf[1]+x2*pmf[2]+x3*pmf[3]+x4*pmf[4]+x5*pmf[5]+x6*pmf[6]+x7*pmf[7]+x8*pmf[8]", "templateType": "anything", "group": "Ungrouped variables", "name": "expx", "description": ""}, "t": {"definition": "random(0..2)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "m2": {"definition": "if(t=0,0.2,0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "m2", "description": ""}, "x2": {"definition": "if(t=0,0.2,0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "x2", "description": ""}, "x3": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x3", "description": ""}, "x0": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x0", "description": ""}, "x1": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x1", "description": ""}, "x6": {"definition": "if(t=2,0.2,0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "x6", "description": ""}, "x7": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x7", "description": ""}, "x4": {"definition": "0.1", "templateType": "anything", "group": "Ungrouped variables", "name": "x4", "description": ""}, "x5": {"definition": "if(t=1,0.2,0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "x5", "description": ""}}, "metadata": {"notes": "\n \t\t7/07/2012:
\n \t\tAdded tags.
\n \t\tChecked calculations.
\n \t\t22/07/2012:
\n \t\tAdded description.
\n \t\tImproved display, in particular replaced $E(X)$ by $E[X]$.
\n \t\tCorrected typo in Advice (\"if\" instead of \"of\").
\n \t\tTicked stats extension box.
\n \t\t31/07/2012:
\n \t\tAdded tags.
\n \t\tQuestion appears to be working correctly.
\n \t\t20/12/2012:
\n \t\tImproved display of integers in statement.
\n \t\tAdded tag udf for user-defined functions.
\n \t\tOne such:
\n \t\tscale(a,b,c)=map(b*x+c,x,a), scaling the list a.
\n \t\tCalculation OK. Added tested1 tag.
\n \t\t", "description": "Two numbers from a set of $5$ numbers are chosen at random, without replacement. Find the distribution $X$ of their sum and $E[X]$.
", "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/"}]}