// Numbas version: finer_feedback_settings {"name": "PA2 - Continuous Random Variables", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "PA2 - Continuous Random Variables", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "
Let $Y$ be a continuous random variable. Its probability density is $p(Y)$.
", "advice": "a) A probabilty density function must satisfy the following properties:
\nb) Calculating the integral we find,
\n$\\int_{a}^b \\frac{1}{b-a} dx = \\left[ \\frac{x}{b-a} \\right]_a^b = \\frac{b}{b-a} - \\frac{a}{b-a} = \\frac{b-a}{b-a} = 1.$
\nIn part a) we see that one of the properties of a probability density function is that $\\int_{a}^b \\frac{1}{b-a} dx = 1$. Hence, calculating $\\int_{a}^b f_X(x) dx = 1$ means that all of the probability mass lies in the interval $[a,b]$.
\nc) Expected value, $E[X]$ is calculated using the following formula, $E[X] = \\int_{-\\infty}^\\infty xf_X(x) dx.$
\nHence,
\n$E[X] = \\int_a^b \\frac{x}{b-a} dx = \\left[ \\frac{x^2}{2(b-a)} \\right]_a^b = \\frac{b^2-a^2}{2(b-a)}.$
\nAt this point we can use the sum of squares formula, $b^2-a^2 = (b+a)(b-a)$, to simplify the expression. So,
\n$E[X] = \\frac{(b+a)(b-a)}{2(b-a)} = \\frac{b+a}{2}$.
\nUse this link to find some resources which will help you revise this topic.
\n", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": true, "customName": "a)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What properties must $p(Y)$ satisfy to be a probability density function?
", "minMarks": 0, "maxMarks": "2", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "markingMethod": "score per matched cell", "choices": ["$\\int_{-\\infty}^\\infty p(Y) dY= 1$", "$\\int_{-\\infty}^\\infty p(Y) dY = \\infty$", "$p(Y)\\ge 0, \\forall y\\in\\mathbb{R}$", "$p(Y)\\ge 1, \\forall y\\in\\mathbb{R}$"], "matrix": ["1", 0, "1", 0], "distractors": ["", "", "", ""]}, {"type": "gapfill", "useCustomName": true, "customName": "b)", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "A uniform continuous random variable, $X$ (non-zero between $a$ and $b$) is defined to have a probability density function of
\n$f_X(x) = \\begin{cases} \\frac{1}{b - a} & a \\le x \\le b, \\\\ 0 & \\text{otherwise} \\end{cases}$
\nFind the probability mass that lies in the interval $[a,b]$ by calculating $\\int_{a}^b \\frac{1}{b-a} dx=$ [[0]].
", "gaps": [{"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, "minValue": "1", "maxValue": "1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "jme", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What is the expected value of $X$ in terms of $a$ and $b$?
", "answer": "(b+a)/2", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "a", "value": ""}, {"name": "b", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "resources": []}]}], "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}]}