// Numbas version: exam_results_page_options {"name": "Calculate probability of either of two events occurring based on frequency", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Calculate probability of either of two events occurring based on frequency", "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

Out of $\\var{ptotal}$ people, $\\var{p1}$ play Go, $\\var{p2}$ play Chess, $\\var{p3}$ play both, and $\\var{p4}$ play neither.

\n

", "tags": [], "metadata": {"description": "

Example showing how to calculate the probability of A or B using the law $p(A \\;\\textrm{or}\\; B)=p(A)+p(B)-p(A\\;\\textrm{and}\\;B)$. 

\n

Easily adapted to other applications.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"customMarkingAlgorithm": "", "marks": "1.5", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans1}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a person selected at random plays Go. Write your answer as a fraction.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}, {"customMarkingAlgorithm": "", "marks": "3", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans2}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a randomly selected person plays Chess or Go. Give your answer as a fraction.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}, {"customMarkingAlgorithm": "", "marks": "4.5", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "useCustomName": false, "failureRate": 1, "vsetRange": [0, 1], "scripts": {}, "showFeedbackIcon": true, "vsetRangePoints": 5, "answer": "{ans3}", "showPreview": true, "customName": "", "checkVariableNames": false, "unitTests": [], "type": "jme", "prompt": "

Calculate the probability that a randomly selected person plays Chess but not Go.

", "showCorrectAnswer": true, "checkingAccuracy": 0.001, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "valuegenerators": []}], "ungrouped_variables": ["p1", "p3", "p2", "p4", "ptotal", "ans1", "ans2", "ans3"], "advice": "", "functions": {}, "variables": {"p4": {"description": "", "templateType": "anything", "definition": "random(10..40)", "name": "p4", "group": "Ungrouped variables"}, "ptotal": {"description": "", "templateType": "anything", "definition": "p1+p2-p3+p4", "name": "ptotal", "group": "Ungrouped variables"}, "p1": {"description": "", "templateType": "anything", "definition": "random(40..70)", "name": "p1", "group": "Ungrouped variables"}, "p2": {"description": "", "templateType": "anything", "definition": "random(30..50)", "name": "p2", "group": "Ungrouped variables"}, "p3": {"description": "", "templateType": "anything", "definition": "random(10..25)", "name": "p3", "group": "Ungrouped variables"}, "ans2": {"description": "", "templateType": "anything", "definition": "1-(p4/ptotal)", "name": "ans2", "group": "Ungrouped variables"}, "ans3": {"description": "", "templateType": "anything", "definition": "(p2-p3)/ptotal", "name": "ans3", "group": "Ungrouped variables"}, "ans1": {"description": "", "templateType": "anything", "definition": "p1/ptotal", "name": "ans1", "group": "Ungrouped variables"}}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "extensions": [], "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}