// Numbas version: finer_feedback_settings {"name": "Elementary operations on vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["b4", "q", "s3", "s2", "s1", "s5", "s4", "ssquares", "v1", "v2", "a4", "a", "c", "b", "d", "g", "f", "m", "n", "ssquaresb", "ssquaresa", "v"], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "tags": [], "functions": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "gaps": [{"type": "matrix", "allowResize": false, "allowFractions": false, "correctAnswerFractions": false, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "numColumns": 1, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswer": "v", "tolerance": 0, "markPerCell": false, "numRows": "3", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}], "extendBaseMarkingAlgorithm": true, "marks": 0, "showFeedbackIcon": true, "prompt": "
Calculate $\\mathbf{v}+\\mathbf{w} = $ [[0]]
", "scripts": {}}, {"type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "gaps": [{"type": "matrix", "allowResize": false, "allowFractions": false, "correctAnswerFractions": false, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "numColumns": 1, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswer": "v1 + 3*v2", "tolerance": 0, "markPerCell": false, "numRows": "3", "extendBaseMarkingAlgorithm": true, "marks": 1, "showFeedbackIcon": true, "scripts": {}}], "extendBaseMarkingAlgorithm": true, "marks": 0, "showFeedbackIcon": true, "prompt": "Calculate $\\mathbf{v}+3\\mathbf{w} = $[[0]]
", "scripts": {}}, {"type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "gaps": [{"type": "matrix", "allowResize": false, "allowFractions": false, "correctAnswerFractions": false, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "numColumns": 1, "variableReplacements": [], "customMarkingAlgorithm": "", "correctAnswer": "4*v1 - 2*v2", "tolerance": 0, "markPerCell": false, "numRows": "3", "extendBaseMarkingAlgorithm": true, "marks": 1, "showFeedbackIcon": true, "scripts": {}}], "extendBaseMarkingAlgorithm": true, "marks": 0, "showFeedbackIcon": true, "prompt": "Calculate $4\\mathbf{v}-2\\mathbf{w} = $[[0]]
", "scripts": {}}, {"type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "gaps": [{"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "sqrt({a^2+b^2+g^2})", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}, {"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "sqrt({c^2+d^2+f^2})", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}, {"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "sqrt({(a+c)^2+ (b+d)^2 +(g+f)^2})", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}], "extendBaseMarkingAlgorithm": true, "marks": 0, "showFeedbackIcon": true, "prompt": "Calculate the following.
\n$\\vert \\mathbf{v} \\vert=$ [[0]]
\n$\\vert \\mathbf{w} \\vert = $ [[1]]
\n$\\vert \\mathbf{v}+\\mathbf{w} \\vert = $ [[2]]
", "scripts": {}}, {"type": "gapfill", "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "gaps": [{"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "({(a + c)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}, {"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "({(b + d)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}, {"checkVariableNames": false, "type": "jme", "vsetRange": [0, 1], "unitTests": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "answer": "({(g + f)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "checkingType": "absdiff", "showPreview": true, "expectedVariableNames": [], "failureRate": 1, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "answerSimplification": "std", "extendBaseMarkingAlgorithm": true, "marks": "1", "showFeedbackIcon": true, "scripts": {}}], "extendBaseMarkingAlgorithm": true, "marks": 0, "showFeedbackIcon": true, "prompt": "Let $\\mathbf{z}=\\mathbf{v}+\\mathbf{w}$.
\nCalculate the unit vector $\\mathbf{\\hat{z}}$ in the direction of $\\mathbf{z}$. Write $\\mathbf{\\hat{z}}$ as a row vector.
\n$\\mathbf{\\hat{z}}= \\big($ [[0]], [[1]], [[2]] $\\big)$
\nYou must enter your answers exactly, using the function sqrt(x)
as necessary.
Calculate
\n$\\var{a4}\\mathbf{v} = $ [[0]]
\n$\\var{b4}\\mathbf{w} = $ [[1]]
", "scripts": {}}], "advice": "\\[\\boldsymbol{v}+\\boldsymbol{w} = \\var{vector(a,b,g)} + \\var{vector(c,d,f)} = \\var{vector(a+c,b+d,g+f)} \\]
\nIn general for a vector $\\boldsymbol{x}= \\begin{pmatrix}x_1 \\\\ x_2 \\\\ x_3 \\end{pmatrix}$, we have $\\lVert \\boldsymbol{x} \\rVert = \\sqrt{x_1^2+x_2^2+x_3^2}$.
\nHence:
\n\\begin{align}
\\lVert \\boldsymbol{v} \\rVert &= \\sqrt{\\var{a^2}+\\var{b^2}+\\var{g^2}} = \\simplify[all]{ sqrt({a^2+b^2+g^2})} \\\\
\\lVert \\boldsymbol{w} \\rVert &= \\sqrt{\\var{c^2}+\\var{d^2}+\\var{f^2}} = \\simplify[all]{ sqrt({c^2+d^2+f^2})} \\\\
\\lVert \\boldsymbol{v+w} \\rVert &= \\sqrt{\\var{(a+c)^2}+\\var{(b+d)^2}+\\var{(g+f)^2}} = \\simplify[all]{ sqrt({(a+c)^2+(b+d)^2+(f+g)^2})}
\\end{align}
Given a vector $\\boldsymbol{x}= \\begin{pmatrix} x_1 \\\\ x_2 \\\\ x_3 \\end{pmatrix}$, the unit vector parallel to $\\boldsymbol{x}$ is given by:
\n\\[ \\boldsymbol{u_x} = \\frac{1}{\\lVert \\boldsymbol{x} \\rVert} \\begin{pmatrix} x_1 \\\\ x_2 \\\\ x_3 \\end{pmatrix} = \\begin{pmatrix} \\frac{x_1}{\\lVert \\boldsymbol{x} \\rVert} \\\\ \\frac{x_2}{\\lVert \\boldsymbol{x} \\rVert} \\\\ \\frac{x_3}{\\lVert \\boldsymbol{x} \\rVert} \\end{pmatrix} \\]
\nFor this example we have $\\lVert \\boldsymbol{v+w} \\rVert =\\simplify[std]{sqrt({(a+c)^2+(b+d)^2+(f+g)^2})}$, hence:
\n\\begin{align}
&&\\boldsymbol{z} = \\boldsymbol{v} + \\boldsymbol{w} &= \\begin{pmatrix} \\var{a+c} \\\\ \\var{b+d} \\\\ \\var{g+f} \\end{pmatrix} \\\\
\\implies && \\boldsymbol{u_z} &= \\frac{1}{\\sqrt{\\var{ssquares}}} \\begin{pmatrix} \\var{a+c} \\\\ \\var{b+d} \\\\ \\var{g+f} \\end{pmatrix} \\\\[1em]
&& &= \\begin{pmatrix} \\simplify[std]{{a+c}/sqrt({ssquares})} \\\\ \\simplify[std]{{b+d}/sqrt({ssquares})} \\\\ \\simplify[std]{{g+f}/sqrt({ssquares})} \\end{pmatrix}
\\end{align}
\\begin{align}
\\var{a4}\\boldsymbol{v} &= \\simplify{vector({a4}*{a}, {a4}*{b}, {a4}*{g})} \\\\[1em]
&= \\var{a4*vector(a,b,g)}
\\end{align}
\\begin{align}
\\var{-b4}\\boldsymbol{v} &= \\simplify{vector({-b4}*{c}, {-b4}*{d}, {-b4}*{f})} \\\\[1em]
&= \\var{-b4*vector(c,d,f)}
\\end{align}
Using the information above, the unit vector parallel to $\\boldsymbol{v}$ is:
\n\\[ \\boldsymbol{u_v} = \\begin{pmatrix} \\simplify[std]{{a}/sqrt({ssquaresA})} \\\\ \\simplify[std]{{b}/sqrt({ssquaresA})} \\\\ \\simplify[std]{{g}/sqrt({ssquaresA})} \\end{pmatrix} \\]
\nand the unit vector anti-parallel to $\\boldsymbol{w}$ is:
\n\\[ -\\boldsymbol{u_w} = \\begin{pmatrix} \\simplify[std]{{-c}/sqrt({ssquaresB})} \\\\ \\simplify[std]{{-d}/sqrt({ssquaresB})} \\\\ \\simplify[std]{{-f}/sqrt({ssquaresB})} \\end{pmatrix} \\]
", "variables": {"b": {"templateType": "anything", "definition": "s2*random(2..9)", "name": "b", "description": "", "group": "Ungrouped variables"}, "q": {"templateType": "anything", "definition": "M+N", "name": "q", "description": "", "group": "Ungrouped variables"}, "v": {"templateType": "anything", "definition": "v1+v2", "name": "v", "description": "", "group": "Ungrouped variables"}, "s1": {"templateType": "anything", "definition": "random(1,-1)", "name": "s1", "description": "", "group": "Ungrouped variables"}, "d": {"templateType": "anything", "definition": "s4*random(2..9)", "name": "d", "description": "", "group": "Ungrouped variables"}, "g": {"templateType": "anything", "definition": "s1*random(2..9)", "name": "g", "description": "", "group": "Ungrouped variables"}, "a4": {"templateType": "anything", "definition": "random(3..9)", "name": "a4", "description": "", "group": "Ungrouped variables"}, "m": {"templateType": "anything", "definition": "matrix([a,b],[c,d])", "name": "m", "description": "", "group": "Ungrouped variables"}, "s5": {"templateType": "anything", "definition": "random(1,-1)", "name": "s5", "description": "", "group": "Ungrouped variables"}, "a": {"templateType": "anything", "definition": "s1*random(2..9)", "name": "a", "description": "", "group": "Ungrouped variables"}, "f": {"templateType": "anything", "definition": "random(2..9)", "name": "f", "description": "", "group": "Ungrouped variables"}, "s3": {"templateType": "anything", "definition": "random(1,-1)", "name": "s3", "description": "", "group": "Ungrouped variables"}, "v2": {"templateType": "anything", "definition": "vector(c,d,f)", "name": "v2", "description": "", "group": "Ungrouped variables"}, "ssquares": {"templateType": "anything", "definition": "(a+c)^2+(b+d)^2+(f+g)^2", "name": "ssquares", "description": "", "group": "Ungrouped variables"}, "v1": {"templateType": "anything", "definition": "vector(a,b,g)", "name": "v1", "description": "", "group": "Ungrouped variables"}, "s4": {"templateType": "anything", "definition": "random(1,-1)", "name": "s4", "description": "", "group": "Ungrouped variables"}, "c": {"templateType": "anything", "definition": "s3*random(2..9)", "name": "c", "description": "", "group": "Ungrouped variables"}, "b4": {"templateType": "anything", "definition": "-random(3..9)", "name": "b4", "description": "", "group": "Ungrouped variables"}, "ssquaresa": {"templateType": "anything", "definition": "(a)^2+(b)^2+(g)^2", "name": "ssquaresa", "description": "", "group": "Ungrouped variables"}, "n": {"templateType": "anything", "definition": "matrix([a,b],[c,d])", "name": "n", "description": "", "group": "Ungrouped variables"}, "s2": {"templateType": "anything", "definition": "random(1,-1)", "name": "s2", "description": "", "group": "Ungrouped variables"}, "ssquaresb": {"templateType": "anything", "definition": "(c)^2+(d)^2+(f)^2", "name": "ssquaresb", "description": "", "group": "Ungrouped variables"}}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Elementary operations on vectors; sum, modulus, unit vector, scalar multiple.
"}, "name": "Elementary operations on vectors", "variable_groups": [], "statement": "You are given the vectors
\n\\begin{align}
\\mathbf{v} & =\\simplify[std]{vector({a},{b},{g})}, &
\\mathbf{w} &= \\simplify[std]{vector({c},{d},{f})}\\qquad \\in{\\mathbb R}^3.
\\end{align}
Enter your answers to the following questions exactly, using the function sqrt(x)
if necessary.