// Numbas version: exam_results_page_options {"name": "Simon's copy of Basic Set Theory: element not in a set", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"css": "", "js": ""}, "tags": [], "extensions": [], "advice": "

The first thing to note is that $Y \\subseteq X$. You need to prove that for every $y \\in Y$ that $y \\in X$. Essentially you have to prove an infinite amount of stuff here, and we do this by taking a generic element of $Y$ and proving that it also belongs to $X$.

\n

If $y \\in Y$ then $y$ has the shape $y = \\var{c}k + \\var{d}$ for some $k \\in \\mathbb Z$. We need to show that it also has the shape $\\var{a}n + \\var{b}$ for some integer $n$ and so belongs to $X$ as well.

\n

$\\begin{align*} y & = \\var{c} k + \\var{d} \\\\ & = \\var{a}\\times\\var{u} k + \\var{a} + \\var{b} \\\\ & = \\var{a}(\\var{u} k + 1) + \\var{b} \\\\ & = \\var{a}n + \\var{b}. \\end{align*}$

\n

where $n = (\\var{u}k+1) \\in \\mathbb Z$. Because $y$ has the required shape, $y=\\var{a}n + \\var{b}$ for some integer $n$, it is also an element of $X$. So $y \\in X$.

\n

So for this part of this question you can choose any element of $Y$. All of them will automatically be included in $X$.

\n
\n

For the second question you need to find an element of $X$ which which is not an element of $Y$. This does not require an infinite amount of work - all you need is one element of $X$ which is not in $Y$. The easiest way to proceede is to just try a few different values of $X$. A more systematic approach is to try the procedure above and see where it goes wrong.

\n
\n

By definition the sets $X$ and $Y$ are equal when both $Y\\subseteq X$ and $X \\subseteq Y$ are true. We showed in the first question that the relation $Y\\subseteq X$ is true, but this does not matter much we showed in the second question that $X \\nsubseteq Y$. So the sets are not equal, instead we could say that $X$ is a proper subset of $Y$: $X \\subset Y$.

", "variables": {"d": {"group": "Ungrouped variables", "name": "d", "templateType": "anything", "definition": "a+b", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "templateType": "anything", "definition": "u*b", "description": ""}, "a": {"group": "Ungrouped variables", "name": "a", "templateType": "anything", "definition": "random(2..5)", "description": ""}, "b": {"group": "Ungrouped variables", "name": "b", "templateType": "anything", "definition": "random(6..9)", "description": ""}, "u": {"group": "Ungrouped variables", "name": "u", "templateType": "anything", "definition": "random(2..5)", "description": ""}}, "ungrouped_variables": ["a", "b", "c", "d", "u"], "parts": [{"showPreview": true, "checkVariableNames": false, "unitTests": [], "extendBaseMarkingAlgorithm": true, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar c = unwrap(variables.c);\nvar d = unwrap(variables.d);\n\n// compute its derivative\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (0 == ((ans - d) % c)) { \n // then ans = ck + d for some integer k\n this.setCredit(1,\"This is an element of $Y$. In fact $Y \\\\subseteq X$ so any element of $Y$ is automatically in $X$.\");\n if (ans != d) {\n this.markingComment('By the way, the easiest element to find is $' + d + '$ which is obtained when $k=0$.');\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}\n", "order": "instead"}}, "variableReplacements": [], "answer": "{d}", "type": "jme", "failureRate": 1, "checkingAccuracy": 0.001, "prompt": "

Find an element of $Y$ which is also an element of $X$.

", "checkingType": "absdiff", "marks": 1, "expectedVariableNames": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true}, {"showPreview": true, "checkVariableNames": false, "unitTests": [], "extendBaseMarkingAlgorithm": true, "scripts": {"mark": {"script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\nvar b = unwrap(variables.b);\nvar c = unwrap(variables.c);\nvar d = unwrap(variables.d);\n\n// compute its derivative\nvar tree;\ntry {\n tree = Numbas.jme.compile(this.studentAnswer);\n var ans = unwrap(Numbas.jme.evaluate(tree,this.question.scope));\n \n if (0 == ((ans - b) % a)) { \n // then ans = ck + d for some integer k\n this.setCredit(1,\"This is an element of $X$.\");\n }\n \n if (0 == ((ans - d) % c)) { \n // then ans = ck + d for some integer k\n this.setCredit(0,\"But it is also an element of $Y$.\");\n }\n}\ncatch(e) {\n this.markingComment(e);\n}", "order": "instead"}}, "variableReplacements": [], "answer": "{b}", "type": "jme", "failureRate": 1, "checkingAccuracy": 0.001, "prompt": "

Find an element of $X$ which is not an element of $Y$.

", "checkingType": "absdiff", "marks": 1, "expectedVariableNames": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true}, {"variableReplacements": [], "customMarkingAlgorithm": "", "unitTests": [], "extendBaseMarkingAlgorithm": true, "displayColumns": 0, "maxMarks": 0, "choices": ["

$X \\nsubseteq Y$

", "

$Y \\subseteq X$

"], "type": "1_n_2", "showCorrectAnswer": true, "prompt": "

The sets $X$ and $Y$ are not equal because

", "minMarks": 0, "marks": 0, "displayType": "radiogroup", "matrix": ["1", 0], "showFeedbackIcon": true, "shuffleChoices": false, "showCellAnswerState": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "distractors": ["Yes. All you need to demonstrate is there is one element of $X$ which is not also in $Y$.", "This is true but irrelevant."]}], "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Introductory exercise about subsets using custom grading code.

"}, "rulesets": {}, "statement": "

Consider the sets $X = \\left\\{ \\var{a}n + \\var{b} | n \\in \\mathbb Z\\right\\}$ and $Y = \\left\\{ \\var{c}k  + \\var{d} | k \\in \\mathbb Z\\right\\}$.

", "name": "Simon's copy of Basic Set Theory: element not in a set", "variable_groups": [], "functions": {}, "type": "question", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}