// Numbas version: finer_feedback_settings {"name": "Set builder notation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "gcd(a2,b2)=1 and gcd(a3,b3)<>1", "maxRuns": "200"}, "variables": {"a1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..6 except a)", "name": "a1", "description": ""}, "ans2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "ans1 and set(1..b)", "name": "ans2", "description": ""}, "ans3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "set(ceil((c1-b1)/a1)..floor((c1+b1)/a1))", "name": "ans3", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..6)", "name": "a", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(3..8)", "name": "c", "description": ""}, "b1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(6..10 except b)", "name": "b1", "description": ""}, "ans1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "set(a*ceil((c-b)/a)-c..a*floor((c+b)/a)-c#a)", "name": "ans1", "description": ""}, "b2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..12)", "name": "b2", "description": ""}, "b3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..12)", "name": "b3", "description": ""}, "ans4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "ans3 and set(1..floor((c1+b1)/a1))", "name": "ans4", "description": ""}, "c2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(4..10)", "name": "c2", "description": ""}, "c1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(3..6 except c)", "name": "c1", "description": ""}, "a3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..15)", "name": "a3", "description": ""}, "c3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(6..10)", "name": "c3", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..10)", "name": "b", "description": ""}, "g": {"group": "Ungrouped variables", "templateType": "anything", "definition": "gcd(a3,b3)", "name": "g", "description": ""}, "a2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..6)", "name": "a2", "description": ""}}, "ungrouped_variables": ["a", "b", "c", "ans1", "ans2", "a1", "b1", "c1", "ans3", "ans4", "a2", "b2", "c2", "a3", "b3", "c3", "g"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Set builder notation", "functions": {}, "variable_groups": [], "showQuestionGroupNames": false, "parts": [{"prompt": "
$S_1=\\{y\\;|\\;y \\in \\mathbb{Z}, y=\\var{a}x-\\var{c},\\;x \\in \\mathbb{Z}\\text{ and } |y| \\leq \\var{b}\\}$
\n$S_1 = \\;$[[0]]
", "scripts": {}, "gaps": [{"answer": "{ans1}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "$S_2=\\{y\\;|\\;y \\in \\mathbb{N}, y=\\var{a}x-\\var{c},\\;x \\in \\mathbb{Z}\\text{ and } |y| \\leq \\var{b}\\}$
\n$S_2 = \\;$[[0]]
", "scripts": {}, "gaps": [{"answer": "{ans2}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "$S_3=\\{x\\;|\\; x \\in \\mathbb{Z}\\text{ and }\\;|\\;\\var{a1}x-\\var{c1}\\;| \\leq \\var{b1}\\}$.
\n$S_3=\\;$[[0]]
", "scripts": {}, "gaps": [{"answer": "{ans3}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}, {"prompt": "$S_4=\\{x\\;|\\; x \\in \\mathbb{N}\\text{ and }\\;|\\;\\var{a1}x-\\var{c1}\\;|\\; \\leq \\var{b1}\\}$.
\n$S_4=\\;$[[0]]
", "scripts": {}, "gaps": [{"answer": "{ans4}", "showCorrectAnswer": true, "vsetrange": [0, 1], "checkingaccuracy": 0.001, "checkvariablenames": false, "expectedvariablenames": [], "showpreview": true, "checkingtype": "absdiff", "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 1, "vsetrangepoints": 5}], "type": "gapfill", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0}], "statement": "Enumerate each of the following sets.
\nNote that you input sets in the form set(a,b,c,d)
.
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).
Notation set(a..b)
and set(a,b,c)
cannot be mixed. For example set(a..b,c)
will not be processed as expected.
Enumerate the elements in some sets defined using set builder notation.
"}, "advice": "We can construct this set by reading the conditions, from left to right.
\nFirst of all, every elemnt of $S_1$ is in $\\mathbb{Z}$, the set of integers. This is the set $\\{\\dots,-3,-2,1,0,1,2,3,\\dots\\}$.
\nNext, it must be possible to write $y$ in the form $\\simplify[]{{a}x-{c}}$, where $x$ is an integer. This is the set $\\{\\dots,\\var{-2*a-c},\\var{-1*a-c},\\var{-c},\\var{a-c},\\var{2*a-c},\\var{3*a-c},\\dots\\}$.
\nFinally, the set only includes the numbers listed above which lie between $-\\var{b}$ and $+\\var{b}$, i.e. $\\var{ans1}$.
\nThis set is the same as the one above, except $y$ is drawn from $\\mathbb{N}$, the natural numbers. That means that only values greater than or equal to $1$ are included.
\n$x$ is drawn from the set of integers $\\mathbb{Z} = \\{\\dots,-2,-1,0,1,2,\\dots\\}$.
\nIf $\\left\\lvert \\simplify[]{{a1}x-{c1}} \\right\\rvert \\leq \\var{b1}$, then
\n\\begin{align}
\\var{a1}x &\\geq \\var{-b1} + \\var{c1} = \\var{-b1+c1} \\\\
&\\text{and} \\\\
\\var{a1}x &\\leq \\var{b1}+\\var{c1} = \\var{b1+c1}
\\end{align}
Equivalently,
\n\\begin{align}
x &\\geq \\simplify{{-b1+c1}/{a1}} \\\\
&\\text{and} \\\\
x &\\leq \\simplify{{b1+c1}/{a1}}
\\end{align}
So $S_3 = \\var{ans3}$.
\nThis set is the same as the one above, except $x$ is drawn from the set of natural numbers $\\mathbb{N} = \\{1,2,3,\\dots\\}$, so only values greater than or equal to $1$ are included.
", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}