// Numbas version: finer_feedback_settings {"name": "Adding and subtracting vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Adding and subtracting vectors", "tags": [], "metadata": {"description": "
Adding and subtracting vectors of random size, including resolving brackets. Advice (i.e. solution) has conditional visibility to show only the correct size.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Let \\(u=\\var{u}\\), \\(v=\\var{v}\\) and \\(w=\\var{w}\\).
", "advice": "We add and subtract vectors entry by entry.
\nPart a)
\n\\[\\simplify[unitFactor]{v+{sign1}w}=\\begin{pmatrix}\\simplify[]{{v[0]}+{sign1*w[0]}} \\\\ \\simplify[]{{v[1]}+{sign1*w[1]}} \\end{pmatrix} = \\var{v+sign1*w}\\]
\n\\[\\simplify[unitFactor]{v+{sign1}w}=\\begin{pmatrix}\\simplify[]{{v[0]}+{sign1*w[0]}} \\\\ \\simplify[]{{v[1]}+{sign1*w[1]}} \\\\\\simplify[]{{v[2]}+{sign1*w[2]}} \\end{pmatrix} = \\var{v+sign1*w}\\]
\n\\[\\simplify[unitFactor]{v+{sign1}w}=\\begin{pmatrix}\\simplify[]{{v[0]}+{sign1*w[0]}} \\\\ \\simplify[]{{v[1]}+{sign1*w[1]}} \\\\\\simplify[]{{v[2]}+{sign1*w[2]}} \\\\\\simplify[]{{v[3]}+{sign1*w[3]}} \\end{pmatrix} = \\var{v+sign1*w}\\]
Part b)
\n\\[v -(\\simplify[unitFactor,!expandBrackets]{u+{sign2}*w})=\\begin{pmatrix}\\simplify[]{{v[0]}-({u[0]}+{sign2*w[0]})} \\\\ \\simplify[]{{v[1]}-({u[1]}+{sign2*w[1]})} \\end{pmatrix}=\\var{v-(u+sign2*w)} \\]
\n\\[v -(\\simplify[unitFactor,!expandBrackets]{u+{sign2}*w})=\\begin{pmatrix}\\simplify[]{{v[0]}-({u[0]}+{sign2*w[0]})} \\\\ \\simplify[]{{v[1]}-({u[1]}+{sign2*w[1]})} \\\\\\simplify[]{{v[2]}-({u[2]}+{sign2*w[2]})} \\end{pmatrix}=\\var{v-(u+sign2*w)} \\]
\n\\[v -(\\simplify[unitFactor,!expandBrackets]{u+{sign2}*w})=\\begin{pmatrix}\\simplify[]{{v[0]}-({u[0]}+{sign2*w[0]})} \\\\ \\simplify[]{{v[1]}-({u[1]}+{sign2*w[1]})} \\\\\\simplify[]{{v[2]}-({u[2]}+{sign2*w[2]})} \\\\\\simplify[]{{v[3]}-({u[3]}+{sign2*w[3]})} \\end{pmatrix}=\\var{v-(u+sign2*w)} \\]
", "rulesets": {}, "extensions": [], "variables": {"rows": {"name": "rows", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "size of the vectors
", "templateType": "anything"}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "vector((repeat(random(-5..5),rows)))", "description": "randomly generated vector of random size.
", "templateType": "anything"}, "w": {"name": "w", "group": "Ungrouped variables", "definition": "vector(repeat(random(-5..5),rows))", "description": "randomly generated vector of same size as v
", "templateType": "anything"}, "u": {"name": "u", "group": "Ungrouped variables", "definition": "vector(repeat(random(-5..5),rows))", "description": "randomly generated vector of same size as v
", "templateType": "anything"}, "sign1": {"name": "sign1", "group": "Ungrouped variables", "definition": "random(-1..1 except 0)", "description": "randomly generated sign
", "templateType": "anything"}, "sign2": {"name": "sign2", "group": "Ungrouped variables", "definition": "random(-1..1 except 0)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "not is_zero(v) and not is_zero(w) and not is_zero(u)", "maxRuns": 100}, "ungrouped_variables": ["rows", "v", "w", "u", "sign1", "sign2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate \\(\\simplify{v + {sign1}*w}=\\) [[0]].
\n", "gaps": [{"type": "matrix", "useCustomName": true, "customName": "Gap 0", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "v+sign1*w", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": "1", "minRows": 1, "maxRows": 0}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate \\(v -(\\simplify[unitFactor,!expandBrackets]{u+{sign2}*w})=\\) [[0]].
\n", "gaps": [{"type": "matrix", "useCustomName": true, "customName": "Gap 0", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "v-(u+sign2*w)", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": "1", "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Tatiana Tyukina", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/341/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}]}], "contributors": [{"name": "Tatiana Tyukina", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/341/"}, {"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}