// Numbas version: exam_results_page_options {"name": "Probability, expectation and variance of uniform distribution", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "tags": ["checked2015", "MAS1403"], "name": "Probability, expectation and variance of uniform distribution", "functions": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Exercise using a given uniform distribution $X$, calculating the expectation and variance. Also finding $P(X \\le a)$ for a given value $a$.

", "notes": "

1/01/2013:

\n

Although this application is fixed, it could be made into a \"scenario\" based question by introducing string variables, so added tag sc.

"}, "ungrouped_variables": ["upper", "lower", "ans1", "ans2", "ans3", "thisdis", "t", "tol"], "parts": [{"gaps": [{"showPrecisionHint": false, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "ans1", "minValue": "ans1", "scripts": {}, "marks": 1}, {"showPrecisionHint": false, "showCorrectAnswer": true, "allowFractions": false, "type": "numberentry", "correctAnswerFraction": false, "maxValue": "ans2+tol", "minValue": "ans2-tol", "scripts": {}, "marks": 1}], "showCorrectAnswer": true, "type": "gapfill", "prompt": "

Find $\\operatorname{E}[X]$, the expected distance in metres of the new supermarket from the town centre:

\n

$\\operatorname{E}[X]=\\;?$[[0]]m  (to 3 decimal places).

\n

Also find the variance $\\operatorname{Var}(X)$:

\n

 $\\operatorname{Var}(X)=\\;$?[[1]]  (to 3 decimal places).

\n

 

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

Find the probability that the supermarket opens within $\\var{thisdis}$ kilometres of the town centre.

\n

$P(X \\le \\var{thisdis}\\textrm{km})=\\;$?[[0]]

\n

(to 3 decimal places).

", "scripts": {}, "marks": 0}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"ans3": {"description": "", "templateType": "anything", "definition": "precround((thisdis*1000-lower)/(upper-lower),3)", "name": "ans3", "group": "Ungrouped variables"}, "thisdis": {"description": "", "templateType": "anything", "definition": "precround((t*lower+(100-t)*upper)/100000,2)", "name": "thisdis", "group": "Ungrouped variables"}, "ans2": {"description": "", "templateType": "anything", "definition": "precround((upper-lower)^2/12,3)", "name": "ans2", "group": "Ungrouped variables"}, "t": {"description": "", "templateType": "anything", "definition": "random(20..80)", "name": "t", "group": "Ungrouped variables"}, "tol": {"description": "", "templateType": "anything", "definition": "0.001", "name": "tol", "group": "Ungrouped variables"}, "ans1": {"description": "", "templateType": "anything", "definition": "(upper+lower)/2", "name": "ans1", "group": "Ungrouped variables"}, "lower": {"description": "", "templateType": "anything", "definition": "random(500..1000#50)", "name": "lower", "group": "Ungrouped variables"}, "upper": {"description": "", "templateType": "anything", "definition": "lower+random(300..500#50)", "name": "upper", "group": "Ungrouped variables"}}, "type": "question", "showQuestionGroupNames": false, "preamble": {"js": "", "css": ""}, "advice": "

a) For a Uniform distribution \\[X \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\] we have:

\n

$\\displaystyle \\operatorname{E}[X] = \\frac{\\var{lower}+\\var{upper}}{2}=\\var{ans1}$m

\n

$\\displaystyle \\operatorname{Var}(X) = \\frac{(\\var{upper}-\\var{lower})^2}{12}=\\frac{(\\var{upper-lower})^2}{12}=\\var{ans2}$ to 3 decimal places.

\n

b)

\n

$\\displaystyle P(X \\le \\var{thisdis}\\textrm{km})=\\frac{\\var{thisdis}\\times 1000 -\\var{lower}}{\\var{upper}-\\var{lower}}=\\var{ans3}$ to 3 decimal places.

", "statement": "\n

A new supermarket plans to open somewhere on the outskirts of a town. In fact, $X$, the distance of a new supermarket from the town centre is Uniformly distributed between $\\var{lower}$ metres and $\\var{upper}$ metres i.e. 

\n

\\[X \\sim \\operatorname{U}(\\var{lower},\\var{upper})\\]

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