// Numbas version: exam_results_page_options {"name": "Find expectation, variance and probability sample mean in range for normal distribution, , ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"tol": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0.0001", "description": "", "name": "tol"}, "zlowsam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqrt(sa)*zlow", "description": "", "name": "zlowsam"}, "pupsam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(normalCDF(zupsam,0,1),6)", "description": "", "name": "pupsam"}, "tol1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "0", "description": "", "name": "tol1"}, "sva": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s^2/sa,2)", "description": "", "name": "sva"}, "pup": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(normalcdf(zup,0,1),6)", "description": "", "name": "pup"}, "plowsam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(normalCDF(abs(zlowsam),0,1),6)", "description": "", "name": "plowsam"}, "zlow": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(lower-m)/s", "description": "", "name": "zlow"}, "sup": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..0.75#0.005)", "description": "", "name": "sup"}, "upper": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m+sup*s", "description": "", "name": "upper"}, "lower": {"templateType": "anything", "group": "Ungrouped variables", "definition": "m-slow*s", "description": "", "name": "lower"}, "plow": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(normalcdf(abs(zlow),0,1),6)", "description": "", "name": "plow"}, "nationality": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('English','Australian','African','American','Chinese','Mediterranean')", "description": "", "name": "nationality"}, "m": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(100..300#10)", "description": "", "name": "m"}, "animals": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('rabbits','goats','mice','cows','rats')", "description": "", "name": "animals"}, "sb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(sa=9,random(16,25,36),if(sa=16,random(25,36),36))", "description": "", "name": "sb"}, "probsam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pupsam+plowsam-1,4)", "description": "", "name": "probsam"}, "zup": {"templateType": "anything", "group": "Ungrouped variables", "definition": "(upper-m)/s", "description": "", "name": "zup"}, "stuff": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random('sodium choride','fatty acid','potassium','protein','carbonic anhydrase','fibrinogen')", "description": "", "name": "stuff"}, "slow": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(0.1..0.75#0.005)", "description": "", "name": "slow"}, "zupsam": {"templateType": "anything", "group": "Ungrouped variables", "definition": "sqrt(sa)*zup", "description": "", "name": "zupsam"}, "s": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15..30#5)", "description": "", "name": "s"}, "svb": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(s^2/sb,2)", "description": "", "name": "svb"}, "prob": {"templateType": "anything", "group": "Ungrouped variables", "definition": "precround(pup+plow-1,4)", "description": "", "name": "prob"}, "sa": {"templateType": "anything", "group": "Ungrouped variables", "definition": "if(s=25,random(9,16),random(9,16,25))", "description": "", "name": "sa"}}, "ungrouped_variables": ["upper", "zlowsam", "zlow", "m", "plowsam", "plow", "slow", "tol", "sup", "prob", "zup", "probsam", "zupsam", "nationality", "pup", "lower", "animals", "pupsam", "svb", "sva", "s", "stuff", "sb", "sa", "tol1"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Find expectation, variance and probability sample mean in range for normal distribution, , ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"showCorrectAnswer": true, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "{prob+tol}", "minValue": "{prob-tol}", "correctAnswerFraction": false, "marks": 1, "showPrecisionHint": false}], "type": "gapfill", "prompt": "\n

Find:

\n

$P(\\var{lower} \\lt X \\lt \\var{upper})=\\;\\;$[[0]]

\n

Correct to 4 decimal places.

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

Let $\\overline{X}$ be the random variable given by the sample mean.

\n

Find $\\operatorname{E}[ \\overline{X}]$ and $\\operatorname{Var}(\\overline{X})$ in the following cases:

\n

1) A sample of size $\\var{sa}$

\n

$\\operatorname{E}[ \\overline{X}]=\\;\\;$[[0]]$\\;\\;\\;\\operatorname{Var}(\\overline{X})=\\;\\;$[[1]]

\n

2) A sample of size $\\var{sb}$

\n

$\\operatorname{E}[ \\overline{X}]=\\;\\;$[[2]]$\\;\\;\\;\\operatorname{Var}(\\overline{X})=\\;\\;$[[3]]

\n

Enter the variances to 2 decimal places.

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

Assuming that $\\overline{X}$ also follows a normal distribution.

\n \n \n \n

Find $P(\\var{lower} \\lt \\overline{X} \\lt \\var{upper})$ in a sample of size $\\var{sa}$.

\n \n \n \n

$P(\\var{lower} \\lt \\overline{X} \\lt \\var{upper})=\\;\\;$[[0]]

\n \n \n \n

Enter the value correct to 4 decimal places.

\n \n \n ", "showCorrectAnswer": true, "marks": 0}], "statement": "

The total {stuff} content of the blood plasma of {nationality} {animals} ($X$, in mg/100ml) is known to follow a $N(\\var{m},\\var{s^2})$ distribution.

", "tags": ["checked2015", "cr1", "distribution of sample mean", "distributions", "MAS1604", "MAS8380", "MAS8401", "normal distribution", "Normal distribution", "Probability", "probability", "random variables", "sample", "sample distribution", "sample mean", "sc", "statistics", "tested1", "z scores"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

13/07/2012:

\n

Added tags.

\n

Cannot check calculations as yet as cannot access stats extension.

\n

Set new tolerance variable tol=0.0001 for numeric entries to 4 dps.

\n

Set new tolerance variable tol=0 for numeric entries to 2 dps.

\n

21/12/2012:

\n

Checked calculations against standard tables, OK. Added tested1 tag.

\n

Corrected a typos and improved display in Advice.

\n

Checked rounding, OK. Added tag cr1.

\n

This has scenarios - could be extended. Added sc tag.

\n

 

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Normal distribution $X \\sim  N(\\mu,\\sigma^2)$ given. Find $P(a \\lt X \\lt b)$. Find expectation, variance, $P(c \\lt \\overline{X} \\lt d)$ for sample mean $\\overline{X}$.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a) Converting to $Z$ scores in $N(0,1)$ we have for $X \\sim N(\\var{m},\\var{s^2})$

\n

\\[\\begin{eqnarray*} P(\\var{lower} \\lt X \\lt \\var{upper})&=&P(X \\lt \\var{upper})-P(X \\lt \\var{lower})\\\\ &=&P\\left(Z \\lt \\frac{\\var{upper}-\\var{m}}{\\var{s}}\\right)-P\\left(Z \\lt \\frac{\\var{lower}-\\var{m}}{\\var{s}}\\right)\\\\ &=&P(Z \\lt \\var{zup})-P( Z \\lt \\var{zlow})\\\\ &=&\\var{pup}-\\var{1-plow}\\\\ &=&\\var{prob} \\end{eqnarray*} \\] to 4 decimal places.

\n

Here the probabilities could have been looked up from normal CDF tables. Alternatively we can simply do the whole calculation in

\n

R by typing $\\operatorname{pnorm}(\\var{upper},\\var{m},\\var{s})-\\operatorname{pnorm}(\\var{lower},\\var{m},\\var{s})$.

\n

b)
This part reminds you that for the sample mean for samples of size $n$ from a normal distribution $N(\\mu,\\sigma^2)$ has a normal distribution $\\displaystyle N\\left(\\mu,\\frac{\\sigma^2}{n}\\right)$.

\n

Hence for a sample size $\\var{sa}$:

\n

$\\displaystyle \\operatorname{E}[\\overline{X}] = \\mu=\\var{m}$ and $\\displaystyle \\operatorname{Var}(\\overline{X}) = \\frac{\\sigma^2}{n}=\\frac{\\var{s^2}}{\\var{sa}}=\\var{sva}$

\n

Hence for a sample size $\\var{sb}$:

\n

$\\operatorname{E}[\\overline{X}] = \\mu=\\var{m}$ and $\\displaystyle \\operatorname{Var}(\\overline{X}) = \\frac{\\sigma^2}{n}=\\frac{\\var{s^2}}{\\var{sb}}=\\var{svb}$

\n

c)
Since the sample size is $\\var{sa}$ we are dealing with the normal distribution $N(\\var{m},\\simplify[std]{{s^2}/{sa}})$.

\n

Converting to $Z$ scores in $N(0,1)$ we have for $\\overline{X} \\sim N(\\var{m},\\simplify[std]{{s^2}/{sa}})$

\n

\\[\\begin{eqnarray*} P(\\var{lower} \\lt \\overline{X} \\lt \\var{upper})&=&P(\\overline{X} \\lt \\var{upper})-P(\\overline{X}\\lt \\var{lower})\\\\ &=&P\\left(Z \\lt \\frac{\\sqrt{\\var{sa}}(\\var{upper}-\\var{m})}{\\var{s}}\\right)-P\\left(Z \\lt \\frac{\\sqrt{\\var{sa}}(\\var{lower}-\\var{m})}{\\var{s}}\\right)\\\\ &=&P(Z \\lt \\var{zupsam})-P( Z \\lt \\var{zlowsam})\\\\ &=&\\var{pupsam}-\\var{1-plowsam}\\\\ &=&\\var{probsam} \\end{eqnarray*} \\] to 4 decimal places.

\n

Here the probabilities could have been looked up from normal CDF tables. Alternatively we can simply do the whole calculation in

\n

R by typing $\\operatorname{pnorm}(\\var{upper},\\var{m},\\frac{\\var{s}}{\\sqrt{\\var{sa}}})-\\operatorname{pnorm}(\\var{lower},\\var{m},\\frac{\\var{s}}{\\sqrt{\\var{sa}}})$ i.e. $\\operatorname{pnorm}(\\var{upper},\\var{m},\\var{s/sqrt(sa)})-\\operatorname{pnorm}(\\var{lower},\\var{m},\\var{s/sqrt(sa)})$ 

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