// Numbas version: exam_results_page_options {"name": "William's copy of Basic Set Theory: set operations", "extensions": [], "custom_part_types": [], "resources": [["question-resources/384px-Venn0111.svg.png", "/srv/numbas/media/question-resources/384px-Venn0111.svg.png"], ["question-resources/384px-Venn0001.svg.png", "/srv/numbas/media/question-resources/384px-Venn0001.svg.png"], ["question-resources/384px-Venn0110.svg.png", "/srv/numbas/media/question-resources/384px-Venn0110.svg.png"], ["question-resources/240px-Venn0100.svg.png", "/srv/numbas/media/question-resources/240px-Venn0100.svg.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "William's copy of Basic Set Theory: set operations", "rulesets": {}, "preamble": {"js": "", "css": ""}, "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Simple exercises introducing the fundamental set operations, and NUMBAS syntax for sets.

"}, "functions": {}, "parts": [{"answer": "{union(A,B)}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "checkingType": "absdiff", "showPreview": true, "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacements": [], "vsetRangePoints": 5, "type": "jme", "marks": 1, "customMarkingAlgorithm": "", "scripts": {"validate": {"order": "instead", "script": "try {\n var tree = Numbas.jme.compile(this.studentAnswer);\n var type = Numbas.jme.evaluate(tree,this.question.scope).type;\n \n if ('set' != type) { \n this.giveWarning(\"Your answer must be a set. Use the syntax set(1,2,3) for the set $\\\\left\\\\{1,2,3\\\\right\\\\}$\");\n return false;\n }\n \n return true;\n}\ncatch(e) {\n this.markingComment(e);\n return false;\n}"}}, "customName": "", "failureRate": 1, "prompt": "

What is the union $A \\cup B$?

", "checkingAccuracy": 0.001, "useCustomName": false, "unitTests": []}, {"answer": "{intersection(A,B)}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "checkingType": "absdiff", "showPreview": true, "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacements": [], "vsetRangePoints": 5, "type": "jme", "marks": 1, "customMarkingAlgorithm": "", "scripts": {"validate": {"order": "instead", "script": "try {\n var tree = Numbas.jme.compile(this.studentAnswer);\n var type = Numbas.jme.evaluate(tree,this.question.scope).type;\n \n if ('set' != type) { \n this.giveWarning(\"Your answer must be a set. Use the syntax set(1,2,3) for the set $\\\\left\\\\{1,2,3\\\\right\\\\}$\");\n return false;\n }\n \n return true;\n}\ncatch(e) {\n this.markingComment(e);\n return false;\n}"}}, "customName": "", "failureRate": 1, "prompt": "

What is the intersection $A \\cap B$?

", "checkingAccuracy": 0.001, "useCustomName": false, "unitTests": []}, {"answer": "{A-B}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "checkingType": "absdiff", "showPreview": true, "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacements": [], "vsetRangePoints": 5, "type": "jme", "marks": 1, "customMarkingAlgorithm": "", "scripts": {"validate": {"order": "instead", "script": "try {\n var tree = Numbas.jme.compile(this.studentAnswer);\n var type = Numbas.jme.evaluate(tree,this.question.scope).type;\n \n if ('set' != type) { \n this.giveWarning(\"Your answer must be a set. Use the syntax set(1,2,3) for the set $\\\\left\\\\{1,2,3\\\\right\\\\}$\");\n return false;\n }\n \n return true;\n}\ncatch(e) {\n this.markingComment(e);\n return false;\n}"}}, "customName": "", "failureRate": 1, "prompt": "

What is $A-B$, the set of elements from $A$ which are not in $B$?

", "checkingAccuracy": 0.001, "useCustomName": false, "unitTests": []}, {"answer": "{B-A}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "checkingType": "absdiff", "showPreview": true, "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacements": [], "vsetRangePoints": 5, "type": "jme", "marks": 1, "customMarkingAlgorithm": "", "scripts": {"validate": {"order": "instead", "script": "try {\n var tree = Numbas.jme.compile(this.studentAnswer);\n var type = Numbas.jme.evaluate(tree,this.question.scope).type;\n \n if ('set' != type) { \n this.giveWarning(\"Your answer must be a set. Use the syntax set(1,2,3) for the set $\\\\left\\\\{1,2,3\\\\right\\\\}$\");\n return false;\n }\n \n return true;\n}\ncatch(e) {\n this.markingComment(e);\n return false;\n}"}}, "customName": "", "failureRate": 1, "prompt": "

What is $B-A$, the set of elements from $B$ which are not in $A$?

", "checkingAccuracy": 0.001, "useCustomName": false, "unitTests": []}, {"answer": "{union(A-B,B-A)}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "checkingType": "absdiff", "showPreview": true, "valuegenerators": [], "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "vsetRange": [0, 1], "variableReplacements": [], "vsetRangePoints": 5, "type": "jme", "marks": 1, "customMarkingAlgorithm": "", "scripts": {"validate": {"order": "instead", "script": "try {\n var tree = Numbas.jme.compile(this.studentAnswer);\n var type = Numbas.jme.evaluate(tree,this.question.scope).type;\n \n if ('set' != type) { \n this.giveWarning(\"Your answer must be a set. Use the syntax set(1,2,3) for the set $\\\\left\\\\{1,2,3\\\\right\\\\}$\");\n return false;\n }\n \n return true;\n}\ncatch(e) {\n this.markingComment(e);\n return false;\n}"}}, "customName": "", "failureRate": 1, "prompt": "

What is union of the set differences $(A-B)\\cup(B-A)$? This is also called the symmetric difference $A\\Delta B$.

", "checkingAccuracy": 0.001, "useCustomName": false, "unitTests": []}, {"minMarks": 0, "shuffleChoices": true, "shuffleAnswers": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "minAnswers": 0, "maxMarks": "1", "matrix": [["0.25", 0, 0, 0], [0, "0.25", 0, 0], [0, 0, "0.25", 0], [0, 0, 0, "0.25"]], "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "maxAnswers": 0, "choices": ["

$A\\cup B$

", "

$A \\cap B$

", "

$A \\Delta B$

", "

$A - B$

"], "layout": {"type": "all", "expression": ""}, "type": "m_n_x", "marks": 0, "customMarkingAlgorithm": "", "scripts": {}, "showCellAnswerState": true, "customName": "", "displayType": "radiogroup", "prompt": "

Match the mathematical expression with its Venn diagram, where the left circle represents the set $A$ and the right circle represents $B$.

\n

", "useCustomName": false, "unitTests": [], "answers": ["

", "

", "

", "

"], "warningType": "none"}], "tags": [], "variables": {"B": {"name": "B", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "union(set(listB),set(listN))"}, "listA": {"name": "listA", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "repeat(random(5..9),4)"}, "listB": {"name": "listB", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "repeat(random(0..4),4)"}, "A": {"name": "A", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "union(set(listA),set(listN))"}, "listN": {"name": "listN", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "repeat(random(1..9),2)"}}, "variable_groups": [], "ungrouped_variables": ["listA", "listB", "A", "B", "listN"], "statement": "

Consider the sets $A = \\var{A}$ and $B = \\var{B}$. Find the union, intsersection and set differences below. Use the NUMBAS syntax set(1,2,3) for $\\left\\{1,2,3\\right\\}$.

", "advice": "

The union of two sets is the set of elements from either set

\n

$ A \\cup B = \\left\\{ x\\, |\\, x \\in A \\text{ or } x \\in B\\right\\}$

\n
\n

The intersetction of two sets is the set of elements common to both sets

\n

$ A \\cap B = \\left\\{ x\\, |\\, x \\in A \\text{ and } x \\in B\\right\\}$

\n
\n

The difference $A-B$ is the set of elements from $A$ which are not in $B$:

\n

$ A - B = \\left\\{ x \\in A |\\, x \\notin B\\right\\}$

\n
\n

Similarly, the difference $B-A$ is the set of elements from $B$ which are not in $A$:

\n

$ B - A = \\left\\{ x \\in B |\\, x \\notin A\\right\\}$

\n
\n

The symmetric difference $A \\Delta B$ is the union of the set differences, but it can also be expressed as the union minus the intersection

\n

$ A \\Delta B = (A \\cup B) - (A \\cap B)$.

", "variablesTest": {"maxRuns": 100, "condition": "not(listA = listB)"}, "extensions": [], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "William Bean", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3476/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}, {"name": "William Bean", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3476/"}]}