// 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": "

a)

\n

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

\n

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

\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

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

\n

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

\n

Hence \\[\\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*} \\]

\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

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

\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

b)

\n

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

\n

and 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*} \\]

\n

c)

\n

We 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*} \\]

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"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 \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": "\n

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}.$
\n ", "marks": 0, "gaps": [{"expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "answer": "0", "marks": 0.5, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"notallowed": {"message": "

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 \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 \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\t

8/07/2012:

\n \t\t

Added tags.

\n \t\t

Checked calculations, OK.

\n \t\t

23/07/2012:

\n \t\t

Added description.

\n \t\t

1/08/2012:

\n \t\t

Added tags.

\n \t\t

Question 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/"}]}