// Numbas version: exam_results_page_options {"name": " Calculate probability of either of two events occurring based on frequency v2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "name": " Calculate probability of either of two events occurring based on frequency v2", "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": [{"showCorrectAnswer": true, "answer": "{ans1}", "showpreview": true, "marks": "1.5", "scripts": {}, "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showFeedbackIcon": true, "checkingaccuracy": 0.001, "type": "jme", "checkingtype": "absdiff", "checkvariablenames": false, "prompt": "

Calculate the probability that a person selected at random uses Facebook. Write your answer as a fraction.

", "vsetrangepoints": 5, "variableReplacements": []}, {"showCorrectAnswer": true, "answer": "{ans2}", "showpreview": true, "marks": "3", "scripts": {}, "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showFeedbackIcon": true, "checkingaccuracy": 0.001, "type": "jme", "checkingtype": "absdiff", "checkvariablenames": false, "prompt": "

Calculate the probability that a randomly selected person uses Facebook or Twitter. Give your answer as a fraction.

", "vsetrangepoints": 5, "variableReplacements": []}, {"showCorrectAnswer": true, "answer": "{ans3}", "showpreview": true, "marks": "4.5", "scripts": {}, "vsetrange": [0, 1], "variableReplacementStrategy": "originalfirst", "expectedvariablenames": [], "showFeedbackIcon": true, "checkingaccuracy": 0.001, "type": "jme", "checkingtype": "absdiff", "checkvariablenames": false, "prompt": "

Calculate the probability that a randomly selected person uses Twitter but not Facebook.

", "vsetrangepoints": 5, "variableReplacements": []}], "rulesets": {}, "statement": "

Out of $\\var{ptotal}$ people, $\\var{p1}$ use Twitter, $\\var{p2}$ use Facebook, $\\var{p3}$ use both, and $\\var{p4}$ use neither.

\n

", "functions": {}, "advice": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "ungrouped_variables": ["p1", "p3", "p2", "p4", "ptotal", "ans1", "ans2", "ans3"], "extensions": [], "preamble": {"css": "", "js": ""}, "variables": {"p4": {"description": "", "definition": "random(10..40)", "group": "Ungrouped variables", "templateType": "anything", "name": "p4"}, "p3": {"description": "", "definition": "random(10..25)", "group": "Ungrouped variables", "templateType": "anything", "name": "p3"}, "p2": {"description": "", "definition": "random(30..50)", "group": "Ungrouped variables", "templateType": "anything", "name": "p2"}, "ans2": {"description": "", "definition": "1-(p4/ptotal)", "group": "Ungrouped variables", "templateType": "anything", "name": "ans2"}, "ans3": {"description": "", "definition": "(p1-p3)/ptotal", "group": "Ungrouped variables", "templateType": "anything", "name": "ans3"}, "ans1": {"description": "", "definition": "p2/ptotal", "group": "Ungrouped variables", "templateType": "anything", "name": "ans1"}, "p1": {"description": "", "definition": "random(40..70)", "group": "Ungrouped variables", "templateType": "anything", "name": "p1"}, "ptotal": {"description": "", "definition": "p1+p2-p3+p4", "group": "Ungrouped variables", "templateType": "anything", "name": "ptotal"}}, "type": "question", "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}]}]}], "contributors": [{"name": "Peter Chapman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/210/"}]}