// 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:

\n

1)  P(is {somecat}) = [[0]]

\n

2)  P(is {drk}) = [[1]]

\n

3)  P(is either {oneof}) = [[2]]

\n

4)  P({drkpair}) = [[3]]

\n

5)  P({catattrib1}) = [[4]]

\n

6)  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):

\n

7)  P(both {somecat}) =  [[0]]

\n

8)  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:

\n

9)  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.

\n

You can configure the rest.

\n

rebelmaths

"}, "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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
{Cats}{At[0]}{At[1]}{At[2]}Total
{cat[0]}{r[0][0]}{r[0][1]}{r[0][2]}{sumr[0]}
{cat[1]}{r[1][0]}{r[1][1]}{r[1][2]}{sumr[1]}
{cat[2]}{r[2][0]}{r[2][1]}{r[2][2]}{sumr[2]}
{cat[3]}{r[3][0]}{r[3][1]}{r[3][2]}{sumr[3]}
Totals{tc[0]}{tc[1]}{tc[2]}\n

{tot}

\n
\n

Give all answers correct to 3 decimal places (not in fraction form).

", "variable_groups": [], "advice": "

1)

\n

The 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)

\n

The 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)

\n

Looking 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)

\n

These 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)

\n

Looking 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.

\n

6)

\n

As 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)

\n

We 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

\n

8)

\n

The 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

\n

9)

\n

Since 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