// Numbas version: exam_results_page_options {"name": "java", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"mod_set": {"definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;iEnumerate the following sets:
\na) $A \\cap B=\\;$[[0]]
\nb) $B \\cap C=\\;$[[1]]
\nc) $A \\cap \\overline{C}=\\;$[[2]]
\nd) $(\\overline{A} \\cup C) \\cap B=\\;$[[3]]
\ne) $\\overline{A \\cup C} \\cap \\overline{B}=\\;$[[4]]
\nf) $(A \\cup \\overline{B}) \\cap C=\\;$[[5]]
\n\nNote that you input sets in the form set(a,b,c,..,z)
.
For example set(1,2,3)
gives the set $\\{1,2,3\\}$.
The empty set is input as set()
.
Also some labour saving tips:
\nIf you want to input all integers between $a$ and $b$ inclusive then instead of writing all the elements you can input this as set(a..b)
.
If you want to input all integers between $a$ and $b$ inclusive in steps of $c$ then this is input as set(a..b#c)
. So all odd integers from $-3$ to $28$ are input as set(-3..28#2).
In this question, the universal set is $\\mathcal{U}=\\{x \\in \\mathbb{N}\\; | \\;x \\leq \\var{a}\\}$.
\nLet:
\n$A=\\{x \\in \\mathbb{N}\\;|\\;\\var{b}\\leq x \\leq \\var{c}\\}$.
\n$B=\\{x \\in \\mathbb{N}\\;|\\;x \\gt \\var{d}\\}$.
\n$C=\\{ x \\in \\mathbb{N}\\;|\\; x \\text{ divisible by } \\var{f}\\}$.
\n\n", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(15..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "b+random(10..a-b)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(3..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "random(5..c-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "f": {"definition": "random(2,3,5,6)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "universal": {"definition": "set(1..a)", "templateType": "anything", "group": "Ungrouped variables", "name": "universal", "description": ""}, "set1": {"definition": "set(b..c)", "templateType": "anything", "group": "Ungrouped variables", "name": "set1", "description": ""}, "set2": {"definition": "set(d+1..a)", "templateType": "anything", "group": "Ungrouped variables", "name": "set2", "description": ""}, "set3": {"definition": "set(mod_set(1,a,f))", "templateType": "anything", "group": "Ungrouped variables", "name": "set3", "description": ""}}, "metadata": {"notes": "", "description": "Given some random finite subsets of the natural numbers, perform set operations $\\cap,\\;\\cup$ and complement.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}]}], "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}