// Numbas version: finer_feedback_settings {"name": "Is the given function a probability mass function?, , , ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["is_pmf", "has_negative_probability", "probabilities_dont_sum", "explain_decision"], "name": "Descriptions"}], "variables": {"d3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d2+random(2..4)", "description": "", "name": "d3"}, "negerror": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(-b/a)-random(1,2)", "description": "", "name": "negerror"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(-3..3 except 0)", "description": "", "name": "b"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "a*(d1+d2+d3+d4)+4*b + error", "description": "", "name": "c"}, "d1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "has_negative_probability*negerror+(1-has_negative_probability)*random(3..5)", "description": "", "name": "d1"}, "explain_decision": {"templateType": "anything", "group": "Descriptions", "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)", "description": "", "name": "explain_decision"}, "d2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d1+random(1..5)", "description": "", "name": "d2"}, "has_negative_probability": {"templateType": "anything", "group": "Descriptions", "definition": "random(0,1)", "description": "", "name": "has_negative_probability"}, "is_pmf": {"templateType": "anything", "group": "Descriptions", "definition": "has_negative_probability=0 and probabilities_dont_sum=0", "description": "", "name": "is_pmf"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "a"}, "probabilities_dont_sum": {"templateType": "anything", "group": "Descriptions", "definition": "random(0,1)", "description": "

0 if probabilities sum to 1

", "name": "probabilities_dont_sum"}, "error": {"templateType": "anything", "group": "Ungrouped variables", "definition": "probabilities_dont_sum*random(1..9)", "description": "", "name": "error"}, "d4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "d3+random(3..5)", "description": "", "name": "d4"}}, "ungrouped_variables": ["a", "negerror", "c", "b", "error", "d3", "d4", "d2", "d1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Is the given function a probability mass function?, , , ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"displayType": "radiogroup", "choices": ["

Yes, it is a probability mass function

", "

No, it is not a probability mass function

"], "displayColumns": 2, "distractors": ["", ""], "shuffleChoices": false, "scripts": {}, "minMarks": 0, "type": "1_n_2", "maxMarks": 0, "showCorrectAnswer": true, "matrix": "if(is_pmf,[1,0],[0,1])", "marks": 0}], "type": "gapfill", "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]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"displayType": "checkbox", "choices": ["

Probabilities sum to $1$

", "

Probabilities do not sum to $1$

", "

All probabilities are non-negative

", "

There is a negative probability

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

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Determine whether the following defines a valid probability mass function.

\n

Also choose the options which describe the function.

", "tags": ["checked2015", "discrete distribution", "MAS1604", "MAS2304", "MAS8380", "MAS8401", "mass function", "pmf", "PMF", "Probability", "probability", "probability mass function", "statistics", "tested1"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus", "!simplifyFractions"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

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

\n

\n

7/07/2012:

\n

Added tags.

\n

Checked answers.

\n

22/07/2012:

\n

Added description.

\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

Added tags.

\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.

", "licence": "Creative Commons Attribution 4.0 International", "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}$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

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}.

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}