// Numbas version: finer_feedback_settings {"name": "Simon's copy of Template 1 for Workshop", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "parts": [{"useCustomName": false, "prompt": "
Find the following probabilities that a randomly chosen {things} involved in this survey:
\n1) P(is {somecat}) = [[0]]
\n2) P(is {drk}) = [[1]]
\n3) P(is either {oneof}) = [[2]]
\n4) P({drkpair}) = [[3]]
\n5) P({catattrib1}) = [[4]]
\n6) P({catattrib2}) = [[5]]
\n(Enter all probabilities to 3 decimal places)
", "extendBaseMarkingAlgorithm": true, "gaps": [{"minValue": "ans[0]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[0]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[1]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[1]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[2]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[2]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[3]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[3]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[4]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[4]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[5]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[5]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}], "sortAnswers": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "customName": "", "marks": 0, "customMarkingAlgorithm": ""}, {"useCustomName": false, "prompt": "For two randomly selected {things}s in this survey, find (to 3 decimal places):
\n7) P(both {somecat}) = [[0]]
\n8) P(both {drk1}) = [[1]]
", "extendBaseMarkingAlgorithm": true, "gaps": [{"minValue": "ans[6]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[6]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}, {"minValue": "ans[7]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[7]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}], "sortAnswers": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "customName": "", "marks": 0, "customMarkingAlgorithm": ""}, {"useCustomName": false, "prompt": "Given that a randomly selected {things} in this survey is {drk}, what is:
\n9) P(is {somecat}) = [[0]]
\n", "extendBaseMarkingAlgorithm": true, "gaps": [{"minValue": "ans[8]", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "useCustomName": false, "mustBeReducedPC": 0, "extendBaseMarkingAlgorithm": true, "allowFractions": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "correctAnswerFraction": false, "mustBeReduced": false, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "numberentry", "maxValue": "ans[8]", "customName": "", "correctAnswerStyle": "plain", "marks": 1, "customMarkingAlgorithm": ""}], "sortAnswers": false, "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "type": "gapfill", "customName": "", "marks": 0, "customMarkingAlgorithm": ""}], "ungrouped_variables": ["somecat", "ve", "othercats", "at", "ce1", "ans", "n", "drk1", "things", "u1", "tot", "catattrib2", "cats", "tc", "w1", "oneof", "tc2", "tc3", "tc1", "catattrib1", "a", "drkpair", "this", "cat", "we2", "drk", "r", "u", "t", "w", "v", "sumr", "ce2"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "
Basic data structures and maths/stats functionality given.
\nYou can configure the rest.
\nrebelmaths
"}, "name": "Simon's copy of Template 1 for Workshop", "rulesets": {}, "statement": "A survey was conducted to obtain information on {this}. A random sample of {things}s gave :
\n{Cats} | \n{At[0]} | \n{At[1]} | \n{At[2]} | \nTotal | \n
{cat[0]} | \n{r[0][0]} | \n{r[0][1]} | \n{r[0][2]} | \n{sumr[0]} | \n
{cat[1]} | \n{r[1][0]} | \n{r[1][1]} | \n{r[1][2]} | \n{sumr[1]} | \n
{cat[2]} | \n{r[2][0]} | \n{r[2][1]} | \n{r[2][2]} | \n{sumr[2]} | \n
{cat[3]} | \n{r[3][0]} | \n{r[3][1]} | \n{r[3][2]} | \n{sumr[3]} | \n
Totals | \n{tc[0]} | \n{tc[1]} | \n{tc[2]} | \n\n {tot} \n | \n
Give all answers correct to 3 decimal places (not in fraction form).
", "variable_groups": [], "advice": "1)
\nThe total number of {somecat} {things}s is $\\var{sumr[t]}$ hence the probability that a random {things} from this survey is {somecat} is $\\displaystyle \\frac{ \\var{sumr[t]}}{\\var{n}}=\\var{ans[0]}$ to 3 decimal places.
\n\n
2)
\nThe total number of {things}s who are {drk} is $\\var{tc[u]}$ hence the probability that a random {things} from this survey is {drk} is $\\displaystyle \\frac{ \\var{tc[u]}}{\\var{n}}=\\var{ans[1]}$ to 3 decimal places.
\n\n
3)
\nLooking at the table there are $\\var{ve}$ {things}s that are {oneof}. Hence the probability is $\\displaystyle \\frac{ \\var{ve}}{\\var{n}}=\\var{ans[2]}$ to 3 decimal places.
\n\n
4)
\nThese are the {things}s that are not {drk}, and hence there are $\\var{n}-\\var{tc[u]}=\\var{n-tc[u]}$ of them (see answer to part b)), and the probability of randomly selecting one is $\\displaystyle \\frac{ \\var{n-tc[u]}}{\\var{n}}=\\var{ans[3]}$ to 3 decimal places.
\n\n
5)
\nLooking at the table we see that the number corresponding to {catattrib1} is $\\var{ce1}$. Hence the probability of randomly selecting one is $\\displaystyle \\frac{ \\var{ce1}}{\\var{n}}=\\var{ans[4]}$ to 3 decimal places.
\n6)
\nAs in the last question, looking at the table we see that the number corresponding to {catattrib2} is $\\var{ce2}$. Hence the probability of randomly selecting one is $\\displaystyle \\frac{ \\var{ce2}}{\\var{n}}=\\var{ans[5]}$ to 3 decimal places.
\n\n
7)
\nWe know from question a) that the probability of selecting a {somecat} {things} is, $\\displaystyle \\frac{ \\var{sumr[t]}}{\\var{n}}$, after this we now have $\\var{sumr[t]-1} $ {somecat} {things}s amongst the $\\var{n-1}$ left, and the probability of yet again selecting one of these is $\\displaystyle \\frac{ \\var{sumr[t]-1}}{\\var{n-1}}$. So the probability of selecting two is $\\displaystyle \\frac{ \\var{sumr[t]}}{\\var{n}} \\times \\frac{ \\var{sumr[t]-1}}{\\var{n-1}}=\\var{ans[6]}$ to 3 decimal places.
\n\n8)
\nThe probability of selecting a {things} who is {drk1} is $\\displaystyle \\frac{ \\var{tc[u1]}}{\\var{n}}$, after this we now have $\\var{tc[u1]-1}$ {drk1} {things}s amongst the $\\var{n-1}$ left, and the probability of yet again selecting one of these is $\\displaystyle \\frac{ \\var{tc[u1]-1}}{\\var{n-1}}$. So the probability of selecting two is $\\displaystyle \\frac{ \\var{tc[u1]}}{\\var{n}}\\times \\frac{\\var{tc[u1]-1}}{\\var{n-1}}=\\var{ans[7]}$ to 3 decimal places.
\n\n9)
\nSince there are $\\var{r[t][u]}$ {somecat} {things}s from the $\\var{tc[u]}$ {things}s that are {drk} the probability of selecting one is $\\displaystyle \\frac{\\var{r[t][u]}}{\\var{tc[u]}}= \\var{ans[8]}$ to 3 decimal places.
\n", "functions": {"norm": {"type": "list", "language": "javascript", "parameters": [["a", "list"], ["x", "number"], ["n", "number"]], "definition": "\n var b=a;\n var s=-b[x];\n for(i=0;i