// Numbas version: exam_results_page_options {"name": "IS2.3", "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", "f1", "c", "b", "d", "f", "tol1", "m", "pd1", "n", "pc", "s", "r", "u", "t", "pd", "tol", "n1", "s1", "gc"], "name": "IS2.3", "tags": ["PDF", "Probability", "conditional probability", "cr1", "density function", "diagram", "integration", "pdf", "probabilities", "probability", "probability density function", "query", "statistics", "tested1"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

We have:

\n

\\[\\begin{eqnarray*} P(X \\gt \\var{c})&=&\\int_{\\var{c}}^{\\var{b}}f(x)\\;dx\\\\ &=&\\frac{1}{\\var{n1}}\\int_{\\var{c}}^{\\var{b}}\\simplify[std]{({f1}-{s1}x)}\\;dx\\\\ &=&\\frac{1}{\\var{n1}}\\left(\\simplify[std,!otherNumbers]{{f1}({b}-{c})-{s1}({b}^2-{c}^2)/2}\\right)\\\\ &=&\\simplify[std]{{2*f1 * (b -c) + s1 * (c ^ 2 -(b ^ 2))} / {2*n1} }\\\\ &=& \\var{pc} \\end{eqnarray*} \\] to 4 decimal places.

\n

b)

\n

\\[\\begin{eqnarray*} P(X \\gt \\var{d} | X \\gt \\var{c})&=&\\frac{P(X \\gt \\var{d}\\;\\;\\textrm{and}\\;\\; X \\gt \\var{c})}{P(X \\gt \\var{c})}\\\\ &=&\\frac{P(X \\gt \\var{d})}{P(X \\gt \\var{c})} \\end{eqnarray*} \\] as $\\var{d} \\gt \\var{c}$.

\n

But,
\\[\\begin{eqnarray*} P(X \\gt \\var{d})&=&\\int_{\\var{d}}^{\\var{b}}f(x)\\;dx\\\\ &=&\\frac{1}{\\var{n1}}\\int_{\\var{d}}^{\\var{b}}\\simplify[std]{({f1}-{s1}x)}\\;dx\\\\ &=&\\frac{1}{\\var{n1}}\\left(\\simplify[std,!otherNumbers]{{f1}({b}-{d})-{s1}({b}^2-{d}^2)/2}\\right)\\\\ &=&\\simplify[std]{{2*f1 * (b -d) + s1 * (d ^ 2 -(b ^ 2))} / {2*n1} }\\\\ &=& \\var{pd1} \\end{eqnarray*} \\] to 4 decimal places.

\n

Hence \\[\\begin{eqnarray*} P(X \\gt \\var{d} | X \\gt \\var{c})&=&\\frac{P(X \\gt \\var{d})}{P(X \\gt \\var{c})}\\\\ &=&\\frac{\\var{pd1}}{\\var{pc}}\\\\ &=&\\var{pd} \\end{eqnarray*} \\] to 2 decimal places.

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n \n \n

$P(X \\gt \\var{c})=\\;\\;$[[0]]

\n \n \n \n

Input to 4 decimal places.

\n \n \n ", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "{pc+tol}", "minValue": "{pc-tol}", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\n

$P(X \\gt \\var{d} | X \\gt \\var{c})=\\;\\;$[[0]]

\n

Input to 2 decimal places.

\n ", "marks": 0, "gaps": [{"allowFractions": false, "marks": 1, "maxValue": "{pd+tol1}", "minValue": "{pd-tol1}", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n

Given the pdf

\n

\\[\\begin{eqnarray*} f(x)&=&\\simplify[std]{({f1}-{s1}x)/{n1}}\\;\\;\\var{a} \\leq x \\leq \\var{b}\\\\ f(x)&=&0\\;\\;\\;\\textrm{otherwise} \\end{eqnarray*} \\]
find the following probabilities:

\n ", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(0..2)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "f1": {"definition": "f/gc", "templateType": "anything", "group": "Ungrouped variables", "name": "f1", "description": ""}, "c": {"definition": "a+round((t*1+(100-t)*((r-1)))/100)/2", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "a+r", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "a+round((u*2*(r-1)+(100-u)*((r+1)))/100)/2", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "f": {"definition": "b * (2 * n -m) -(a * m)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "tol1": {"definition": "0", "templateType": "anything", "group": "Ungrouped variables", "name": "tol1", "description": ""}, "m": {"definition": "random(1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "pd1": {"definition": "precround((n*r^2+s*(d^2-a^2)-f*(d-a))/(n*r^2),4)", "templateType": "anything", "group": "Ungrouped variables", "name": "pd1", "description": ""}, "n": {"definition": "m+s", "templateType": "anything", "group": "Ungrouped variables", "name": "n", "description": ""}, "pc": {"definition": "precround((n*r^2+s*(c^2-a^2)-f*(c-a))/(n*r^2),4)", "templateType": "anything", "group": "Ungrouped variables", "name": "pc", "description": ""}, "s": {"definition": "random(1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "r": {"definition": "random(4,5)", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}, "u": {"definition": "random(0..100)", "templateType": "anything", "group": "Ungrouped variables", "name": "u", "description": ""}, "t": {"definition": "random(0..100)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "pd": {"definition": "precround((n*r^2+s*(d^2-a^2)-f*(d-a))/(n*r^2)/pc,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "pd", "description": ""}, "tol": {"definition": "0", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "n1": {"definition": "n*r^2/gc", "templateType": "anything", "group": "Ungrouped variables", "name": "n1", "description": ""}, "s1": {"definition": "2*s/gc", "templateType": "anything", "group": "Ungrouped variables", "name": "s1", "description": ""}, "gc": {"definition": "gcd(n*r^2,gcd(f,2*s))", "templateType": "anything", "group": "Ungrouped variables", "name": "gc", "description": ""}}, "metadata": {"notes": "\n \t\t

8/07/2012:

\n \t\t

Added tags.

\n \t\t

Set new tolerance variables, tol=0 for first question and tol1=0 for second question. Aslo included statement that second question is to be entered to 2 dps.

\n \t\t

There is an image to be included in the Advice. This needs to be done.

\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

Question appears to be working correctly.

\n \t\t

21/12/2012:

\n \t\t

Checked calculation. Added tag tested1.

\n \t\t

Added query and diagram tags re possible inclusion of a diagram - which could be dynamic?

\n \t\t

Checked rounding, OK. Added tag cr1.

\n \t\t", "description": "

Given the pdf  $f(x)=\\frac{a-bx}{c},\\;r \\leq x \\leq s,\\;f(x)=0$ else, find $P(X \\gt p)$, $P(X \\gt q | X \\gt t)$.

", "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/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}