// Numbas version: finer_feedback_settings {"name": "Construct PDF and find CDF, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"valk": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(2/(p*(xu+xl-2*a)),4)", "description": "", "name": "valk"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(xu-xl)", "description": "", "name": "p"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "a"}, "xu": {"templateType": "anything", "group": "Ungrouped variables", "definition": "xl+random(1..5)", "description": "", "name": "xu"}, "pval": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround((3*xl+xu-4*a)/(4*(xu+xl)-2*a),2)", "description": "", "name": "pval"}, "xl": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(1..4)", "description": "", "name": "xl"}}, "ungrouped_variables": ["a", "valk", "xl", "p", "pval", "xu"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Construct PDF and find CDF, ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"answer": "{2}/{p*(xu+xl)}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

input as a fraction and not a decimal.

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
$f_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$$kx$ $\\var{xl} \\leq x \\leq \\var{xu},$
$0,$$\\textrm{otherwise.}$
\n \n \n \n

What value of $k$ makes $f_X(x)$ into the pdf of a distribution?

\n \n \n \n

Input your answer here as a fraction and not as a decimal.

\n \n \n \n

$k=\\;\\;$[[0]]

\n \n ", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "0", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 0.5, "vsetrangepoints": 5}, {"answer": "(((x + ( - {xl})) * (x + {(xl + ( - (2 * a)))})) / {((xu + ( - xl)) * (xu + xl + ( - (2 * a))))})", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

input numbers as fractions or integers and not as decimals

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 2, "vsetrangepoints": 5}, {"answer": "1", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "showCorrectAnswer": true, "marks": 0.5, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "

Given the value of $k$ found in the first part, determine and input the distribution function $F_X(x)$

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
$F_X(x) = \\left \\{ \\begin{array}{l} \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\\\ \\phantom{{.}} \\end{array} \\right .$[[0]]$x \\lt \\var{xl},$
  
[[1]]$\\var{xl} \\leq x \\leq \\var{xu},$
  
[[2]]$x \\gt \\var{xu}.$
", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"answer": "{3*xl+xu-4*a}/{4*(xu+xl-2*a)}", "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showCorrectAnswer": true, "expectedvariablenames": [], "notallowed": {"message": "

input as a fraction or integer and not as a decimal

", "showStrings": false, "partialCredit": 0, "strings": ["."]}, "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "type": "jme", "answersimplification": "std", "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "prompt": "\n \n \n

Find 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 ", "showCorrectAnswer": true, "marks": 0}], "statement": "

A random variable $X$ has a probability density function (PDF) given by:

", "tags": ["CDF", "cdf", "checked2015", "continuous random variables", "cumulative distribution functions", "density function", "distribution function", "distribution functions", "integration", "MAS1604", "MAS2304", "PDF", "pdf", "Probability", "probability density function", "random variables", "statistics"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

8/07/2012:

\n

Added tags.

\n

Checked calculations, OK.

\n

23/07/2012:

\n

Added description.

\n

1/08/2012:

\n

Added tags.

\n

Question appears to be working correctly.

", "licence": "Creative Commons Attribution 4.0 International", "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)$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "\n \n \n

a)
Note that in order for $f_X(x)$ to be a pdf it must satisfy two important conditions:

\n \n \n \n

1. $f_X(x) \\ge 0$ in the range $\\var{xl} \\le x \\le \\var{xu}$

\n \n \n \n

2. 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.

\n \n \n \n

We first check condition 2. and then check that condition 1. is satisfied.

\n \n \n \n

Note that \\[\\int kx\\;dx = k\\frac{x^2}{2}\\] on forgetting the constant of integration.

\n \n \n \n

Hence \\[\\begin{eqnarray*}\n \n \\int_{\\var{xl}}^{\\var{xu}}kx\\;dx &=&\\frac{k}{2}(\\var{xu}^2-\\var{xl}^2)\\\\\n \n &=&\\frac{k}{2}\\times \\var{xu^2-xl^2}\n \n \\end{eqnarray*}\n \n \\]

\n \n \n \n

But 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}}\\]

\n \n \n \n

Hence the pdf is:
\\[f_X(x) = \\simplify[std]{2/{xu^2-xl^2}x}\\;\\;\\;\\;\\;\\var{xl} \\le x \\le \\var{xu}\\]

\n \n \n \n

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$.

\n \n \n \n

b)

\n \n \n \n

The Distribution Function

\n \n \n \n

If $F_X(x)$ is the distribution function of the distribution given by $f_X(x)$ then:

\n \n \n \n

$F_X(x) = 0\\;\\;\\;x \\lt \\var{xl},\\;\\;\\;\\;F_X(x)=1\\;\\;\\;x \\ge \\var{xu}$

\n \n \n \n

and for $\\var{xl} \\le x \\le \\var{xu}$:

\n \n \n \n

\\[\\begin{eqnarray*}\n \n F_X(x)&=&\\int_{-\\infty}^x f_X(x)\\;dx=\\simplify[std]{2/{xu^2-xl^2}}\\int_{\\var{xl}}^x x\\;dx\\\\\n \n &=&\\simplify[std]{2/{xu^2-xl^2}}\\times\\frac{\\left(x^2-\\var{xl}^2\\right)}{2}\\\\\n \n &=&\\frac{x^2-\\var{xl^2}}{\\var{xu^2-xl^2}}\n \n \\end{eqnarray*}\n \n \\]

\n \n \n \n

c)

\n \n \n \n

We have
\\[\\begin{eqnarray*}\n \n P\\left(X \\lt \\simplify[std]{{xl+xu}/2}\\right)&=&F_X\\left(\\simplify[std]{{(xl+xu)}/2}\\right)\\\\\n \n &=& \\frac{1}{\\var{xu^2-xl^2}}\\left(\\simplify[std]{({(xl+xu)}/{2})^2-{xl}^2}\\right)\\\\\n \n &=&\\simplify{{3*xl+xu-4*a}/{4*(xu+xl-2*a)}}\n \n \\end{eqnarray*}\n \n \\]

\n \n ", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}