// Numbas version: exam_results_page_options {"name": "set6 - Cartesian Products and Complements", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"set1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "union(set(list1),int)", "description": "", "name": "set1"}, "set6_2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(product(list(univ),list(intersection(set1,set2))))", "description": "", "name": "set6_2"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "definition": "5-a", "description": "", "name": "b"}, "set4": {"templateType": "anything", "group": "Ungrouped variables", "definition": "intersection(set4_1,set4_2)", "description": "", "name": "set4"}, "set6_1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "univ_2-set(product(list(union(set1,set2)),list(univ)))", "description": "", "name": "set6_1"}, "list1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "shuffle(list(1..20))[0..a]", "description": "", "name": "list1"}, "set3": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(product(list(intersection(univ-set1,univ-set2)),list(intersection(set1,set2))))", "description": "", "name": "set3"}, "list2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "shuffle(list(30..105#5))[0..b]", "description": "", "name": "list2"}, "set5_2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "univ-union(set1,set2)", "description": "", "name": "set5_2"}, "set4_2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "intersection(univ_2-set(product(list(univ),list(set1))),univ_2-set(product(list(set2),list(univ))))", "description": "", "name": "set4_2"}, "ext": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(shuffle(31..106#5)[0..2])", "description": "", "name": "ext"}, "set5": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(product(list(set5_1),list(set5_2)))", "description": "", "name": "set5"}, "univ": {"templateType": "anything", "group": "Ungrouped variables", "definition": "union(union(set1,set2),ext)", "description": "", "name": "univ"}, "set6": {"templateType": "anything", "group": "Ungrouped variables", "definition": "intersection(set6_1,set6_2)", "description": "", "name": "set6"}, "set7": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(product(list((univ-set1)-set2),list((univ-set2)-set1)))", "description": "", "name": "set7"}, "set5_1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set1-set2", "description": "", "name": "set5_1"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "definition": "random(2..3)", "description": "", "name": "a"}, "univ_2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(product(list(univ),list(univ)))", "description": "", "name": "univ_2"}, "set4_1": {"templateType": "anything", "group": "Ungrouped variables", "definition": "intersection(univ_2-set(product(list(univ),list(set2))),univ_2-set(product(list(set1),list(univ))))", "description": "", "name": "set4_1"}, "set2": {"templateType": "anything", "group": "Ungrouped variables", "definition": "union(set(list2),int)", "description": "", "name": "set2"}, "int": {"templateType": "anything", "group": "Ungrouped variables", "definition": "set(shuffle(21..29)[0..2])", "description": "", "name": "int"}}, "ungrouped_variables": ["a", "b", "ext", "int", "list1", "list2", "set1", "set2", "set3", "set4", "set4_1", "set4_2", "set5", "set5_1", "set5_2", "set6", "set6_1", "set6_2", "set7", "univ", "univ_2"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "set6 - Cartesian Products and Complements", "functions": {"mod_set": {"type": "list", "language": "javascript", "definition": "//returns all integers which are divisible by c betweeen a and b\nvar l=[];\nfor(var i=a;i$(A^c\\cap B^c) \\times (A\\cap B)=\\;$[[0]]

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

$(U\\times A)^c\\cap (U\\times B)^c\\cap (A\\times U)^c\\cap (B\\times U)^c=\\;$[[0]]

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

$(A-B)\\times (A\\cup B)^c=\\;$[[0]]

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

$[ (A \\cup B)\\times U]^c \\cap [ U \\times (A \\cap B) ]=\\;$[[0]]

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

$(A^c - B)\\times (B^c-A)=\\;$[[0]]

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

In this question the universal set is $U=\\var{univ}$.

\n

Let $A=\\var{set1}$ and let  $B=\\var{set2}$.

\n

For subsets $A$ and $B$ of $U$, the universal set for the Cartesian product $A\\times B$ is $U\\times U$.

\n

List the elements 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

Element $(a,b)$ of a Cartesian product is entered, and represented as $[a,b]$.

\n

For example set([1,1],[1,2],[2,3])gives the set $\\{[1,1], [1,2], [2,3]\\}$.

\n

The empty set is input as set().

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

a)

\n

$A^c$ is the set of $U-A$ of all elements in $U$ and not in $A$, so $A^c = \\var{univ - set1}$.

\n

$B^c$ is the set of $U-A$ of all elements in $U$ and not in $B$, so $B^c = \\var{univ - set1}$.

\n

$A^c \\cap B^c$ is the set of all elements present in both $A^c$ and $B^c$. This is equivalent to the set of all elements in neither $A$ nor $B$, i.e. $\\var{(univ-set1) and (univ-set2)}$.

\n

$A \\cap B$ is the set of all elements present in both $A$ and $B$, i.e $\\var{set1 and set2}$.

\n

So $(A^c \\cap B^c) \\times (A \\cap B)$ is the set of all pairs $(x,y)$, where $x$ is in $A^c \\cap B^c$, and $y$ is in $A \\cap B$.

\n

b)

\n

$(U \\times A)^c$ is the set of all pairs $(x,y)$ in $U \\times U$ which are not in $U \\times A$. Since $U$ is the universal set, this is equivalent to $U \\times (A^c)$, the product of $U$ with the set of elements not in $A$.

\n

Similarly, $(U \\times B)^c$ is equivalent to $U \\times (B^c)$.

\n

Again because $U$ is the universal set, $(U \\times A)^c \\cap (U \\times B)^c = U \\times (A^c \\cap B^c)$.

\n

By a similar argument, $(A \\times U)^c \\cap (B \\times U)^c = (A^c \\cap B^c) \\times U$.

\n

So $(U\\times A)^c\\cap (U\\times B)^c\\cap (A\\times U)^c\\cap (B\\times U)^c$ is equivalent to $(A^c \\cap B^c) \\times (A^c \\cap B^c)$. That is, the set of all pairs of two elements that are in neither $A$ nor $B$.

\n

c)

\n

$A-B$ is the set of elements which are in $A$ but not $B$, i.e. $\\var{set1-set2}$.

\n

$(A \\cup B)^c$ is the set of elements $U - (A \\cup B)$ which are in $U$ and not in $A \\cup B$, so $(A \\cup B)^c = \\var{univ-(set1 or set2)}$.

\n

d)

\n

$[(A \\cup B) \\times U]^c$ is equivalent to $(A \\cup B)^c \\times U$.

\n

So $[(A \\cup B) \\times U]^c \\cap [U \\times (A \\cap B)] = (A \\cup B)^c \\times (A \\cap B)$.

\n

e)

\n

$A^c-B$ is the set of all elements which are in $A^c$ but not $B$. That's equivalent to the set of elements which are in neither $A$ nor $B$, i.e. $(A \\cup B)^c = \\var{univ-(set1 or set2)}$.

\n

Similarly, $B^c - A = (B \\cup A)^c = (A \\cup B)^c = \\var{univ-(set1 or set2)}$.

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