// Numbas version: exam_results_page_options {"showQuestionGroupNames": false, "duration": 0, "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Group", "questions": [{"name": "Binomial Distribution", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Edward Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1824/"}], "metadata": {"licence": "None specified", "description": ""}, "variables": {"nballs": {"templateType": "randrange", "group": "Ungrouped variables", "name": "nballs", "definition": "random(1..20#1)", "description": "

Number of selections

"}, "x": {"templateType": "randrange", "group": "Ungrouped variables", "name": "x", "definition": "random(10..100#1)", "description": "

Number of white balls

"}, "y": {"templateType": "randrange", "group": "Ungrouped variables", "name": "y", "definition": "random(10..100#1)", "description": "

Number of red balls

"}, "total_balls": {"templateType": "anything", "group": "Ungrouped variables", "name": "total_balls", "definition": "x+y", "description": ""}, "rballs": {"templateType": "anything", "group": "Ungrouped variables", "name": "rballs", "definition": "random(0..nballs)", "description": "

Number of red balls selected

"}, "wballs": {"templateType": "anything", "group": "Ungrouped variables", "name": "wballs", "definition": "random(1..min(nballs,5))", "description": "

Number of white balls selected

"}, "prob_n_red": {"templateType": "anything", "group": "Ungrouped variables", "name": "prob_n_red", "definition": "binomialpdf(rballs,nballs,1-p)", "description": "

Probability of a certain number of balls being red

"}, "p": {"templateType": "anything", "group": "Ungrouped variables", "name": "p", "definition": "x/(x+y)", "description": "

Probability that a white ball is drawn

"}, "prob_zero_white": {"templateType": "anything", "group": "Ungrouped variables", "name": "prob_zero_white", "definition": "binomialpdf(0,nballs,p)", "description": ""}, "oneminusp": {"templateType": "anything", "group": "Ungrouped variables", "name": "oneminusp", "definition": "1-p", "description": "

Probability of picking a red ball

"}, "prob_white_less_than": {"templateType": "anything", "group": "Ungrouped variables", "name": "prob_white_less_than", "definition": "binomialcdf(wballs-1,nballs,p)", "description": "

probability less than so many balls are white

"}}, "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "variableReplacements": [], "steps": [{"minValue": "p", "scripts": {}, "correctAnswerFraction": false, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "marks": 1, "prompt": "

What is the probability that the ball is white?

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

What is the probability that the ball is red? Please enter you answer as a fraction or as a decimal with 5 significant figures.

", "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "precision": "5", "maxValue": "1-p", "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "precisionType": "dp"}], "scripts": {}, "marks": 0, "prompt": "

A ball is chosen at random from the bag.

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "stepsPenalty": 0}, {"type": "information", "variableReplacements": [], "steps": [{"minValue": "prob_n_red", "scripts": {}, "correctAnswerFraction": false, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "marks": 1, "prompt": "

Find the probability that $\\var{rballs}$ of the selected balls are red.

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

Find the probability that $0$ balls are white.

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

Find the probability that fewer than $\\var{wballs}$ of the selected balls are white.

", "precisionPartialCredit": 0, "strictPrecision": false, "mustBeReduced": false, "variableReplacements": [], "mustBeReducedPC": 0, "correctAnswerStyle": "plain", "precision": "3", "maxValue": "prob_white_less_than", "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "precisionType": "dp"}], "scripts": {}, "marks": 0, "prompt": "

A ball is chosen at random from the bag, its colour noted, then returned to the bag. This is repeated $\\var{nballs}$ times.

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "stepsPenalty": 0}], "advice": "

Part (a)

\n

There are $\\var{x}$ white balls and $\\var{y}$ red balls. Thus, there are a total of $\\var{x}+\\var{y}=\\var{total_balls}$ balls.

\n

i) The probability of picking a white ball is $\\frac{Number White Balls}{TotalNumberBalls} = \\frac{\\var{x}}{\\var{total_balls}} = \\var{p}$.

\n

ii) The probability of picking a red ball is $\\frac{Number Red Balls}{TotalNumberBalls} = \\frac{\\var{y}}{\\var{total_balls}} = \\var{1-p}$

\n

\n

Part (b)

\n

As $\\var{nballs}$ balls are selected with replacement and there are only two colours of ball, we have a binomial distibution. Let $X$ be the number of white balls selected, then $X\\sim B(\\var{nballs},p)$, where $p=\\var{p}$. Similarly, let $Y$ be the number of red balls selected, then  $Y\\sim B(\\var{nballs},q)$, where $q=\\var{oneminusp}$.

\n

i) The probability that exactly $\\var{rballs}$ of the selected balls are red is thus given by:

\n

${\\var{nballs} \\choose \\var{rballs}} q^\\var{rballs}(1-q)^{\\var{nballs}-\\var{rballs}} = \\var{prob_n_red}$.

\n

ii) The probability that none of the selected balls are white is given by:

\n

${\\var{nballs} \\choose \\var{0}} p^\\var{0}(1-p)^{\\var{nballs}} = (1-p)^{\\var{nballs}} = \\var{prob_zero_white}$.

\n

iii) For this part we need to find the cumulative binomial probability, the probability that less than $\\var{wballs}$ ball are white is given by.

\n

$\\sum_{i=0}^{\\var{wballs}-1}{\\var{nballs} \\choose \\var{i}} p^\\var{i}(1-p)^{\\var{nballs}-i} = \\var{prob_white_less_than}$.

\n

\n

\n

", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "statement": "

A bag contains $\\var{x}$ white balls and $\\var{y}$ red balls. 

", "rulesets": {}, "ungrouped_variables": ["x", "y", "p", "wballs", "rballs", "prob_zero_white", "nballs", "prob_n_red", "prob_white_less_than", "total_balls", "oneminusp"], "type": "question"}, {"name": "Normal Distribution", "extensions": ["jsxgraph", "stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Edward Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1824/"}], "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"}}, "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": [], "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"}]}], "showstudentname": true, "name": "Distributions", "feedback": {"showtotalmark": true, "showanswerstate": true, "advicethreshold": 0, "allowrevealanswer": true, "feedbackmessages": [], "showactualmark": true, "intro": ""}, "percentPass": 0, "navigation": {"browse": true, "preventleave": true, "showfrontpage": true, "reverse": true, "showresultspage": "oncompletion", "allowregen": true, "onleave": {"message": "", "action": "none"}}, "metadata": {"licence": "None specified", "description": ""}, "timing": {"allowPause": true, "timedwarning": {"message": "", "action": "none"}, "timeout": {"message": "", "action": "none"}}, "type": "exam", "contributors": [{"name": "Edward Hall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1824/"}], "extensions": ["jsxgraph", "stats"], "custom_part_types": [], "resources": []}