// Numbas version: exam_results_page_options {"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": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Elementary operations on vectors; sum, modulus, unit vector, scalar multiple. 

"}, "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variable_groups": [], "parts": [{"type": "gapfill", "prompt": "

Calculate $\\boldsymbol{v}+\\boldsymbol{w} = $ [[0]]

", "scripts": {}, "unitTests": [], "gaps": [{"tolerance": 0, "type": "matrix", "scripts": {}, "unitTests": [], "numColumns": 1, "extendBaseMarkingAlgorithm": true, "correctAnswer": "v", "showFeedbackIcon": true, "variableReplacements": [], "numRows": "3", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFractions": false, "allowResize": false, "marks": "1", "customMarkingAlgorithm": "", "allowFractions": false, "markPerCell": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Calculate $\\boldsymbol{v}+3\\boldsymbol{w} = $[[0]]

", "scripts": {}, "unitTests": [], "gaps": [{"tolerance": 0, "type": "matrix", "scripts": {}, "unitTests": [], "numColumns": 1, "extendBaseMarkingAlgorithm": true, "correctAnswer": "v1 + 3*v2", "showFeedbackIcon": true, "variableReplacements": [], "numRows": "3", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFractions": false, "allowResize": false, "marks": 1, "customMarkingAlgorithm": "", "allowFractions": false, "markPerCell": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Calculate $4\\boldsymbol{v}-2\\boldsymbol{w} = $[[0]]

", "scripts": {}, "unitTests": [], "gaps": [{"tolerance": 0, "type": "matrix", "scripts": {}, "unitTests": [], "numColumns": 1, "extendBaseMarkingAlgorithm": true, "correctAnswer": "4*v1 - 2*v2", "showFeedbackIcon": true, "variableReplacements": [], "numRows": "3", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFractions": false, "allowResize": false, "marks": 1, "customMarkingAlgorithm": "", "allowFractions": false, "markPerCell": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Calculate the following.

\n

$\\lVert \\boldsymbol{v} \\rVert=$ [[0]]

\n

$\\lVert \\boldsymbol{w} \\rVert = $ [[1]]

\n

$\\lVert \\boldsymbol{v}+\\boldsymbol{w} \\rVert = $ [[2]]

", "scripts": {}, "unitTests": [], "gaps": [{"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "sqrt({a^2+b^2+g^2})", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "sqrt({c^2+d^2+f^2})", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "sqrt({(a+c)^2+ (b+d)^2 +(g+f)^2})", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Let $\\boldsymbol{z}=\\boldsymbol{v}+\\boldsymbol{w}$.

\n

Calculate the unit vector $\\boldsymbol{u_z}$ in the direction of $\\boldsymbol{z}$. Write $\\boldsymbol{u_z}$ as a row vector.

\n

$\\boldsymbol{u_z}= \\big($ [[0]], [[1]], [[2]] $\\big)$

\n

You must enter your answers exactly, using the function sqrt(x) if necessary.

", "scripts": {}, "unitTests": [], "gaps": [{"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({(a + c)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({(b + d)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({(g + f)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Calculate

\n

$\\var{a4}\\boldsymbol{v} = $ [[0]]

\n

$\\var{b4}\\boldsymbol{w} = $ [[1]]

", "scripts": {}, "unitTests": [], "gaps": [{"tolerance": 0, "type": "matrix", "scripts": {}, "unitTests": [], "numColumns": 1, "extendBaseMarkingAlgorithm": true, "correctAnswer": "a4*v1", "showFeedbackIcon": true, "variableReplacements": [], "numRows": "3", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFractions": false, "allowResize": false, "marks": "1", "customMarkingAlgorithm": "", "allowFractions": false, "markPerCell": false}, {"tolerance": 0, "type": "matrix", "scripts": {}, "unitTests": [], "numColumns": 1, "extendBaseMarkingAlgorithm": true, "correctAnswer": "b4*v2", "showFeedbackIcon": true, "variableReplacements": [], "numRows": "3", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "correctAnswerFractions": false, "allowResize": false, "marks": "1", "customMarkingAlgorithm": "", "allowFractions": false, "markPerCell": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}, {"type": "gapfill", "prompt": "

Calculate the unit vector $\\boldsymbol{u_v}$ parallel to $\\boldsymbol{v}$, and the unit vector $-\\boldsymbol{u_w}$ anti-parallel to $\\boldsymbol{w}$. Write both vectors as row vectors.

\n

$\\boldsymbol{u_v} = \\big($ [[0]], [[1]], [[2]] $\\big)$

\n

$-\\boldsymbol{u_w} = \\big($ [[3]], [[4]], [[5]] $\\big)$

", "scripts": {}, "unitTests": [], "gaps": [{"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({a} / Sqrt({(({a} ^ 2) + ({b} ^ 2) + ({g} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({b} / Sqrt({(({a} ^ 2) + ({b} ^ 2) + ({g} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({g} / Sqrt({(({a} ^ 2) + ({b} ^ 2) + ({g} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({( - c)} / Sqrt({(({c} ^ 2) + ({d} ^ 2) + ({f} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({( - d)} / Sqrt({(({c} ^ 2) + ({d} ^ 2) + ({f} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}, {"vsetRange": [0, 1], "type": "jme", "expectedVariableNames": [], "checkingType": "absdiff", "answerSimplification": "std", "answer": "({( - f)} / Sqrt({(({c} ^ 2) + ({d} ^ 2) + ({f} ^ 2))}))", "unitTests": [], "showPreview": true, "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "showFeedbackIcon": true, "checkingAccuracy": 0.001, "variableReplacements": [], "failureRate": 1, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "checkVariableNames": false}], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": ""}], "advice": "

a)

\n

\\[\\boldsymbol{v}+\\boldsymbol{w} = \\var{vector(a,b,g)} + \\var{vector(c,d,f)} = \\var{vector(a+c,b+d,g+f)} \\]

\n

b)

\n

In 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}$.

\n

Hence:

\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}

\n

c)

\n

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} \\]

\n

For 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}

\n

d)

\n

\\begin{align}
\\var{a4}\\boldsymbol{v} &= \\simplify{vector({a4}*{a}, {a4}*{b}, {a4}*{g})} \\\\[1em]
&= \\var{a4*vector(a,b,g)}
\\end{align}

\n

\\begin{align}
\\var{-b4}\\boldsymbol{v} &= \\simplify{vector({-b4}*{c}, {-b4}*{d}, {-b4}*{f})} \\\\[1em]
&= \\var{-b4*vector(c,d,f)}
\\end{align}

\n

e)

\n

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} \\]

\n

and 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} \\]

", "ungrouped_variables": ["b4", "q", "s3", "s2", "s1", "s5", "s4", "ssquares", "v1", "v2", "a4", "a", "c", "b", "d", "g", "f", "m", "n", "ssquaresb", "ssquaresa", "v"], "functions": {}, "preamble": {"css": "", "js": ""}, "name": "Elementary operations on vectors", "variables": {"s4": {"definition": "random(1,-1)", "templateType": "anything", "name": "s4", "group": "Ungrouped variables", "description": ""}, "ssquaresa": {"definition": "(a)^2+(b)^2+(g)^2", "templateType": "anything", "name": "ssquaresa", "group": "Ungrouped variables", "description": ""}, "m": {"definition": "matrix([a,b],[c,d])", "templateType": "anything", "name": "m", "group": "Ungrouped variables", "description": ""}, "a": {"definition": "s1*random(2..9)", "templateType": "anything", "name": "a", "group": "Ungrouped variables", "description": ""}, "b4": {"definition": "-random(3..9)", "templateType": "anything", "name": "b4", "group": "Ungrouped variables", "description": ""}, "s2": {"definition": "random(1,-1)", "templateType": "anything", "name": "s2", "group": "Ungrouped variables", "description": ""}, "q": {"definition": "M+N", "templateType": "anything", "name": "q", "group": "Ungrouped variables", "description": ""}, "a4": {"definition": "random(3..9)", "templateType": "anything", "name": "a4", "group": "Ungrouped variables", "description": ""}, "s3": {"definition": "random(1,-1)", "templateType": "anything", "name": "s3", "group": "Ungrouped variables", "description": ""}, "s5": {"definition": "random(1,-1)", "templateType": "anything", "name": "s5", "group": "Ungrouped variables", "description": ""}, "s1": {"definition": "random(1,-1)", "templateType": "anything", "name": "s1", "group": "Ungrouped variables", "description": ""}, "ssquares": {"definition": "(a+c)^2+(b+d)^2+(f+g)^2", "templateType": "anything", "name": "ssquares", "group": "Ungrouped variables", "description": ""}, "ssquaresb": {"definition": "(c)^2+(d)^2+(f)^2", "templateType": "anything", "name": "ssquaresb", "group": "Ungrouped variables", "description": ""}, "c": {"definition": "s3*random(2..9)", "templateType": "anything", "name": "c", "group": "Ungrouped variables", "description": ""}, "d": {"definition": "s4*random(2..9)", "templateType": "anything", "name": "d", "group": "Ungrouped variables", "description": ""}, "v": {"definition": "v1+v2", "templateType": "anything", "name": "v", "group": "Ungrouped variables", "description": ""}, "v1": {"definition": "vector(a,b,g)", "templateType": "anything", "name": "v1", "group": "Ungrouped variables", "description": ""}, "b": {"definition": "s2*random(2..9)", "templateType": "anything", "name": "b", "group": "Ungrouped variables", "description": ""}, "n": {"definition": "matrix([a,b],[c,d])", "templateType": "anything", "name": "n", "group": "Ungrouped variables", "description": ""}, "f": {"definition": "random(2..9)", "templateType": "anything", "name": "f", "group": "Ungrouped variables", "description": ""}, "g": {"definition": "s1*random(2..9)", "templateType": "anything", "name": "g", "group": "Ungrouped variables", "description": ""}, "v2": {"definition": "vector(c,d,f)", "templateType": "anything", "name": "v2", "group": "Ungrouped variables", "description": ""}}, "extensions": [], "statement": "

You are given the vectors

\n

\\begin{align}
\\boldsymbol{v} & =\\simplify[std]{vector({a},{b},{g})}, &
\\boldsymbol{w} &= \\simplify[std]{vector({c},{d},{f})}\\qquad \\in{\\mathbb R}^3.
\\end{align}

\n

Enter your answers to the following questions exactly, using the function sqrt(x) if necessary.

", "type": "question", "contributors": [{"name": "Katy Dobson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/854/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}]}]}], "contributors": [{"name": "Katy Dobson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/854/"}, {"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}]}