// Numbas version: exam_results_page_options {"name": "Probability: Discrete Random Variable 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Probability: Discrete Random Variable 2", "tags": [], "metadata": {"description": "

Given a discrete random variable (as a formula) calculate:
E(X), Var, std dev, cumulative distribution and probabilties.

", "licence": "None specified"}, "statement": "

The probability distribution of a discrete random variable $\\var{X}$ is given by:

\n

$P(\\var{X} = r) = k(r+\\var{m})(r+\\var{n})$ for $1 \\le r \\le 3$

\n

$P(\\var{X} = r) = 0)$ otherwise.

", "advice": "

a) A probability distribution is a function that defines the probability of each possible outcome.  Since the sum of probabilities of all outcomes must be 1, we can use this fact to calculate $k$.

\n

$P(\\var{X} = 1) = k(1+\\var{m})(1+\\var{n}) = \\var{(1+m)*(1+n)}k$

\n

$P(\\var{X} = 2) = k(2+\\var{m})(2+\\var{n})=\\var{(2+m)*(2+n)}k$

\n

$P(\\var{X} = 3) = k(3+\\var{m})(3+\\var{n})=\\var{(3+m)*(3+n)}k$

\n

with the probability of any other value of $\\var{X}$ being $0$.

Therefore $P(\\var{X} = 1) + P(\\var{X} =2) + P(\\var{X}=3) = 1$

\n

$\\implies \\var{(1+m)*(1+n)}k + \\var{(2+m)*(2+n)}k + \\var{(3+m)*(3+n)}k = 1$

\n

Which we can solve to show that $k=\\frac{1}{\\var{(1+m)*(1+n)+(2+m)*(2+n)+(3+n)*(3+m)}}$

\n

b) To find $P(\\var{l} \\le \\var{X} \\le \\var{u})$ we can calculate the probability of each value in the range and sum

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"X": {"name": "X", "group": "Ungrouped variables", "definition": "random('X','Y','A','F','M')", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(1..5)", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "1/(sum)", "description": "", "templateType": "anything", "can_override": false}, "l": {"name": "l", "group": "Ungrouped variables", "definition": "random(-4..1)", "description": "", "templateType": "anything", "can_override": false}, "u": {"name": "u", "group": "Ungrouped variables", "definition": "random(1..6 except l)", "description": "", "templateType": "anything", "can_override": false}, "prob": {"name": "prob", "group": "Ungrouped variables", "definition": "if(u=1,p1,if(u=2,p1+p2,if(u>=3,p1+p2+p3)))", "description": "", "templateType": "anything", "can_override": false}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "k*(m+1)(n+1)", "description": "", "templateType": "anything", "can_override": false}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "k*((n+2)(m+2))", "description": "", "templateType": "anything", "can_override": false}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "k*(m+3)(m+2)\n", "description": "", "templateType": "anything", "can_override": false}, "sum": {"name": "sum", "group": "Ungrouped variables", "definition": "(m+1)(n+1)+(m+2)(n+2)+(m+3)(n+3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["X", "m", "n", "k", "l", "u", "prob", "p1", "p2", "p3", "sum"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What value of $k$ makes this a probability distribution function.

", "minValue": "k", "maxValue": "k", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the value of $P(\\var{l} \\le \\var{X} \\le \\var{u})$

", "minValue": "prob", "maxValue": "prob", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}]}], "contributors": [{"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}