// Numbas version: finer_feedback_settings {"name": "IP3.2", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "negerror", "c", "b", "error", "flse2", "flse1", "d3", "d4", "u", "t", "correct1", "correct2", "flse", "d2", "correct", "d1"], "name": "IP3.2", "tags": ["PMF", "Probability", "discrete distribution", "mass function", "pmf", "probabilities", "probability", "probability mass function", "statistics", "tested1"], "preamble": {"css": "", "js": ""}, "advice": "
A probability mass function $f(x)=P(X=x)$ has to satisfy:
\n1. $\\sum_{x \\in S} f(x) = 1$
\n2. $f(x) \\ge 0,\\;\\;\\forall x \\in S$
\nIn this case:
\n{correct} as
\n1. {correct1}
\n2. {correct2}
\nTo verify this we calculate the function as follows:
\n\\[ \\begin{eqnarray*} P(X = \\var{d1}) &=&\\simplify[std]{({a} * {d1} + {b}) / {c} = {(a * d1 + b)} / {c}}\\\\ P(X = \\var{d2}) &=&\\simplify[std]{({a} * {d2} + {b}) / {c} = {a * d2 + b} / {c}}\\\\ P(X = \\var{d3}) &=&\\simplify[std]{({a} * {d3} + {b}) / {c} = {a * d3 + b} / {c}}\\\\ P(X = \\var{d4}) &=&\\simplify[std]{({a} * {d4} + {b}) / {c} = {a * d4 + b} / {c}} \\end{eqnarray*} \\]
and
\\[\\sum_{x \\in S} f(x) =\\simplify[std]{{c-error}/{c}}\\]
as you can easily check.
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "Does the following define a valid probability mass function?
\n\\[P(X=x) = \\simplify{({a}x+{b})/{c}},\\;\\;\\;x \\in S=\\{\\var{d1},\\;\\var{d2},\\;\\var{d3},\\;\\var{d4}\\}\\]
\n[[0]]
", "marks": 0, "gaps": [{"displayColumns": 2, "matrix": [1, 0], "shuffleChoices": true, "maxMarks": 0, "distractors": ["", ""], "choices": ["{correct}
", "{flse}
"], "displayType": "radiogroup", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "minMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Tick all boxes which describe this function:
\n[[0]]
\nNote that if you choose an incorrect option then you will lose 2 marks.
\nThe minimum number of marks you can obtain is 0.
", "marks": 0, "gaps": [{"maxAnswers": 2, "displayColumns": 1, "matrix": [1, 1, -2, -2], "shuffleChoices": true, "maxMarks": 0, "minAnswers": 0, "choices": ["{correct1}
", "{correct2}
", "{flse1}
", "{flse2}
"], "displayType": "checkbox", "showCorrectAnswer": true, "scripts": {}, "distractors": ["", "", "", ""], "marks": 0, "type": "m_n_2", "minMarks": 0}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n \n \nDetermine whether the following defines a valid probability mass function.
\n \n \n \nAlso choose the options which describe the function.
\n \n \n \n ", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "negerror": {"definition": "round(-b/a)-random(1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "negerror", "description": ""}, "c": {"definition": "a*(d1+d2+d3+d4)+4*b + error", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(-3..3 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "correct1": {"definition": "if(t=0,'Probabilities sum to $1$', 'Probabilities do not sum to $1$')", "templateType": "anything", "group": "Ungrouped variables", "name": "correct1", "description": ""}, "flse2": {"definition": "if(u=0, 'There is a negative probability', 'All probabilities are non-negative')", "templateType": "anything", "group": "Ungrouped variables", "name": "flse2", "description": ""}, "flse1": {"definition": "if(t=0,'Probabilities do not sum to $1$', 'Probabilities sum to $1$')", "templateType": "anything", "group": "Ungrouped variables", "name": "flse1", "description": ""}, "correct": {"definition": "if(t=0 ,if(u=0, 'Yes, it is a probability mass function', 'No, it is not a probability mass function'), 'No, it is not a probability mass function')", "templateType": "anything", "group": "Ungrouped variables", "name": "correct", "description": ""}, "flse": {"definition": " if(t=0 ,if(u=0,'No, it is not a probability mass function','Yes, it is a probability mass function'), 'Yes, it is a probability mass function')", "templateType": "anything", "group": "Ungrouped variables", "name": "flse", "description": ""}, "u": {"definition": "random(0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "u", "description": ""}, "t": {"definition": "random(0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "error": {"definition": "t*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "error", "description": ""}, "correct2": {"definition": "if(u=0, 'All probabilities are non-negative', 'There is a negative probability')", "templateType": "anything", "group": "Ungrouped variables", "name": "correct2", "description": ""}, "d4": {"definition": "d3+random(3..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "d4", "description": ""}, "d2": {"definition": "d1+random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "d2", "description": ""}, "d3": {"definition": "d2+random(2..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "d3", "description": ""}, "d1": {"definition": "u*negerror+(1-u)*random(3..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "d1", "description": ""}}, "metadata": {"notes": "\n \t\t7/07/2012:
\n \t\tAdded tags.
\n \t\tChecked answers.
\n \t\t22/07/2012:
\n \t\tAdded description.
\n \t\tTicked stats extension box.
\n \t\tIssue with the multiple response question.The feedback on choosing only one correct answer out of the two says that both marks are awarded. This needs to be modified to the correct number of marks awarded and also in practice mode should give the information that there are other correct responses.
\n \t\tAnother linked issue is that there should be an option for forcing a number of choices for multiple response.
\n \t\t31/07/2012:
\n \t\tAdded tags.
\n \t\t20/12/2012:
\n \t\tThe above issue on multiple response has been resolved. Changed the MR so that lose 2 marks if choose an incorrect response (min mark 0).
\n \t\tCorrected error in setting up negative values for function, but still claiming that it was a PMF.
\n \t\tChecked calculation, OK. Added tested1 tag.
\n \t\t", "description": "\n \t\t \t\tDetermine if the following describes a probability mass function.
\n \t\t \t\t$P(X=x) = \\frac{ax+b}{c},\\;\\;x \\in S=\\{n_1,\\;n_2,\\;n_3,\\;n_4\\}\\subset \\mathbb{R}$.
\n \t\t \n \t\t", "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/"}]}