// 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:

\n

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

\n

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

\n

In this case:

\n

{correct} as

\n

1. {correct1}

\n

2. {correct2}

\n

To 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}}\\]

\n

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]]

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

", "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 \n

Determine whether the following defines a valid probability mass function.

\n \n \n \n

Also 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\t

7/07/2012:

\n \t\t

Added tags.

\n \t\t

Checked answers.

\n \t\t

22/07/2012:

\n \t\t

Added description.

\n \t\t

Ticked stats extension box.

\n \t\t

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

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

\n \t\t

31/07/2012:

\n \t\t

Added tags.

\n \t\t

20/12/2012:

\n \t\t

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

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

\n \t\t

Checked calculation, OK. Added tested1 tag.

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

Determine 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/"}]}