// Numbas version: exam_results_page_options {"name": "Alex's copy of Is the given function a probability mass function?, , , ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Determine whether the following defines a valid probability mass function.

\n

Also choose the options which describe the function.

A probability mass function $f(x)=P(X=x)$ has to satisfy:

\n

1. $f(x) \\ge 0$, $\\forall x \\in S$

\n

2. $\\sum_{x \\in S} f(x) = 1$

\n

To verify this we calculate the function as follows:

\n

\\begin{align}
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{align}

\n

and

\n

\$\\sum_{x \\in S} f(x) =\\simplify[std]{ {a*d1+b}/{c} + {a*d2+b}/{c} + {a*d3+b}/{c} + {a*d4+b}/{c}} = \\simplify[fractionNumbers]{{c-error}/{c}} = \\simplify[std,simplifyFractions]{{c-error}/{c}} \$

\n

In this case, {if(is_pmf,\"this is a probability mass function\",\"this is not a probability mass function\")} as {explain_decision}.

", "question_groups": [{"pickQuestions": 0, "pickingStrategy": "all-ordered", "questions": [], "name": ""}], "variables": {"has_negative_probability": {"group": "Descriptions", "templateType": "anything", "description": "", "definition": "random(0,1)", "name": "has_negative_probability"}, "d4": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "d3+random(3..5)", "name": "d4"}, "negerror": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "round(-b/a)-random(1,2)", "name": "negerror"}, "is_pmf": {"group": "Descriptions", "templateType": "anything", "description": "", "definition": "has_negative_probability=0 and probabilities_dont_sum=0", "name": "is_pmf"}, "b": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-3..3 except 0)", "name": "b"}, "d2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "d1+random(1..5)", "name": "d2"}, "probabilities_dont_sum": {"group": "Descriptions", "templateType": "anything", "description": "

0 if probabilities sum to 1

", "definition": "random(0,1)", "name": "probabilities_dont_sum"}, "c": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "a*(d1+d2+d3+d4)+4*b + error", "name": "c"}, "d3": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "d2+random(2..4)", "name": "d3"}, "explain_decision": {"group": "Descriptions", "templateType": "anything", "description": "", "definition": "if(has_negative_probability,\n if(probabilities_dont_sum,\n \"the probabilities do not sum to $1$ and there is a negative probability\",\n \"there is a negative probability\"\n ),\n if(probabilities_dont_sum,\n \"the probabilities do not sum to $1$\",\n \"the probabilities sum to $1$ and all probabilities are non-negative\"\n )\n)", "name": "explain_decision"}, "a": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..4)", "name": "a"}, "error": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "probabilities_dont_sum*random(1..9)", "name": "error"}, "d1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "has_negative_probability*negerror+(1-has_negative_probability)*random(3..5)", "name": "d1"}}, "name": "Alex's copy of Is the given function a probability mass function?, , , ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus", "!simplifyFractions"]}, "type": "question", "variable_groups": [{"variables": ["is_pmf", "has_negative_probability", "probabilities_dont_sum", "explain_decision"], "name": "Descriptions"}], "parts": [{"marks": 0, "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"marks": 0, "maxMarks": 0, "distractors": ["", ""], "showCorrectAnswer": true, "scripts": {}, "displayType": "radiogroup", "minMarks": 0, "matrix": "if(is_pmf,[1,0],[0,1])", "type": "1_n_2", "choices": ["

Yes, it is a probability mass function

", "

No, it is not a probability mass function

"], "shuffleChoices": false, "displayColumns": 2}], "scripts": {}, "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, "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"marks": 0, "maxMarks": "2", "distractors": ["", "", "", ""], "showCorrectAnswer": true, "displayType": "checkbox", "scripts": {}, "minMarks": 0, "matrix": "if(probabilities_dont_sum=0,[1,-2],[-2,1])+if(has_negative_probability=0,[1,-2],[-2,1])", "type": "m_n_2", "maxAnswers": 2, "choices": ["

Probabilities sum to $1$

", "

Probabilities do not sum to $1$

", "

All probabilities are non-negative

", "

There is a negative probability

"], "shuffleChoices": false, "displayColumns": 1, "warningType": "none", "minAnswers": 0}], "scripts": {}, "prompt": "

Tick all boxes which describe this function:

\n

[[0]]

\n

Note that if you choose an incorrect option then you will lose 2 marks.

\n

The minimum number of marks you can obtain is 0.

"}], "tags": ["checked2015", "discrete distribution", "MAS1604", "MAS2304", "MAS8380", "MAS8401", "mass function", "pmf", "PMF", "Probability", "probability", "probability mass function", "statistics", "tested1"], "preamble": {"js": "", "css": ""}, "ungrouped_variables": ["a", "negerror", "c", "b", "error", "d3", "d4", "d2", "d1"], "functions": {}, "showQuestionGroupNames": false, "metadata": {"description": "

Determine if the following describes a probability mass function.

\n

$P(X=x) = \\frac{ax+b}{c},\\;\\;x \\in S=\\{n_1,\\;n_2,\\;n_3,\\;n_4\\}\\subset \\mathbb{R}$.

", "licence": "Creative Commons Attribution 4.0 International", "notes": "

25/02/2015: see the editing history for changes from now on.

\n

\n

7/07/2012:

\n

\n

\n

22/07/2012:

\n

\n

Ticked stats extension box.

\n

Issue 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

Another linked issue is that there should be an option for forcing a number of choices for multiple response.

\n

31/07/2012:

\n

\n

20/12/2012:

\n

The 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

Corrected error in setting up negative values for function, but still claiming that it was a PMF.

\n

Checked calculation, OK. Added tested1 tag.

"}, "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}]}], "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}