// Numbas version: finer_feedback_settings
{"name": "Elias Jakobus's copy of Find probabilities from 2D frequency table, ", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"norm": {"definition": "\n var b=a;\n var s=-b[x];\n for(i=0;i
\n
2) 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) 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) 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)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.
\n6) 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) 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]}\\times \\var{sumr[t]-1}}{\\var{n}\\times\\var{n-1}}=\\var{ans[6]}$ to 3 decimal places.
\n8) 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]}\\times \\var{tc[u1]-1}}{\\var{n}\\times\\var{n-1}}=\\var{ans[7]}$ to 3 decimal places.
\n9) 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.
\n10) Since there are $\\var{we2}$ {othercats} {things}s from the $\\var{tc[u]}$ {things}s that are {drk} the probability of selecting one is $\\displaystyle \\frac{\\var{we2}}{\\var{tc[u]}}= \\var{ans[9]}$ to 3 decimal places.
\n ", "rulesets": {}, "parts": [{"prompt": "\nFind the following probabilities that a randomly chosen {things} involved in this survey:(Enter all probabilities to 3 decimal places).
\n1) is {somecat}: Probability =? [[0]]
\n2) is {drk}: Probability = ? [[1]]
\n3) is either {oneof}: Probability =? [[2]]
\n4) {drkpair}: Probability =? [[3]]
\n5) {catattrib1}: Probability =? [[4]]
\n6) {catattrib2}: Probability=? [[5]]
\n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "ans[0]", "minValue": "ans[0]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[1]", "minValue": "ans[1]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[2]", "minValue": "ans[2]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[3]", "minValue": "ans[3]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[4]", "minValue": "ans[4]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[5]", "minValue": "ans[5]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "\nFind the probability (to 3 decimal places) that two randomly selected {things}s in this survey are
\n7) both {somecat}: Probability = ? [[0]]
\n8) both {drk1}: Probability =? [[1]]
\n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "ans[6]", "minValue": "ans[6]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[7]", "minValue": "ans[7]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "\nGiven that a randomly selected {things} in this survey is {drk}, what is the probability that he:
\n9) is {somecat}: Probability = ? [[0]]
\n10) is {othercats}: Probability =? [[1]]
\n\n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "ans[8]", "minValue": "ans[8]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "ans[9]", "minValue": "ans[9]", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": ["stats"], "statement": "
A survey was conducted to obtain information on {this}. A random sample of {things}s gave :
\n\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{tot} | \n
Finding probabilities from a survey giving a table of data on the alcohol consumption of males. This can be easily adapted to data from other types of surveys.
", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Elias Jakobus Willemse", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/846/"}]}]}], "contributors": [{"name": "Elias Jakobus Willemse", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/846/"}]}