// Numbas version: exam_results_page_options {"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.

\n

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

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

\n

Notation set(a..b) and set(a,b,c) cannot be mixed. For example set(a..b,c) will not be processed as expected.

", "tags": [], "rulesets": {}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "

Enumerate the elements in some sets defined using set builder notation.

"}, "advice": "

a)

\n

We can construct this set by reading the conditions, from left to right.

\n

First 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\\}$.

\n

Next, 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\\}$.

\n

Finally, the set only includes the numbers listed above which lie between $-\\var{b}$ and $+\\var{b}$, i.e. $\\var{ans1}$.

\n

b)

\n

This 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

c)

\n

$x$ is drawn from the set of integers $\\mathbb{Z} = \\{\\dots,-2,-1,0,1,2,\\dots\\}$.

\n

If $\\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}

\n

Equivalently,

\n

\\begin{align}
x &\\geq \\simplify{{-b1+c1}/{a1}} \\\\
&\\text{and} \\\\
x &\\leq \\simplify{{b1+c1}/{a1}}
\\end{align}

\n

\n

So $S_3 = \\var{ans3}$.

\n

d)

\n

This 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/"}]}