// Numbas version: exam_results_page_options {"name": "Absorb to a or -b when p = q", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Absorb to a or -b when p = q", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

Consider a simple random walk with absorbing barriers at both $a=\\var{a}$ and $-b = \\var{b}$.

\n

If we start in state $\\var{j}$ with $p=\\var{p}$ and $q=\\var{p}$.

\n

Find the following to three decimal places:

", "advice": "

The formula for absorbing to state $a$ with absorbing bariers at both $a$ and $-b$ and $p=q$ is:

\n

\\[p_j = \\frac{j+b}{a+b}\\]

\n

The formula for absorbing to state $-b$ with absorbing bariers at both $a$ and $-b$ and $p=q$ is:

\n

\\[1-p_j = \\frac{a-j}{a+b}\\]

\n

For this situation, the second expression is just one minus the first expression.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(5..10)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5..(a-2))", "description": "", "templateType": "anything", "can_override": false}, "j": {"name": "j", "group": "Ungrouped variables", "definition": "if(b<0, random(0..(a-1)), random((b+1)..(a-1)))", "description": "", "templateType": "anything", "can_override": false}, "p": {"name": "p", "group": "Ungrouped variables", "definition": "random(1..50)/100", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "p", "description": "", "templateType": "anything", "can_override": false}, "pj": {"name": "pj", "group": "Ungrouped variables", "definition": "(j-b)/(a-b)", "description": "", "templateType": "anything", "can_override": false}, "qj": {"name": "qj", "group": "Ungrouped variables", "definition": "1-pj", "description": "", "templateType": "anything", "can_override": false}, "ratio": {"name": "ratio", "group": "Ungrouped variables", "definition": "q/p", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "and(p=q, not((p+q)>1))", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "j", "p", "q", "pj", "qj", "ratio"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {"mark": {"script": "// Reveal answers, score and advice\nthis.display.revealAnswer();\nthis.display.showScore();\nNumbas.controls.getAdvice();", "order": "before"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

What is the probability of absorbing to state $a$: $p_j =$[[0]]

\n

What is the probability of absorbing to state $-b$: $1-p_j =$[[1]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{pj}", "showPreview": true, "checkingType": "dp", "checkingAccuracy": 3, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{qj}", "showPreview": true, "checkingType": "dp", "checkingAccuracy": 3, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Chris Drovandi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/9840/"}, {"name": "adam bretherton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18177/"}]}]}], "contributors": [{"name": "Chris Drovandi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/9840/"}, {"name": "adam bretherton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18177/"}]}