// Numbas version: exam_results_page_options {"name": "Elements in sets, subsets", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "

a) In fact $Y \\subseteq X$, so that any element of $Y$ will also be an element of $X$. 

\n

\n

\n
\n

b) Here 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$. 

\n
\n

c) $Y \\subseteq X$ is true. The question does not ask you to prove this, but this is how you would proceed if it did.

\n

You need to prove that for every $y \\in Y$ ,  $y \\in X$.

\n

$Y$ is an infinite set so you cannot check each element individually but you can take a general element of $Y$ and prove 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$. So

\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 = \\var{a}n + \\var{b}$ for some integer $n$, it is also an element of $X$.

\n

$ X \\nsubseteq Y$ is also true. You have already shown this in part b, by finding an element of $X$ that is not in $Y$.

\n

\n

Note that these results mean that the sets are not equal and that $X$ is a proper subset of $Y$: $X \\subset Y$.

", "variable_groups": [], "variables": {"a": {"name": "a", "templateType": "anything", "description": "", "definition": "random(2..5)", "group": "Ungrouped variables"}, "d": {"name": "d", "templateType": "anything", "description": "", "definition": "a+b", "group": "Ungrouped variables"}, "b": {"name": "b", "templateType": "anything", "description": "", "definition": "random(6..9)", "group": "Ungrouped variables"}, "c": {"name": "c", "templateType": "anything", "description": "", "definition": "u*a", "group": "Ungrouped variables"}, "u": {"name": "u", "templateType": "anything", "description": "", "definition": "random(2..5)", "group": "Ungrouped variables"}}, "functions": {}, "preamble": {"css": "", "js": ""}, "tags": [], "rulesets": {}, "name": "Elements in sets, subsets", "extensions": [], "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Introductory exercise about subsets using custom grading code.

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

", "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "u"], "parts": [{"showFeedbackIcon": true, "marks": 1, "checkingtype": "absdiff", "answer": "{d}", "expectedvariablenames": [], "vsetrangepoints": 5, "checkvariablenames": false, "vsetrange": [0, 1], "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"}}, "showpreview": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "type": "jme", "checkingaccuracy": 0.001, "showCorrectAnswer": true, "prompt": "

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

"}, {"showFeedbackIcon": true, "marks": 1, "checkingtype": "absdiff", "answer": "{b}", "expectedvariablenames": [], "vsetrangepoints": 5, "checkvariablenames": false, "vsetrange": [0, 1], "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"}}, "showpreview": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "type": "jme", "checkingaccuracy": 0.001, "showCorrectAnswer": true, "prompt": "

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

"}, {"showFeedbackIcon": true, "marks": 0, "displayType": "radiogroup", "shuffleAnswers": false, "variableReplacements": [], "minAnswers": 0, "answers": ["

True

", "

False

"], "maxMarks": 0, "layout": {"type": "all", "expression": ""}, "scripts": {}, "matrix": [["1", 0], ["1", "0"]], "variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "minMarks": 0, "type": "m_n_x", "showCorrectAnswer": true, "maxAnswers": 0, "warningType": "none", "prompt": "

Are these statements true or false?

", "choices": ["

$ Y \\subseteq X$

", "

$X \\nsubseteq Y $

"]}], "type": "question", "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}]}], "contributors": [{"name": "Lois Rollings", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/326/"}]}