// Numbas version: finer_feedback_settings {"name": "IS2.1", "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", "valk", "xl", "p", "pval", "xu"], "name": "IS2.1", "tags": ["CDF", "PDF", "Probability", "cdf", "continuous random variables", "cumulative distribution functions", "density function", "distribution function", "distribution functions", "integration", "pdf", "probability", "probability density function", "random variables", "statistics"], "preamble": {"css": "", "js": ""}, "advice": "
Note that in order for $f_X(x)$ to be a pdf it must satisfy two important conditions:
\n1. $f_X(x) \\ge 0$ in the range $\\var{xl} \\le x \\le \\var{xu}$
\n2. The area under the curve given by $f_X(x)$ is $1$ and this implies that:
\\[\\int_{\\var{xl}}^{\\var{xu}}f_X(x)\\;dx = 1\\] as the value of the function is $0$ outside this range.
We first check condition 2. and then check that condition 1. is satisfied.
\nNote that \\[\\int kx\\;dx = k\\frac{x^2}{2}\\] on forgetting the constant of integration.
\nHence \\[\\begin{eqnarray*} \\int_{\\var{xl}}^{\\var{xu}}kx\\;dx &=&\\frac{k}{2}(\\var{xu}^2-\\var{xl}^2)\\\\ &=&\\frac{k}{2}\\times \\var{xu^2-xl^2} \\end{eqnarray*} \\]
\nBut we must have this last value equal to $1$ hence:
\\[ \\frac{k}{2}\\times \\var{xu^2-xl^2}=1 \\Rightarrow k = \\simplify[std]{2/{xu^2-xl^2}}\\]
Hence the pdf is:
\\[f_X(x) = \\simplify[std]{2/{xu^2-xl^2}x}\\;\\;\\;\\;\\;\\var{xl} \\le x \\le \\var{xu}\\]
We have to check condition 1. that the function $f_X(x)$ is positive for $\\var{xl} \\le x \\le \\var{xu} $ – but this is clear from
the definition of $f_X(x)$ and the value of $k$.
If $F_X(x)$ is the distribution function of the distribution given by $f_X(x)$ then:
\n$F_X(x) = 0\\;\\;\\;x \\lt \\var{xl},\\;\\;\\;\\;F_X(x)=1\\;\\;\\;x \\ge \\var{xu}$
\nand for $\\var{xl} \\le x \\le \\var{xu}$:
\n\\[\\begin{eqnarray*} F_X(x)&=&\\int_{-\\infty}^x f_X(x)\\;dx=\\simplify[std]{2/{xu^2-xl^2}}\\int_{\\var{xl}}^x x\\;dx\\\\ &=&\\simplify[std]{2/{xu^2-xl^2}}\\times\\frac{\\left(x^2-\\var{xl}^2\\right)}{2}\\\\ &=&\\frac{x^2-\\var{xl^2}}{\\var{xu^2-xl^2}} \\end{eqnarray*} \\]
\nWe have
\\[\\begin{eqnarray*} P\\left(X \\lt \\simplify[std]{{xl+xu}/2}\\right)&=&F_X\\left(\\simplify[std]{{(xl+xu)}/2}\\right)\\\\ &=& \\frac{1}{\\var{xu^2-xl^2}}\\left(\\simplify[std]{({(xl+xu)}/{2})^2-{xl}^2}\\right)\\\\ &=&\\simplify{{3*xl+xu-4*a}/{4*(xu+xl-2*a)}} \\end{eqnarray*} \\]
$f_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$ | \n \n$kx$ | \n \n$\\var{xl} \\leq x \\leq \\var{xu},$ | \n \n
\n \n | \n \n | |
$0,$ | \n \n$\\textrm{otherwise.}$ | \n \n
What value of $k$ makes $f_X(x)$ into the pdf of a distribution?
\n \n \n \nInput your answer here as a fraction and not as a decimal.
\n \n \n \n$k=\\;\\;$[[0]]
\n \n \n ", "marks": 0, "gaps": [{"notallowed": {"message": "input as a fraction and not a decimal.
", "showStrings": false, "strings": ["."], "partialCredit": 0}, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "{2}/{p*(xu+xl)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\nGiven the value of $k$ found in the first part, determine and input the distribution function $F_X(x)$
\n$F_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$ | \n[[0]] | \n$x \\lt \\var{xl},$ | \n
\n | \n | |
[[1]] | \n$\\var{xl} \\leq x \\leq \\var{xu},$ | \n|
\n | \n | |
[[2]] | \n$x \\gt \\var{xu}.$ | \n
input numbers as fractions or integers and not as decimals
", "showStrings": false, "strings": ["."], "partialCredit": 0}, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "(((x + ( - {xl})) * (x + {(xl + ( - (2 * a)))})) / {((xu + ( - xl)) * (xu + xl + ( - (2 * a))))})", "marks": 2, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "answer": "1", "marks": 0.5, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\n \n \nFind and input as a fraction not a decimal:
\n \n \n \n$P\\left(X \\lt \\simplify[std]{{xl+xu}/2}\\right) = \\phantom{{}}$[[0]]
\n \n \n ", "marks": 0, "gaps": [{"notallowed": {"message": "input as a fraction or integer and not as a decimal
", "showStrings": false, "strings": ["."], "partialCredit": 0}, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "{3*xl+xu-4*a}/{4*(xu+xl-2*a)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "A random variable $X$ has a probability density function (PDF) given by:
", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "0", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "valk": {"definition": "precround(2/(p*(xu+xl-2*a)),4)", "templateType": "anything", "group": "Ungrouped variables", "name": "valk", "description": ""}, "xl": {"definition": "random(1..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "xl", "description": ""}, "p": {"definition": "(xu-xl)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "pval": {"definition": "precround((3*xl+xu-4*a)/(4*(xu+xl)-2*a),2)", "templateType": "anything", "group": "Ungrouped variables", "name": "pval", "description": ""}, "xu": {"definition": "xl+random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "xu", "description": ""}}, "metadata": {"notes": "\n \t\t8/07/2012:
\n \t\tAdded tags.
\n \t\tChecked calculations, OK.
\n \t\t23/07/2012:
\n \t\tAdded description.
\n \t\t1/08/2012:
\n \t\tAdded tags.
\n \t\tQuestion appears to be working correctly.
\n \t\t", "description": "The random variable $X$ has a PDF which involves a parameter $k$. Find the value of $k$. Find the distribution function $F_X(x)$ and $P(X \\lt a)$.
", "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/"}]}