// Numbas version: finer_feedback_settings {"name": "Union, complement, intersection", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"showQuestionGroupNames": false, "name": "Union, complement, intersection", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "
Given some random finite subsets of the natural numbers, perform set operations $\\cap,\\;\\cup$ and complement.
"}, "statement": "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", "functions": {"mod_set": {"type": "list", "parameters": [["a", "number"], ["b", "number"], ["c", "number"]], "language": "javascript", "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]]
\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).