// Numbas version: finer_feedback_settings
{"name": "Use piecewise CDF to find probabilities at given points, and the expectation.", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"x2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "x1+random(0.1..0.3#0.05)", "name": "x2", "description": ""}, "message": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(c4=c1 or c4=c2 or c4=c3,\"Note that we could have read this result directly from the information given above for \", \" \")", "name": "message", "description": ""}, "c5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c2+random(1..4)", "name": "c5", "description": ""}, "c4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "round(((100-t)/100+t/100*(c3-1)))", "name": "c4", "description": ""}, "mess": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(c4=c1 or c4=c2 or c4=c3,'$F_X(b)$','$\\\\;$')", "name": "mess", "description": ""}, "t": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0..100)", "name": "t", "description": ""}, "x3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "x2+random(0.2..0.35#0.05)", "name": "x3", "description": ""}, "c1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "name": "c1", "description": ""}, "c2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "c1+random(1..3)", "name": "c2", "description": ""}, "v4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(c4
$P(X=0)=\\;\\;$[[0]] $P(X=\\var{c1})=\\;\\;$[[1]]
\n$P(X=\\var{c2})=\\;\\;$[[2]] $P(X=\\var{c3})=\\;\\;$[[3]]
", "unitTests": [], "sortAnswers": false, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "x1", "maxValue": "x1", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "x2-x1", "maxValue": "x2-x1", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "x3-x2", "maxValue": "x3-x2", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}, {"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "1-x3", "maxValue": "1-x3", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 0.5, "showFeedbackIcon": true}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}, {"showCorrectAnswer": true, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "Calculate:
\n$\\displaystyle F_X(\\var{c4})=P(X \\le \\var{c4})=\\;\\;$[[0]] (exact decimal)
", "unitTests": [], "sortAnswers": false, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "val", "maxValue": "val", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}, {"showCorrectAnswer": true, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "prompt": "Compute $\\operatorname{E}[X]=\\;\\;$[[0]]
", "unitTests": [], "sortAnswers": false, "scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "customMarkingAlgorithm": "", "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "minValue": "ex", "maxValue": "ex", "unitTests": [], "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "correctAnswerFraction": false, "variableReplacements": [], "marks": 1, "showFeedbackIcon": true}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0, "showFeedbackIcon": true}], "statement": "Suppose that the cumulative distribution function (CDF) of the random variable $X$ is given by
\n$F_X(b) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}}\\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\end{array} \\right .$ | \n0, | \n$b \\lt 0,$ | \n
\n | \n | |
$\\var{x1}$ | \n$0 \\le b \\lt \\var{c1},$ | \n|
\n | \n | |
$\\var{x2}$ | \n$\\var{c1} \\le b \\lt\\var{c2},$ | \n|
\n | \n | |
$\\var{x3}$ | \n$ \\var{c2} \\le b \\lt \\var{c3},$ | \n|
\n | \n | |
1, | \n$b \\ge \\var{c3}.$ | \n
Answer the following questions:
", "tags": ["CDF", "cdf", "checked2015", "continuous random variable", "cumulative distribution function", "diagram needed", "discontinuous cdf", "distribution", "distribution on the real line", "expectation", "Probability", "probability", "query", "random variable", "statistics"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Given a piecewise CDF $F_X(b)$ which is discontinuous at several points, find the probabilities at those points and also find the value of $F_X(b)$ at a continuous point and the expectation.
\nThis cdf is a step function and is therefore the cdf of a discrete random variable. This should be stated somewhere in the statement or the solution. Apart from this the question is correct.
"}, "extensions": [], "advice": "a)
\nFrom lectures we know that jumps in the CDF imply a non zero probability at that point.
\nThus:
\n$P(X=0)=\\var{x1}$,
\n$P(X=\\var{c1})=\\var{x2}-\\var{x1}=\\var{x2-x1}$,
\n$P(X=\\var{c2})=\\var{x3}-\\var{x2}=\\var{x3-x2}$,
\n$P(X=\\var{c3})=1-\\var{x3}=\\var{1-x3}$
\nb)
\n\\[\\begin{eqnarray*} F_X(\\var{c4}) =P(X \\le \\var{c4}) &=&\\simplify[all]{ P(X = 0) + {v2} * P(X = {c1}) + {v3} * P(X = {c2}) + {v4} * P(X = {c3})}\\\\&=& \\simplify[zerofactor,zeroterm,unitfactor]{{x1} + {v2} *({x2-x1}) + {v3} *({x3 -x2}) + {v4} * ({1 -x3}) }\\\\&=& \\var{val}\\end{eqnarray*}\\]
\n{message}{mess}.
\nc)
\n$\\displaystyle \\operatorname{E}[X]=\\sum x P(X=x)=0\\times \\var{x1}+\\var{c1}\\times \\var{x2-x1}+\\var{c2}\\times \\var{x3-x2}+\\var{c3}\\times \\var{1-x3}=\\var{ex}$
\n\n
\n
", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}