// Numbas version: exam_results_page_options {"name": "Probability -- choosing digits with replacement - highest digit", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["d", "ans1", "k", "r", "t", "tol", "tans1", "ans2", "tans2"], "name": "Probability -- choosing digits with replacement - highest digit", "tags": ["counting", "cr1", "elementary probability", "probabilities", "Probability", "probability", "random", "replacement", "sample space", "selection from sets", "selection with replacement", "sets", "statistics", "tested1", "urn model"], "preamble": {"css": "", "js": ""}, "advice": "\n

a) There are $\\var{d+1}$ different digits and so there are $\\var{d+1}^{\\var{r}}=\\var{(d+1)^r}$ different seqences of length $\\var{r}$.

\n

However, if we consider sequences in which the digits do not exceed $\\var{k}$ ,

\n

then there are $\\var{k+1}$ different possible digits in the sequence, and so there are $\\var{k+1}^{\\var{r}}=\\var{(k+1)^r}$ possible sequences.

\n

So \\[\\begin{eqnarray*} \\mbox{Probability} &=& \\frac{\\mbox{number of successes}}{\\mbox{number of trials}}\\\\ &=& \\frac{\\var{(k+1)^r}}{\\var{(d+1)^r}}\\\\ &=& \\var{ans1} \\end{eqnarray*} \\] to $3$ decimal places.

\n

b) Number $N$ of sequences with largest digit $\\var{k}$ is given by:

\n

\\[\\begin{eqnarray*} N &=&\\mbox{number with largest digit}\\;\\le \\var{k} - \\mbox{number with largest digit}\\;\\le\\var{k-1} \\\\ &=& \\var{k+1}^{\\var{r}}-\\var{k}^{\\var{r}}\\\\ &=& \\var{(k+1)^r}-\\var{k^r}\\\\ &=& \\var{(k+1)^r-k^r}\\\\ \\mbox{So probability} &=& \\frac{\\mbox{number of successes}}{\\mbox{number of trials}} =\\frac{N}{\\mbox{number of trials}}\\\\ &=& \\frac{\\var{(k+1)^r-k^r}}{\\var{(d+1)^r}}\\\\ &=& \\var{ans2} \\end{eqnarray*} \\] to $3$ decimal places.

\n ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n

No digit in the sequence exceeds $\\var{k}$?

\n

Probability =[[0]]? (to $3$ decimal places)

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

The largest digit in the sequence is $\\var{k}$?

\n

Probability =[[0]]? (to $3$ decimal places)

\n ", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "{ans2+tol}", "minValue": "{ans2-tol}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "\n

Suppose a sequence of $\\var{r}$ digits is picked at random (with replacement) from the set
\\[\\{0,\\;1,\\;2,\\ldots,\\;\\var{d}\\}\\]

\n

What is the probability that:

\n ", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"d": {"definition": "random(7,8,9)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "ans1": {"definition": "precround(tans1,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}, "k": {"definition": "switch(d=7, random(4..6),d=8,random(5..7),random(6..8))", "templateType": "anything", "group": "Ungrouped variables", "name": "k", "description": ""}, "r": {"definition": "random(5..12)", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}, "t": {"definition": "random(0..100)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "tol": {"definition": "0.001", "templateType": "anything", "group": "Ungrouped variables", "name": "tol", "description": ""}, "tans1": {"definition": "((k+1)/(d+1))^r", "templateType": "anything", "group": "Ungrouped variables", "name": "tans1", "description": ""}, "ans2": {"definition": "precround(tans2,3)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "tans2": {"definition": "tans1-(k/(d+1))^r", "templateType": "anything", "group": "Ungrouped variables", "name": "tans2", "description": ""}}, "metadata": {"description": "

r digits are picked at random (with replacement) from the set $\\{0,\\;1,\\;2,\\ldots,\\;n\\}$. Probabilities that 1) all $\\lt k$, 2) largest is $k$?

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}