// Numbas version: exam_results_page_options {"name": "Alex's copy of IS2.3", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "tags": ["PDF", "Probability", "conditional probability", "cr1", "density function", "diagram", "integration", "pdf", "probabilities", "probability", "probability density function", "query", "statistics", "tested1"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variablesTest": {"condition": "", "maxRuns": 100}, "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 ", "name": "Alex's copy of IS2.3", "preamble": {"css": "", "js": ""}, "parts": [{"gaps": [{"correctAnswerFraction": false, "minValue": "{pc-tol}", "marks": 1, "showCorrectAnswer": true, "type": "numberentry", "maxValue": "{pc+tol}", "scripts": {}, "showPrecisionHint": false, "allowFractions": false}], "showCorrectAnswer": true, "type": "gapfill", "scripts": {}, "marks": 0, "prompt": "\n \n \n

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

\n \n \n \n

Input to 4 decimal places.

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

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

\n

Input to 2 decimal places.

\n "}], "functions": {}, "variables": {"n": {"templateType": "anything", "description": "", "definition": "m+s", "group": "Ungrouped variables", "name": "n"}, "c": {"templateType": "anything", "description": "", "definition": "a+round((t*1+(100-t)*((r-1)))/100)/2", "group": "Ungrouped variables", "name": "c"}, "f": {"templateType": "anything", "description": "", "definition": "b * (2 * n -m) -(a * m)", "group": "Ungrouped variables", "name": "f"}, "pd": {"templateType": "anything", "description": "", "definition": "precround((n*r^2+s*(d^2-a^2)-f*(d-a))/(n*r^2)/pc,2)", "group": "Ungrouped variables", "name": "pd"}, "gc": {"templateType": "anything", "description": "", "definition": "gcd(n*r^2,gcd(f,2*s))", "group": "Ungrouped variables", "name": "gc"}, "pd1": {"templateType": "anything", "description": "", "definition": "precround((n*r^2+s*(d^2-a^2)-f*(d-a))/(n*r^2),4)", "group": "Ungrouped variables", "name": "pd1"}, "tol1": {"templateType": "anything", "description": "", "definition": "0", "group": "Ungrouped variables", "name": "tol1"}, "s": {"templateType": "anything", "description": "", "definition": "random(1,2)", "group": "Ungrouped variables", "name": "s"}, "m": {"templateType": "anything", "description": "", "definition": "random(1,2)", "group": "Ungrouped variables", "name": "m"}, "b": {"templateType": "anything", "description": "", "definition": "a+r", "group": "Ungrouped variables", "name": "b"}, "u": {"templateType": "anything", "description": "", "definition": "random(0..100)", "group": "Ungrouped variables", "name": "u"}, "pc": {"templateType": "anything", "description": "", "definition": "precround((n*r^2+s*(c^2-a^2)-f*(c-a))/(n*r^2),4)", "group": "Ungrouped variables", "name": "pc"}, "n1": {"templateType": "anything", "description": "", "definition": "n*r^2/gc", "group": "Ungrouped variables", "name": "n1"}, "d": {"templateType": "anything", "description": "", "definition": "a+round((u*2*(r-1)+(100-u)*((r+1)))/100)/2", "group": "Ungrouped variables", "name": "d"}, "a": {"templateType": "anything", "description": "", "definition": "random(0..2)", "group": "Ungrouped variables", "name": "a"}, "t": {"templateType": "anything", "description": "", "definition": "random(0..100)", "group": "Ungrouped variables", "name": "t"}, "s1": {"templateType": "anything", "description": "", "definition": "2*s/gc", "group": "Ungrouped variables", "name": "s1"}, "r": {"templateType": "anything", "description": "", "definition": "random(4,5)", "group": "Ungrouped variables", "name": "r"}, "tol": {"templateType": "anything", "description": "", "definition": "0", "group": "Ungrouped variables", "name": "tol"}, "f1": {"templateType": "anything", "description": "", "definition": "f/gc", "group": "Ungrouped variables", "name": "f1"}}, "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"}, "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.

", "type": "question", "ungrouped_variables": ["a", "f1", "c", "b", "d", "f", "tol1", "m", "pd1", "n", "pc", "s", "r", "u", "t", "pd", "tol", "n1", "s1", "gc"], "showQuestionGroupNames": false, "variable_groups": [], "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}]}], "contributors": [{"name": "Alex Van den Hof", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1273/"}]}