// Numbas version: finer_feedback_settings {"name": "PA4 - Data Table", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "PA4 - Data Table", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "
This table shows the proportion of nests with different numbers of eggs:
\n| Clutch Size | \n3 | \n4 | \n5 | \n6 | \n7 | \n8 | \n9 | \n
| $P(C=c)$ | \n{e3} | \n{e4} | \n{e5} | \n{e6} | \n{e7} | \n{e8} | \n{e9} | \n
a) {advicea}
\nb) We want to calculate the expected number of eggs in the clutch.
\nSince we have discrete data our formula for expected value is $E[X]=\\sum_{i=1}^nx_i\\cdot P(X=x_i)$, where:
\nHence,
\n\\begin{align}
E[X] &= \\sum_{i=1}^nx_i\\cdot P(X=x_i) \\\\
&= 3\\cdot P(X=3) + 4\\cdot P(X=4) + 5\\cdot P(X=5) + 6\\cdot P(X=6) + 7\\cdot P(X=7) + 8\\cdot P(X=8) + 9\\cdot P(X=9) \\\\
&= 3\\cdot\\var{e3} + 4\\cdot\\var{e4} + 5\\cdot\\var{e5} + 6\\cdot\\var{e6} + 7\\cdot\\var{e7} + 8\\cdot\\var{e8} + 9\\cdot\\var{e9} \\\\
&= \\var{3*e3} +\\var{4*e4} + \\var{5*e5} + \\var{6*e6} + \\var{7*e7} +\\var{8*e8} + \\var{9*e9} \\\\
&= \\var{expected}
\\end{align}
Hence, our expected number of eggs in the clutch is $\\var{round_exp}$ (rounded to two decimal places if necessary).
\nc) Our formula for variance is $Var(X) = E[X^2] - E[X]^2.$
\nWe have already calculated $E[x]$ in part b so now we must find $E[X^2]$.
\nSo,
\n\\begin{align}
E[X^2] &= \\sum_{i=1}^nx_i^2\\cdot P(X=x_i) \\\\
&= 3^2\\cdot P(X=3) + 4^2\\cdot P(X=4) + 5^2\\cdot P(X=5) + 6^2\\cdot P(X=6) + 7^2\\cdot P(X=7) + 8^2\\cdot P(X=8) + 9^2\\cdot P(X=9) \\\\
&= 9\\cdot\\var{e3} + 16\\cdot\\var{e4} + 25\\cdot\\var{e5} + 36\\cdot\\var{e6} + 49\\cdot\\var{e7} + 64\\cdot\\var{e8} + 81\\cdot\\var{e9} \\\\
&= \\var{9*e3} +\\var{16*e4} + \\var{25*e5} + \\var{36*e6} + \\var{49*e7} +\\var{64*e8} + \\var{81*e9} \\\\
&= \\var{squared}.
\\end{align}
Hence,
\n\\begin{align}
Var(X) &= E[X^2] - E[X]^2 \\\\
&= \\var{squared} - \\var{expected}^2 \\\\
&= \\var{squared} - \\var{expected^2} \\\\
&= \\var{variance}.
\\end{align}
Therefore our variance in the number of eggs is $\\var{round_var}$ (rounded to two decimal places if necessary).
\nd) We now want to find the expected number of chicks surviving.
\nOur formula for this will be $E[X]=\\sum_{i=1}^n\\sqrt{x_i}\\cdot P(X=x_i)$.
\nSo,
\n\\begin{align}
E[X] &= \\sum_{i=1}^n\\sqrt{x_i}\\cdot P(X=x_i) \\\\
&= \\sqrt{3}\\cdot P(X=3) + \\sqrt{4}\\cdot P(X=4) + \\sqrt{5}\\cdot P(X=5) + \\sqrt{6}\\cdot P(X=6) + \\sqrt{7}\\cdot P(X=7) + \\sqrt{8}\\cdot P(X=8) + \\sqrt{9}\\cdot P(X=9) \\\\
&= \\sqrt{3}\\cdot\\var{e3} + \\sqrt{4}\\cdot\\var{e4} + \\sqrt{5}\\cdot\\var{e5} + \\sqrt{6}\\cdot\\var{e6} + \\sqrt{7}\\cdot\\var{e7} + \\sqrt{8}\\cdot\\var{e8} + \\sqrt{9}\\cdot\\var{e9} \\\\
&= \\var{transform_exp}.
\\end{align}
Hence, our expected number of chicks surviving is $\\var{round_Texp}$ to two decimal places.
\n\nUse this link to find some resources which will help you revise this topic.
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"e9": {"name": "e9", "group": "Ungrouped variables", "definition": "0.02", "description": "9 eggs in clutch
", "templateType": "anything", "can_override": false}, "e8": {"name": "e8", "group": "Ungrouped variables", "definition": "0.03", "description": "8 eggs in clutch
", "templateType": "anything", "can_override": false}, "e6": {"name": "e6", "group": "Ungrouped variables", "definition": "0.33", "description": "6 eggs in clutch
", "templateType": "anything", "can_override": false}, "e5": {"name": "e5", "group": "Ungrouped variables", "definition": "0.35", "description": "5 eggs in clutch
", "templateType": "anything", "can_override": false}, "e3": {"name": "e3", "group": "Ungrouped variables", "definition": "0.01", "description": "3 eggs in clutch
", "templateType": "anything", "can_override": false}, "e4": {"name": "e4", "group": "Ungrouped variables", "definition": "0.17", "description": "4 eggs in clutch
", "templateType": "anything", "can_override": false}, "egg": {"name": "egg", "group": "Part a - probability ", "definition": "random(6,7,8)", "description": "Clutch size for probability
", "templateType": "anything", "can_override": false}, "eggprob": {"name": "eggprob", "group": "Part a - probability ", "definition": "if(egg=6, e6+e7+e8+e9, if(egg=7, e7+e8+e9, if(egg=8, e8+e9,0)))", "description": "probaility for selected clutch size
", "templateType": "anything", "can_override": false}, "e7": {"name": "e7", "group": "Ungrouped variables", "definition": "0.09", "description": "7 eggs in clutch
", "templateType": "anything", "can_override": false}, "expected": {"name": "expected", "group": "Part b & C - Expectation & Variance", "definition": "3*e3 + 4*e4 + 5*e5 + 6*e6 + 7*e7 + 8*e8 + 9*e9", "description": "Expected number of eggs
", "templateType": "anything", "can_override": false}, "squared": {"name": "squared", "group": "Part b & C - Expectation & Variance", "definition": "3^2*e3 + 4^2*e4 + 5^2*e5 + 6^2*e6 + 7^2*e7 + 8^2*e8 + 9^2*e9", "description": "E[X^2] for variance formula
", "templateType": "anything", "can_override": false}, "variance": {"name": "variance", "group": "Part b & C - Expectation & Variance", "definition": "squared - (expected)^2", "description": "Variance
", "templateType": "anything", "can_override": false}, "round_exp": {"name": "round_exp", "group": "Part b & C - Expectation & Variance", "definition": "precround(expected,2)", "description": "Expectation rounded to 2 d.p.
", "templateType": "anything", "can_override": false}, "round_var": {"name": "round_var", "group": "Part b & C - Expectation & Variance", "definition": "precround(variance,2)", "description": "variation rounded to 2 d.p.
", "templateType": "anything", "can_override": false}, "transform_exp": {"name": "transform_exp", "group": "Part d - transform data ", "definition": "sqrt(3)*e3 + sqrt(4)*e4 + sqrt(5)*e5 + sqrt(6)*e6 + sqrt(7)*e7 + sqrt(8)*e8 + sqrt(9)*e9", "description": "Expected value of data that has undergone a square root transformation
", "templateType": "anything", "can_override": false}, "round_Texp": {"name": "round_Texp", "group": "Part d - transform data ", "definition": "precround(transform_exp,2)", "description": "rounded number of expected chicks to survive
", "templateType": "anything", "can_override": false}, "advice6": {"name": "advice6", "group": "Part a - probability ", "definition": "\"We want the probability that there are 6 or more eggs in the clutch, i.e., $P(C\\\\geq6)$.
\\nThis means that the clutch could contain 6, 7, 8 or 9 eggs so, to calculate $P(C\\\\geq6)$, we use the following sum:
\\n$P(C\\\\geq6)=P(C=6)+P(C=7)+P(C=8)+P(C=9)$.
\\nSo,
\\n\\\\begin{align}
P(C\\\\geq6)&=\\\\var{e6}+\\\\var{e7}+\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}
Hence, the probability that there are 6 or more eggs in the clutch is $\\\\var{eggprob}$.
\"", "description": "", "templateType": "long string", "can_override": false}, "advice7": {"name": "advice7", "group": "Part a - probability ", "definition": "\"We want the probability that there are 7 or more eggs in the clutch, i.e., $P(C\\\\geq7)$.
\\nThis means that the clutch could contain 7, 8 or 9 eggs so, to calculate $P(C\\\\geq7)$, we use the following sum:
\\n$P(C\\\\geq7)=P(C=7)+P(C=8)+P(C=9)$.
\\nSo,
\\n\\\\begin{align}
P(C\\\\geq7)&=\\\\var{e7}+\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}
Hence, the probability that there are 7 or more eggs in the clutch is $\\\\var{eggprob}$.
\"", "description": "", "templateType": "long string", "can_override": false}, "advice8": {"name": "advice8", "group": "Part a - probability ", "definition": "\"We want the probability that there are 8 or more eggs in the clutch, i.e., $P(C\\\\geq8)$.
\\nThis means that the clutch could contain 8 or 9 eggs so, to calculate $P(C\\\\geq8)$, we use the following sum:
\\n$P(C\\\\geq8)=P(C=8)+P(C=9)$.
\\nSo,
\\n\\\\begin{align}
P(C\\\\geq8)&=\\\\var{e8}+\\\\var{e9} \\\\\\\\
&=\\\\var{eggprob}.
\\\\end{align}
Hence, the probability that there are 8 or more eggs in the clutch is $\\\\var{eggprob}$.
\"", "description": "", "templateType": "long string", "can_override": true}, "advicea": {"name": "advicea", "group": "Part a - probability ", "definition": "if(egg=6,advice6,if(egg=7,advice7,if(egg=8,advice8,0)))", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["e9", "e8", "e7", "e6", "e5", "e4", "e3"], "variable_groups": [{"name": "Part a - probability ", "variables": ["egg", "eggprob", "advice6", "advice7", "advice8", "advicea"]}, {"name": "Part b & C - Expectation & Variance", "variables": ["expected", "squared", "variance", "round_exp", "round_var"]}, {"name": "Part d - transform data ", "variables": ["transform_exp", "round_Texp"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "a)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What is the probability that there are {egg} or more eggs in a clutch, i.e., $P(C\\geq\\var{egg})$?
", "minValue": "eggprob", "maxValue": "eggprob", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What is the expected number of eggs?
\nRound your answer to two decimal places if necessary.
", "minValue": "round_exp", "maxValue": "round_exp", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "c)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "What is the variance in the number of eggs?
\nRound your answer to two decimal places if necessary.
", "minValue": "round_var", "maxValue": "round_var", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "d)", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Let's assume that the number of surviving chicks can be estimated by computing the square-root of the clutch size. Compute the expected number of chicks to survive.
\nRound your answer to two decimal places if necessary.
", "minValue": "round_Texp", "maxValue": "round_Texp", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}], "resources": []}]}], "contributors": [{"name": "Lauren Desoysa", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21504/"}, {"name": "Megan Oliver", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/23526/"}]}