// Numbas version: finer_feedback_settings {"name": "Luis's copy of Set builder notation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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": [], "functions": {}, "question_groups": [{"name": "", "pickQuestions": 0, "pickingStrategy": "all-ordered", "questions": []}], "variables": {"a1": {"group": "Ungrouped variables", "definition": "random(2..6 except a)", "templateType": "anything", "description": "", "name": "a1"}, "c2": {"group": "Ungrouped variables", "definition": "random(4..10)", "templateType": "anything", "description": "", "name": "c2"}, "a": {"group": "Ungrouped variables", "definition": "random(2..6)", "templateType": "anything", "description": "", "name": "a"}, "b1": {"group": "Ungrouped variables", "definition": "random(6..10 except b)", "templateType": "anything", "description": "", "name": "b1"}, "ans2": {"group": "Ungrouped variables", "definition": "ans1 and set(1..b)", "templateType": "anything", "description": "", "name": "ans2"}, "ans4": {"group": "Ungrouped variables", "definition": "ans3 and set(1..floor((c1+b1)/a1))", "templateType": "anything", "description": "", "name": "ans4"}, "ans1": {"group": "Ungrouped variables", "definition": "set(a*ceil((c-b)/a)-c..a*floor((c+b)/a)-c#a)", "templateType": "anything", "description": "", "name": "ans1"}, "b3": {"group": "Ungrouped variables", "definition": "random(2..12)", "templateType": "anything", "description": "", "name": "b3"}, "c3": {"group": "Ungrouped variables", "definition": "random(6..10)", "templateType": "anything", "description": "", "name": "c3"}, "ans3": {"group": "Ungrouped variables", "definition": "set(ceil((c1-b1)/a1)..floor((c1+b1)/a1))", "templateType": "anything", "description": "", "name": "ans3"}, "c": {"group": "Ungrouped variables", "definition": "random(3..8)", "templateType": "anything", "description": "", "name": "c"}, "b": {"group": "Ungrouped variables", "definition": "random(2..10)", "templateType": "anything", "description": "", "name": "b"}, "a3": {"group": "Ungrouped variables", "definition": "random(2..15)", "templateType": "anything", "description": "", "name": "a3"}, "a2": {"group": "Ungrouped variables", "definition": "random(2..6)", "templateType": "anything", "description": "", "name": "a2"}, "g": {"group": "Ungrouped variables", "definition": "gcd(a3,b3)", "templateType": "anything", "description": "", "name": "g"}, "b2": {"group": "Ungrouped variables", "definition": "random(2..12)", "templateType": "anything", "description": "", "name": "b2"}, "c1": {"group": "Ungrouped variables", "definition": "random(3..6 except c)", "templateType": "anything", "description": "", "name": "c1"}}, "name": "Luis's copy of Set builder notation", "ungrouped_variables": ["a", "b", "c", "ans1", "ans2", "a1", "b1", "c1", "ans3", "ans4", "a2", "b2", "c2", "a3", "b3", "c3", "g"], "variable_groups": [], "type": "question", "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": "200", "condition": "gcd(a2,b2)=1 and gcd(a3,b3)<>1"}, "metadata": {"description": "

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

", "notes": "", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "parts": [{"type": "gapfill", "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": [{"variableReplacements": [], "checkvariablenames": false, "vsetrangepoints": 5, "expectedvariablenames": [], "variableReplacementStrategy": "originalfirst", "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrange": [0, 1], "scripts": {}, "answer": "{ans1}", "showCorrectAnswer": true, "checkingtype": "absdiff"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0}, {"type": "gapfill", "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": [{"variableReplacements": [], "checkvariablenames": false, "vsetrangepoints": 5, "expectedvariablenames": [], "variableReplacementStrategy": "originalfirst", "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrange": [0, 1], "scripts": {}, "answer": "{ans2}", "showCorrectAnswer": true, "checkingtype": "absdiff"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0}, {"type": "gapfill", "prompt": "

$S_3=\\{x\\;|\\; x \\in \\mathbb{Z}\\text{ and }\\;|\\;\\var{a1}x-\\var{c1}\\;| \\leq \\var{b1}\\}$.

\n

$S_3=\\;$[[0]]

", "scripts": {}, "gaps": [{"variableReplacements": [], "checkvariablenames": false, "vsetrangepoints": 5, "expectedvariablenames": [], "variableReplacementStrategy": "originalfirst", "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrange": [0, 1], "scripts": {}, "answer": "{ans3}", "showCorrectAnswer": true, "checkingtype": "absdiff"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0}, {"type": "gapfill", "prompt": "

$S_4=\\{x\\;|\\; x \\in \\mathbb{N}\\text{ and }\\;|\\;\\var{a1}x-\\var{c1}\\;|\\; \\leq \\var{b1}\\}$.

\n

$S_4=\\;$[[0]]

", "scripts": {}, "gaps": [{"variableReplacements": [], "checkvariablenames": false, "vsetrangepoints": 5, "expectedvariablenames": [], "variableReplacementStrategy": "originalfirst", "marks": 1, "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrange": [0, 1], "scripts": {}, "answer": "{ans4}", "showCorrectAnswer": true, "checkingtype": "absdiff"}], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0}], "rulesets": {}, "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/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Luis Hernandez", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2870/"}]}