// Numbas version: exam_results_page_options {"name": "Predicates and sets", "feedback": {"showtotalmark": true, "advicethreshold": 0, "showanswerstate": true, "showactualmark": true, "allowrevealanswer": true}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "allQuestions": true, "shuffleQuestions": false, "percentPass": 0, "duration": 0, "pickQuestions": 0, "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "metadata": {"notes": "", "description": "

Various questions on predicates and sets.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "exam", "questions": [], "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Predicates ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["choices", "logic_exp", "t", "mm0", "mm1", "mm2"], "tags": ["logic", "logical expressions", "propositions"], "advice": "", "rulesets": {}, "parts": [{"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[0][0]}' and '{choices[0][1]}'.

", "matrix": "mm0", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[0][2]}", "{choices[0][3]}", "{choices[0][4]}", "{choices[0][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}, {"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[1][0]}' and '{choices[1][1]}'.

", "matrix": "mm1", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[1][2]}", "{choices[1][3]}", "{choices[1][4]}", "{choices[1][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}, {"maxAnswers": 0, "prompt": "

Let $p$ and $q$ denote respectively the propositions '{choices[2][0]}' and '{choices[2][1]}'.

", "matrix": "mm2", "shuffleAnswers": true, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["{logic_exp[0]}", "{logic_exp[1]}", "{logic_exp[2]}", "{logic_exp[3]}", "{logic_exp[4]}", "{logic_exp[5]}", "{logic_exp[6]}", "{logic_exp[7]}", "{logic_exp[8]}"], "choices": ["{choices[2][2]}", "{choices[2][3]}", "{choices[2][4]}", "{choices[2][5]}"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}], "statement": "

Choose the correct logical expression  for the following English sentences.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"mm1": {"definition": "map(map(if(choices[1][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm1", "description": ""}, "mm0": {"definition": "map(map(if(choices[0][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm0", "description": ""}, "mm2": {"definition": "map(map(if(choices[2][6][y]=x,1,0),x,0..8),y,0..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "mm2", "description": ""}, "t": {"definition": "random(0,1,2)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}, "choices": {"definition": "[['It is snowing','I will go skiing',\n 'As it is not snowing I will go skiing.',\n 'It will snow if I don\\'t go skiing.',\n 'I will go skiing if it is snowing.',\n 'It is snowing and I may or may not go skiing.',\n [2,8,4,6,0,1,3,7,5]\n ],\n ['I am working at my studies', 'I am in the library',\n 'I am working at my studies in the library.',\n 'If I use the library then I am working at my studies.',\n 'If I am working at my studies then I am not in the library.',\n 'If I am in the library then I may not be working at my studies.',\n [1,7,0,6,8,2,3,4,5]\n ],\n ['It is sunny','I will carry an umbrella',\n 'If it is not sunny then I will carry an umbrella.',\n 'I carry an umbrella even if it is sunny.',\n 'If it is sunny then I may carry an umbrella.',\n 'If I carry an umbrella then the day always turns out to be sunny!',\n [8,4,6,7,0,1,2,5,3]\n \n]\n \n]", "templateType": "anything", "group": "Ungrouped variables", "name": "choices", "description": ""}, "logic_exp": {"definition": "['$\\\\neg p \\\\lor \\\\neg q$', \n '$p \\\\land q$', \n '$\\\\neg p \\\\land q$',\n '$p \\\\land \\\\neg q$',\n '$p \\\\to q$',\n '$\\\\neg p \\\\land \\\\neg q$',\n '$(p \\\\lor \\\\neg q) \\\\land p$',\n '$q \\\\to p$',\n '$\\\\neg p \\\\to q$'\n ]", "templateType": "anything", "group": "Ungrouped variables", "name": "logic_exp", "description": ""}}, "metadata": {"notes": "", "description": "

Given sentences involving propositions translate into logical expressions.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "set3 ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {"mod_set": {"definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;iEnumerate the following sets:

\n

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

\n

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

\n

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

\n

d) $(\\overline{A} \\cup C) \\cap B=\\;$[[3]]

\n

e) $\\overline{A \\cup C} \\cap \\overline{B}=\\;$[[4]]

\n

f) $(A \\cup \\overline{B}) \\cap C=\\;$[[5]]

\n

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

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{set1 and set2}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{set2 and set3}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{set1 and (universal-set3)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{((universal-set1) or set3) and set2}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{(universal-(set1 or set3)) and (universal-set2)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{(set1 or (universal-set2)) and set3}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "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

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(15..30)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "b+random(10..a-b)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(3..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "random(5..c-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "f": {"definition": "random(2,3,5,6)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "universal": {"definition": "set(1..a)", "templateType": "anything", "group": "Ungrouped variables", "name": "universal", "description": ""}, "set1": {"definition": "set(b..c)", "templateType": "anything", "group": "Ungrouped variables", "name": "set1", "description": ""}, "set2": {"definition": "set(d+1..a)", "templateType": "anything", "group": "Ungrouped variables", "name": "set2", "description": ""}, "set3": {"definition": "set(mod_set(1,a,f))", "templateType": "anything", "group": "Ungrouped variables", "name": "set3", "description": ""}}, "metadata": {"notes": "", "description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "set2 ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["set_list", "a", "b", "c", "choices", "select", "mark_matrix"], "tags": ["elements", "inclusion", "sets", "subsets"], "advice": "", "rulesets": {}, "parts": [{"maxAnswers": 0, "prompt": "

Which of the following statements about the set $A$ are true or false?

", "matrix": "mark_matrix", "shuffleAnswers": false, "minAnswers": 0, "marks": 0, "variableReplacements": [], "answers": ["True", "False"], "choices": ["$\\var{choices[select[0]]}$", "$\\var{choices[select[1]]}$", "$\\var{choices[select[2]]}$", "$\\var{choices[select[3]]}$", "$\\var{choices[select[4]]}$", "$\\var{choices[select[5]]}$", "$\\var{choices[select[6]]}$", "$\\var{choices[select[7]]}$"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "scripts": {}, "warningType": "none", "showCorrectAnswer": true, "type": "m_n_x", "shuffleChoices": true, "minMarks": 0, "layout": {"type": "all", "expression": ""}}], "statement": "

Let $A=\\var{set_list}$

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(1..6 except a)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(1..6 except[a,c])", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "mark_matrix": {"definition": "map([[1,0,1,1,1,0,1,1,0,0,0,0,1,1][y],[0,1,0,0,0,1,0,0,1,1,1,1,0,0][y]],y,select)", "templateType": "anything", "group": "Ungrouped variables", "name": "mark_matrix", "description": ""}, "set_list": {"definition": "set(shuffle([a,latex('\\\\\\{\\\\var{a}\\\\\\}'),b,latex('\\\\\\{\\\\var{c}\\\\\\}'),\nlatex('\\\\\\{\\\\var{b},\\\\var{c}\\\\\\}')]))", "templateType": "anything", "group": "Ungrouped variables", "name": "set_list", "description": ""}, "choices": {"definition": "[latex('\\\\var{a} \\\\in A'),\n latex('\\\\var{a} \\\\subseteq A'),\n latex('\\\\\\{\\\\var{a}\\\\\\} \\\\in A'),\n latex('\\\\\\{\\\\var{a} \\\\\\}\\\\subseteq A'),\n latex('\\\\\\{\\\\\\{\\\\var{a} \\\\\\}\\\\\\}\\\\subseteq A'),\n latex('\\\\var{c} \\\\in A'),\n latex('\\\\\\{\\\\var{c}\\\\\\} \\\\in A'),\n latex('\\\\\\{\\\\\\{\\\\var{c} \\\\\\}\\\\\\}\\\\subseteq A'),\n latex('\\\\\\{\\\\var{b}\\\\\\} \\\\in A'),\n latex('\\\\\\{\\\\\\{\\\\var{b} \\\\\\}\\\\\\}\\\\subseteq A'),\n latex('\\\\\\{\\\\var{a},\\\\var{c}\\\\\\}\\\\subseteq A'),\n latex('\\\\\\{\\\\\\{\\\\var{c} \\\\\\},\\\\\\{\\\\var{b} \\\\\\}\\\\\\}\\\\subseteq A'),\n latex('\\\\\\{\\\\var{c},\\\\var{b} \\\\\\}\\\\in A'),\n latex('\\\\\\{\\\\var{a},\\\\\\{\\\\var{b},\\\\var{c}\\\\\\}\\\\\\} \\\\subseteq A')\n ]", "templateType": "anything", "group": "Ungrouped variables", "name": "choices", "description": ""}, "select": {"definition": "shuffle(list(0..length(choices)-1))[0..8]", "templateType": "anything", "group": "Ungrouped variables", "name": "select", "description": ""}}, "metadata": {"notes": "", "description": "

Given a set $A$, elements of which may also be sets, determine if the given elements or subsets are in $A$.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "set1 ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "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]]

\n

b) $B=\\{x \\in \\mathbb{Z}\\;|\\;\\var{d} \\leq x \\leq \\var{f}\\text{ and } x^2 \\lt \\var{g}\\}$.

\n

$B=\\;$[[1]]

\n

c) $C=\\{x \\in \\mathbb{Z}\\;|\\;\\var{d} \\leq x \\leq \\var{f}\\text{ and } x^2 \\gt \\var{g}\\}$.

\n

$C=\\;$[[2]]

\n

d) $A \\cap C=\\;$[[3]]

\n

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

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

Write the following sets in enumerated form.

\n

Note that you enter an enumerated set such as $\\{35,67,99\\}$ as set(35,67,99).

\n

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "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": {"notes": "", "description": "

Given a set in predicate form i.e. $A=\\{x|P(x)\\}$, find and input the elements of the set.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "set4", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "functions": {}, "ungrouped_variables": ["a", "b", "c", "ans1", "ans2", "a1", "b1", "c1", "ans3", "ans4", "a2", "b2", "c2", "a3", "b3", "c3", "g"], "tags": ["enumerate", "predicates", "sets"], "advice": "", "rulesets": {}, "parts": [{"prompt": "

1) $S=\\{y\\;|\\;y \\in \\mathbb{Z}, y=\\var{a}x-\\var{c},\\;x \\in \\mathbb{Z}\\text{ and } |y| \\leq \\var{b}\\}$

\n

$S\\;$=[[0]]

\n

2) $S=\\{y\\;|\\;y \\in \\mathbb{N}, y=\\var{a}x-\\var{c},\\;x \\in \\mathbb{Z}\\text{ and } |y| \\leq \\var{b}\\}$

\n

$S\\;$=[[1]]

\n

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

\n

$S=\\;$[[2]]

\n

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

\n

$S=\\;$[[3]]

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

1) $S=\\{\\var{a2}a+\\var{b2}b\\;|\\;a,\\;b \\in \\mathbb{Z},\\;|\\var{a2}a+\\var{b2}b\\,|\\lt \\var{c2}\\}$.

\n

$S=\\;$[[0]]

\n

2) $S=\\{\\var{a3}a+\\var{b3}b\\;|\\;a,\\;b \\in \\mathbb{Z},\\;|\\var{a3}a+\\var{b3}b\\,|\\lt \\var{c3}\\}$.

\n

$S=\\;$[[1]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{set(-c2+1..c2-1)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}, {"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "{set(g*ceil((-c3+1)/g)..(c3-1)#g)}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "vsetrange": [0, 1]}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "

Enumerate each of the following sets.

\n

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

", "variable_groups": [], "variablesTest": {"maxRuns": "200", "condition": "gcd(a2,b2)=1 and gcd(a3,b3)<>1"}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "random(2..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(3..8)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(2..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "g": {"definition": "gcd(a3,b3)", "templateType": "anything", "group": "Ungrouped variables", "name": "g", "description": ""}, "ans1": {"definition": "set(a*ceil((c-b)/a)-c..a*floor((c+b)/a)-c#a)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}, "ans2": {"definition": "ans1 and set(1..b)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "ans3": {"definition": "set(ceil((c1-b1)/a1)..floor((c1+b1)/a1))", "templateType": "anything", "group": "Ungrouped variables", "name": "ans3", "description": ""}, "ans4": {"definition": "ans3 and set(1..floor((c1+b1)/a1))", "templateType": "anything", "group": "Ungrouped variables", "name": "ans4", "description": ""}, "a1": {"definition": "random(2..6 except a)", "templateType": "anything", "group": "Ungrouped variables", "name": "a1", "description": ""}, "a3": {"definition": "random(2..15)", "templateType": "anything", "group": "Ungrouped variables", "name": "a3", "description": ""}, "a2": {"definition": "random(2..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "a2", "description": ""}, "b1": {"definition": "random(6..10 except b)", "templateType": "anything", "group": "Ungrouped variables", "name": "b1", "description": ""}, "b2": {"definition": "random(2..12)", "templateType": "anything", "group": "Ungrouped variables", "name": "b2", "description": ""}, "b3": {"definition": "random(2..12)", "templateType": "anything", "group": "Ungrouped variables", "name": "b3", "description": ""}, "c3": {"definition": "random(6..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "c3", "description": ""}, "c2": {"definition": "random(4..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "c2", "description": ""}, "c1": {"definition": "random(3..6 except c)", "templateType": "anything", "group": "Ungrouped variables", "name": "c1", "description": ""}}, "metadata": {"notes": "", "description": "

Enumerate elements of a set given in predicate form.

\n

For example, find all elements of $A=\\{x\\in\\mathbb{Z}\\;|\\;\\;|2x-5|<4\\}$.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}], "extensions": [], "custom_part_types": [], "resources": []}