// Numbas version: exam_results_page_options {"name": "Blathnaid's copy of set3 ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "statement": "

In this question, the universal set is  $\\mathcal{U}=\\{x \\in \\mathbb{N}\\; | \\;x \\leq \\var{a}\\}$.

\n

Let:

\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

", "advice": "", "variable_groups": [], "tags": [], "extensions": [], "name": "Blathnaid's copy of set3 ", "ungrouped_variables": ["a", "b", "c", "d", "f", "universal", "set1", "set2", "set3"], "variables": {"f": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2,3,5,6)", "name": "f", "description": ""}, "d": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..c-1)", "name": "d", "description": ""}, "c": {"templateType": "anything", "group": "Ungrouped variables", "definition": "b+random(10..a-b)", "name": "c", "description": ""}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(15..30)", "name": "a", "description": ""}, "set1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(b..c)", "name": "set1", "description": ""}, "set3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(mod_set(1,a,f))", "name": "set3", "description": ""}, "universal": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(1..a)", "name": "universal", "description": ""}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(3..8)", "name": "b", "description": ""}, "set2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(d+1..a)", "name": "set2", "description": ""}}, "parts": [{"type": "gapfill", "gaps": [{"type": "jme", "showCorrectAnswer": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "answer": "{set1 and set2}", "showFeedbackIcon": true, "marks": 1, "variableReplacements": [], "vsetrangepoints": 5, "expectedvariablenames": [], "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showpreview": true, "variableReplacementStrategy": "originalfirst"}, {"type": "jme", "showCorrectAnswer": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "answer": "{set2 and set3}", "showFeedbackIcon": true, "marks": 1, "variableReplacements": [], "vsetrangepoints": 5, "expectedvariablenames": [], "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showpreview": true, "variableReplacementStrategy": "originalfirst"}, {"type": "jme", "showCorrectAnswer": true, "checkingtype": "absdiff", "scripts": {}, "checkvariablenames": false, "answer": "{set1 and (universal-set3)}", "showFeedbackIcon": true, "marks": 1, "variableReplacements": [], "vsetrangepoints": 5, "expectedvariablenames": [], "vsetrange": [0, 1], "checkingaccuracy": 0.001, "showpreview": true, "variableReplacementStrategy": "originalfirst"}], "showCorrectAnswer": true, "marks": 0, "scripts": {}, "variableReplacements": [], "prompt": "

Enumerate the following sets:

\n

a) $A \\cap B=\\;$[[0]]

\n

b) $B \\cap C=\\;$[[1]]

\n

c) $A \\cap \\overline{C}=\\;$[[2]]

\n

Note that you input sets in the form set(a,b,c,..,z) .

\n

For example set(1,2,3)gives the set $\\{1,2,3\\}$.

\n

The empty set is input as set().

\n

Also some labour saving tips:

\n

If 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).

\n

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).

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Given some random finite subsets of the natural numbers, perform set operations $\\cap,\\;\\cup$ and complement.

"}, "functions": {"mod_set": {"type": "list", "definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;i