// Numbas version: finer_feedback_settings
{"name": "Sets 2-4", "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;ia) $A=\\{x \\in \\mathbb{N}\\;|\\;\\var{a} \\leq x \\leq \\var{b}\\text{ and } x \\text{ is divisible by }\\var{c}\\}$.
\n$A=\\;$[[0]]
\nb) $B=\\{x \\in \\mathbb{Z}\\;|\\;\\var{d} \\leq x \\leq \\var{f}\\text{ and } x^2 \\lt \\var{g}\\}$.
\n$B=\\;$[[1]]
\nc) $C=\\{x \\in \\mathbb{Z}\\;|\\;\\var{d} \\leq x \\leq \\var{f}\\text{ and } x^2 \\gt \\var{g}\\}$.
\n$C=\\;$[[2]]
\nd) $A \\cap C=\\;$[[3]]
\n\nNote that you input sets in the form set(a,b,c,..,z)
.
\nFor example set(1,2,3)
gives the set $\\{1,2,3\\}$.
\nThe empty set is input as set()
.
\nAlso 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)
.
\nIf 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).
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{answer_set1}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{answer_set2}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{answer_set3}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{answer_set4}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "Write the following sets in enumerated form.
\nNote that you enter an enumerated set such as $\\{35,67,99\\}$ as set(35,67,99)
.
\n", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(8..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(3..7)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "a+random(12..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "random(-25..-5)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "g": {"definition": "r^2", "templateType": "anything", "group": "Ungrouped variables", "name": "g", "description": ""}, "f": {"definition": "random(10..25)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "answer_set4": {"definition": "answer_set1 and answer_set3", "templateType": "anything", "group": "Ungrouped variables", "name": "answer_set4", "description": ""}, "answer_set2": {"definition": "set(-r+1..r-1)and set(d..f)", "templateType": "anything", "group": "Ungrouped variables", "name": "answer_set2", "description": ""}, "answer_set3": {"definition": "set(d..f) and(set(d-1..-r-1) or set(r+1..f+1))", "templateType": "anything", "group": "Ungrouped variables", "name": "answer_set3", "description": ""}, "answer_set1": {"definition": "set(mod_set(a,b,c))", "templateType": "anything", "group": "Ungrouped variables", "name": "answer_set1", "description": ""}, "r": {"definition": "random(8..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "r", "description": ""}}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}]}], "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}