// Numbas version: exam_results_page_options {"name": "Normal Distribution", "extensions": ["stats", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "ungrouped_variables": ["mu", "sigma", "cdf1", "variance", "lbound1", "ubound", "ubound1", "ubound2", "lbound2", "lbound3", "ubound3", "cdf2", "cdf3", "cdf4", "onesigma", "musigma"], "statement": "

This question is concerned with finding probabilities from a normal distribution.

", "variables": {"cdf2": {"definition": "normalcdf(ubound1,mu,sigma)-normalcdf(lbound1,mu,sigma)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "cdf2"}, "ubound3": {"definition": "random(ceil(mu-3*sigma)..floor(mu)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "ubound3"}, "lbound3": {"definition": "random(ceil(mu)..floor(mu+3*sigma)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "lbound3"}, "variance": {"definition": "random(1,4,9,16,25)", "templateType": "anything", "description": "

Variance

", "group": "Ungrouped variables", "name": "variance"}, "onesigma": {"definition": "1/sigma", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "onesigma"}, "musigma": {"definition": "mu/sigma", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "musigma"}, "ubound1": {"definition": "random(ceil(mu)..floor(mu+3*sigma)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "ubound1"}, "ubound2": {"definition": "random(ceil(mu)..floor(mu+3*sigma)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "ubound2"}, "mu": {"definition": "random(-5..5#0.5)", "templateType": "randrange", "description": "

mean

", "group": "Ungrouped variables", "name": "mu"}, "cdf4": {"definition": "1+normalcdf(ubound3,mu,sigma)-normalcdf(lbound3,mu,sigma)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "cdf4"}, "lbound2": {"definition": "random(ceil(mu-3*sigma)..floor(mu)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "lbound2"}, "ubound": {"definition": "random(floor(mu)..floor(mu+3*sigma))", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "ubound"}, "lbound1": {"definition": "random(ceil(mu-3*sigma)..floor(mu)#0.1)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "lbound1"}, "cdf3": {"definition": "1-normalcdf(lbound2,mu,sigma)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "cdf3"}, "cdf1": {"definition": "normalcdf(ubound,mu,sigma)", "templateType": "anything", "description": "", "group": "Ungrouped variables", "name": "cdf1"}, "sigma": {"definition": "sqrt(variance)", "templateType": "anything", "description": "

standard deviation

", "group": "Ungrouped variables", "name": "sigma"}}, "name": "Normal Distribution", "advice": "

Part a

\n

Given a distribution $X\\sim N(\\mu,\\sigma^2)$, then if $Y=\\frac{X-\\mu}{\\sigma}$, $Y\\sim N(0,1)$.

\n

In this case, $\\mu = \\var{mu}$ and $\\sigma = \\var{sigma}$, hence $Y = \\simplify{{onesigma}X-{musigma}}$.

\n

\n

Part b

\n

The following parts show which areas under the normal curve need to be found.

\n

i) {drawintegral1(mu,sigma,ubound)}

\n

ii) {drawintegral2(mu,sigma,lbound1,ubound1)}

\n

iii) {drawintegral3(mu,sigma,lbound2)}

\n

iv) {drawintegral4(mu,sigma,lbound3,ubound3)}

", "variable_groups": [], "extensions": ["jsxgraph", "stats"], "parts": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "type": "gapfill", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"precisionType": "dp", "mustBeReducedPC": 0, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "correctAnswerStyle": "plain", "minValue": "1/sigma", "marks": 1, "precisionPartialCredit": "0", "variableReplacementStrategy": "originalfirst", "maxValue": "1/sigma", "type": "numberentry", "mustBeReduced": false, "correctAnswerFraction": false, "strictPrecision": false, "scripts": {}, "precision": "5", "notationStyles": ["plain", "en", "si-en"]}, {"precisionType": "dp", "mustBeReducedPC": 0, "variableReplacements": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": false, "correctAnswerStyle": "plain", "minValue": "-{mu}/sigma", "marks": 1, "precisionPartialCredit": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "-{mu}/sigma", "type": "numberentry", "mustBeReduced": false, "correctAnswerFraction": false, "strictPrecision": false, "scripts": {}, "precision": "5", "notationStyles": ["plain", "en", "si-en"]}], "scripts": {}, "prompt": "

If $X \\sim N(\\var{mu},\\var{variance})$, then  $Y\\sim N(0,1)$ if

\n

$Y = $[[0]]$X+$Gap 1

\n

Please give your answer to 5 decimal places.

", "marks": 0}, {"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "steps": [{"precisionType": "dp", "maxValue": "cdf1", "variableReplacements": [], "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "cdf1", "showPrecisionHint": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "

$P(-\\infty \\leq X \\leq \\var{ubound})$

", "marks": 1, "precisionPartialCredit": 0, "type": "numberentry", "strictPrecision": true, "scripts": {}, "precision": "4"}, {"precisionType": "dp", "maxValue": "cdf2", "variableReplacements": [], "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "cdf2", "showPrecisionHint": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "

$P(\\var{lbound1} \\leq X \\leq \\var{ubound1})$

", "marks": 1, "precisionPartialCredit": 0, "type": "numberentry", "strictPrecision": true, "scripts": {}, "precision": "4"}, {"precisionType": "dp", "maxValue": "cdf3", "variableReplacements": [], "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "cdf3", "showPrecisionHint": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "

$P(\\var{lbound2} \\leq X \\leq \\infty)$

", "marks": 1, "precisionPartialCredit": 0, "type": "numberentry", "strictPrecision": true, "scripts": {}, "precision": "4"}, {"precisionType": "dp", "maxValue": "cdf4", "variableReplacements": [], "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReduced": false, "correctAnswerStyle": "plain", "minValue": "cdf4", "showPrecisionHint": true, "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "

$P(\\{-\\infty\\leq X \\leq \\var{ubound3}\\} \\cup \\{\\var{lbound3} \\leq X \\leq \\infty\\})$

", "marks": 1, "precisionPartialCredit": 0, "type": "numberentry", "strictPrecision": true, "scripts": {}, "precision": "4"}], "stepsPenalty": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "prompt": "

Using a calculator, or the statistical tables, find the following probabilities:

\n

", "scripts": {}, "type": "information", "marks": 0}], "functions": {"drawintegral1": {"definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\n\nvar ulimit = 1.0/Math.sqrt(2.0*Math.PI*sigma*sigma)\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [mu-4.5*sigma,1.1*ulimit,mu+4.5*sigma,-0.2*ulimit],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,sigma],{\n drawLabels: true,\n label: {offset: [-4, -15]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1.05*ulimit],{\ndrawLabels: true,\nlabel: {offset: [-45, 0]},\nminorTicks: 0\n});\n\nvar graph = board.create('functiongraph',\n [function(x){ return Math.exp(-(x-mu)*(x-mu)/(2.0*sigma*sigma))/Math.sqrt(2.0*Math.PI*sigma*sigma);}, mu-6.0*sigma, mu+6.0*sigma]\n );\n\nvar i1 = board.create('integral', [[mu-6*sigma, ubound], graph,{label: {position:'bot'}}]);\n\n// create the static line based on the coefficients a and b\n//var line1 = board.create('line',[[0,b],[1,a+b]],{fixed:true, strokeWidth: 1});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n//var p1 = board.create('point',[0,b],{fixed:true, size:3, name: 'P_1', face: 'cross'});\n//var p2 = board.create('point',[x2,y2],{fixed:true, size:3, name: 'P_2', face: 'cross'});\n\nreturn div;", "parameters": [["mu", "number"], ["sigma", "number"], ["ubound", "number"]], "language": "javascript", "type": "html"}, "drawintegral4": {"definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\n\nvar ulimit = 1.0/Math.sqrt(2.0*Math.PI*sigma*sigma)\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [mu-4.5*sigma,1.1*ulimit,mu+4.5*sigma,-0.2*ulimit],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,sigma],{\n drawLabels: true,\n label: {offset: [-4, -15]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1.05*ulimit],{\ndrawLabels: true,\nlabel: {offset: [-45, 0]},\nminorTicks: 0\n});\n\nvar graph = board.create('functiongraph',\n [function(x){ return Math.exp(-(x-mu)*(x-mu)/(2.0*sigma*sigma))/Math.sqrt(2.0*Math.PI*sigma*sigma);}, mu-6.0*sigma, mu+6.0*sigma]\n );\n\nvar i1 = board.create('integral', [[lbound, mu+6*sigma], graph, {label: {offset:[-1000,500]}}]);\nvar i2 = board.create('integral', [[mu-6*sigma, ubound], graph]);\n\n// create the static line based on the coefficients a and b\n//var line1 = board.create('line',[[0,b],[1,a+b]],{fixed:true, strokeWidth: 1});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n//var p1 = board.create('point',[0,b],{fixed:true, size:3, name: 'P_1', face: 'cross'});\n//var p2 = board.create('point',[x2,y2],{fixed:true, size:3, name: 'P_2', face: 'cross'});\n\nreturn div;", "parameters": [["mu", "number"], ["sigma", "number"], ["lbound", "number"], ["ubound", "number"]], "language": "javascript", "type": "html"}, "drawintegral2": {"definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\n\nvar ulimit = 1.0/Math.sqrt(2.0*Math.PI*sigma*sigma)\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [mu-4.5*sigma,1.1*ulimit,mu+4.5*sigma,-0.2*ulimit],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,sigma],{\n drawLabels: true,\n label: {offset: [-4, -15]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1.05*ulimit],{\ndrawLabels: true,\nlabel: {offset: [-45, 0]},\nminorTicks: 0\n});\n\nvar graph = board.create('functiongraph',\n [function(x){ return Math.exp(-(x-mu)*(x-mu)/(2.0*sigma*sigma))/Math.sqrt(2.0*Math.PI*sigma*sigma);}, mu-4.0*sigma, mu+4.0*sigma]\n );\n\nvar i1 = board.create('integral', [[lbound, ubound], graph]);\n\n// create the static line based on the coefficients a and b\n//var line1 = board.create('line',[[0,b],[1,a+b]],{fixed:true, strokeWidth: 1});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n//var p1 = board.create('point',[0,b],{fixed:true, size:3, name: 'P_1', face: 'cross'});\n//var p2 = board.create('point',[x2,y2],{fixed:true, size:3, name: 'P_2', face: 'cross'});\n\nreturn div;", "parameters": [["mu", "number"], ["sigma", "number"], ["lbound", "number"], ["ubound", "number"]], "language": "javascript", "type": "html"}, "drawintegral3": {"definition": "// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\n\nvar ulimit = 1.0/Math.sqrt(2.0*Math.PI*sigma*sigma)\n\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n{boundingBox: [mu-4.5*sigma,1.1*ulimit,mu+4.5*sigma,-0.2*ulimit],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,sigma],{\n drawLabels: true,\n label: {offset: [-4, -15]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1.05*ulimit],{\ndrawLabels: true,\nlabel: {offset: [-45, 0]},\nminorTicks: 0\n});\n\nvar graph = board.create('functiongraph',\n [function(x){ return Math.exp(-(x-mu)*(x-mu)/(2.0*sigma*sigma))/Math.sqrt(2.0*Math.PI*sigma*sigma);}, mu-6.0*sigma, mu+6.0*sigma]\n );\n\nvar i1 = board.create('integral', [[lbound, mu+6*sigma], graph]);\n\n// create the static line based on the coefficients a and b\n//var line1 = board.create('line',[[0,b],[1,a+b]],{fixed:true, strokeWidth: 1});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n//var p1 = board.create('point',[0,b],{fixed:true, size:3, name: 'P_1', face: 'cross'});\n//var p2 = board.create('point',[x2,y2],{fixed:true, size:3, name: 'P_2', face: 'cross'});\n\nreturn div;", "parameters": [["mu", "number"], ["sigma", "number"], ["lbound", "number"]], "language": "javascript", "type": "html"}}, "preamble": {"css": "", "js": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "metadata": {"description": "", "licence": "None specified"}, "tags": [], "type": "question", "contributors": [{"name": "Edward Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1824/"}]}]}], "contributors": [{"name": "Edward Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1824/"}]}