// Numbas version: finer_feedback_settings {"name": "Probability: Continuous Random Variable", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Probability: Continuous Random Variable", "tags": [], "metadata": {"description": "
Set up and solve an equation = 1, to ensure a function is a CRV
", "licence": "None specified"}, "statement": "A continuous random variable $\\var{X}$ is given by:
\n\\[ f_\\var{X}(\\var{little}) = \\begin{cases} \\begin{split} & \\var{coeff}k\\var{little}^\\var{power} \\quad &\\text{for} \\quad 0 \\le \\var{little} \\le 1 \\\\
&0 \\quad &\\text{otherwise} \\end{split} \\end{cases}\\]
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$. We also need to remember that an integral is a sum over a continuous range:
\n\\[ \\int_{-\\infty}^{\\infty} f_\\var{X}(\\var{little}) d\\var{little} = 1 \\]
\n\nSubstituting in our function and replacing the limits with $0$ and $1$, since we know the function is zero anywhere out of that range:
\n\n\\[ \\begin{split} \\int_{0}^{1} \\var{coeff}k \\var{little}^\\var{power} d\\var{little} &\\,= 1 \\\\ \\left[ \\frac{\\var{coeff}k \\var{little}^\\var{power+1}}{\\var{power+1}} \\right] _{ 0}^{ 1} &\\,= 1 \\\\ \\left( \\frac{\\var{coeff}k \\times 1^\\var{power+1}}{\\var{power+1}} \\right) - (0) &\\,= 1 \\\\ \\frac{\\var{coeff}k}{\\var{power+1}} &\\,= 1\\\\ k &\\,= \\var[fractionnumbers]{k} \\end{split} \\]
\nThe formula for Expectation is:
\n\\[ E(X) = \\int_{-\\infty}^{\\infty} x f(x) dx \\]
\nIf this looks like an odd formula, it can be helpful to think about how expectation is calculated in the discrete case.
Let's use the formula:
\\[ E(\\var{x}) = \\int_{0}^{1} \\var{little} \\times \\var[fractionnumbers]{k} \\times \\var{coeff} \\var{little}^\\var{power} d\\var{little} \\]
\n\\[= \\int_{0}^{1} \\var[fractionnumbers]{coeff*k} \\var{little}^\\var{power+1} d\\var{little} \\]
\n\\[ = \\left[ \\frac{\\var[fractionnumbers]{coeff*k} \\var{little}^\\var{power+2}}{\\var{power+2}} \\right] _{ 0}^{ 1} \\]
\n\\[ = \\var[fractionnumbers]{ex} \\]
\nThe formula for Variance is:
\n\\[Var(\\var{X}) = E(\\var{X}^2) - E(\\var{X})^2\\]
\nWe have already calculated $E(\\var{X})$, so let us calculate $E(\\var{X}^2)$ first.
\n\\[ E(\\var{x}^2) = \\int_{0}^{1} \\var{little}^2 \\times \\var[fractionnumbers]{k} \\times \\var{coeff} \\var{little}^\\var{power} d\\var{little} \\]
\n\\[= \\int_{0}^{1} \\var[fractionnumbers]{coeff*k} \\var{little}^\\var{power+2} d\\var{little} \\]
\n\\[ = \\left[ \\frac{\\var[fractionnumbers]{coeff*k} \\var{little}^\\var{power+3}}{\\var{power+3}} \\right] _{ 0}^{ 1} \\]
\n\\[ = \\var[fractionnumbers]{ex2} \\]
\nso therefore
\n\\[ Var(\\var{x}) = \\var[fractionnumbers]{ex2} - \\big(\\var[fractionnumbers]{(ex)} \\big) ^2 = \\var[fractionnumbers]{vx} \\]
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"X": {"name": "X", "group": "Ungrouped variables", "definition": "expression(random('X','Y'))", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "(power+1)/(coeff)", "description": "", "templateType": "anything", "can_override": false}, "little": {"name": "little", "group": "Ungrouped variables", "definition": "expression(random('u','v'))", "description": "", "templateType": "anything", "can_override": false}, "coeff": {"name": "coeff", "group": "Ungrouped variables", "definition": "random(2..10)", "description": "", "templateType": "anything", "can_override": false}, "power": {"name": "power", "group": "Ungrouped variables", "definition": "random(2..5)", "description": "", "templateType": "anything", "can_override": false}, "ex": {"name": "ex", "group": "Ungrouped variables", "definition": "coeff*k/(power+2)", "description": "", "templateType": "anything", "can_override": false}, "vx": {"name": "vx", "group": "Ungrouped variables", "definition": "coeff*k/(power+3) - (ex)^2", "description": "", "templateType": "anything", "can_override": false}, "ex2": {"name": "ex2", "group": "Ungrouped variables", "definition": "coeff*k/(power+3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["X", "k", "little", "coeff", "power", "ex", "vx", "ex2"], "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.
Give your answer as a fraction, or a decimal correct to 2dp.
Find the value of $E(\\var{x})$
Give your answer as a fraction, or a decimal correct to 2dp.
Calculate Var$(\\var{X})$
Give your answer as a fraction, or a decimal correct to 2dp.