// Numbas version: finer_feedback_settings {"name": "Michael's copy of 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": [{"name": "Michael's copy of Probability -- choosing digits with replacement - highest digit", "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 ", "tags": [], "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 ", "functions": {}, "extensions": [], "ungrouped_variables": ["d", "ans1", "k", "r", "t", "tol", "tans1", "ans2", "tans2", "test"], "preamble": {"js": "", "css": ""}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "prompt": "\n

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

\n

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

\n ", "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "correctAnswerStyle": "plain", "allowFractions": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "{ans1+tol}", "type": "numberentry", "minValue": "{ans1-tol}", "unitTests": [], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0}]}, {"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "prompt": "\n

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

\n

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

\n ", "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "correctAnswerStyle": "plain", "allowFractions": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "mustBeReduced": false, "correctAnswerFraction": false, "notationStyles": ["plain", "en", "si-en"], "maxValue": "{ans2+tol}", "type": "numberentry", "minValue": "{ans2-tol}", "unitTests": [], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0}]}, {"marks": 0, "customMarkingAlgorithm": "", "variableReplacements": [], "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"marks": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "type": "extension", "extendBaseMarkingAlgorithm": true, "unitTests": [], "scripts": {}, "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}]}], "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "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$?

"}, "variables": {"tol": {"name": "tol", "group": "Ungrouped variables", "description": "", "definition": "0.001", "templateType": "anything"}, "ans1": {"name": "ans1", "group": "Ungrouped variables", "description": "", "definition": "precround(tans1,3)", "templateType": "anything"}, "tans2": {"name": "tans2", "group": "Ungrouped variables", "description": "", "definition": "tans1-(k/(d+1))^r", "templateType": "anything"}, "r": {"name": "r", "group": "Ungrouped variables", "description": "", "definition": "random(5..12)", "templateType": "anything"}, "k": {"name": "k", "group": "Ungrouped variables", "description": "", "definition": "switch(d=7, random(4..6),d=8,random(5..7),random(6..8))", "templateType": "anything"}, "tans1": {"name": "tans1", "group": "Ungrouped variables", "description": "", "definition": "((k+1)/(d+1))^r", "templateType": "anything"}, "test": {"name": "test", "group": "Ungrouped variables", "description": "", "definition": "'\\\\mathbb\\{R\\}'", "templateType": "anything"}, "t": {"name": "t", "group": "Ungrouped variables", "description": "", "definition": "random(0..100)", "templateType": "anything"}, "ans2": {"name": "ans2", "group": "Ungrouped variables", "description": "", "definition": "precround(tans2,3)", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "description": "", "definition": "random(7,8,9)", "templateType": "anything"}}, "type": "question", "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}, {"name": "Michael Hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1625/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}, {"name": "Michael Hoffmann", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1625/"}]}