// Numbas version: finer_feedback_settings {"name": "Simon's copy of Elementary operations on vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"s1": {"definition": "random(1,-1)", "name": "s1", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "n": {"definition": "matrix([a,b],[c,d])", "name": "n", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "a4": {"definition": "random(3..9)", "name": "a4", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "s4": {"definition": "random(1,-1)", "name": "s4", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "f": {"definition": "random(2..9)", "name": "f", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "d": {"definition": "s4*random(2..9)", "name": "d", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "ssquaresb": {"definition": "(c)^2+(d)^2+(f)^2", "name": "ssquaresb", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "v1": {"definition": "vector(a,b,g)", "name": "v1", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "s2": {"definition": "random(1,-1)", "name": "s2", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "g": {"definition": "s1*random(2..9)", "name": "g", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "v2": {"definition": "vector(c,d,f)", "name": "v2", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "ssquaresa": {"definition": "(a)^2+(b)^2+(g)^2", "name": "ssquaresa", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "s5": {"definition": "random(1,-1)", "name": "s5", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "a": {"definition": "s1*random(2..9)", "name": "a", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "m": {"definition": "matrix([a,b],[c,d])", "name": "m", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "q": {"definition": "M+N", "name": "q", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "c": {"definition": "s3*random(2..9)", "name": "c", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "ssquares": {"definition": "(a+c)^2+(b+d)^2+(f+g)^2", "name": "ssquares", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "b4": {"definition": "-random(3..9)", "name": "b4", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "v": {"definition": "v1+v2", "name": "v", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "b": {"definition": "s2*random(2..9)", "name": "b", "description": "", "templateType": "anything", "group": "Ungrouped variables"}, "s3": {"definition": "random(1,-1)", "name": "s3", "description": "", "templateType": "anything", "group": "Ungrouped variables"}}, "advice": "
\\[\\boldsymbol{v}+\\boldsymbol{w} = \\var{vector(a,b,g)} + \\var{vector(c,d,f)} = \\var{vector(a+c,b+d,g+f)} \\]
\n\n\\begin{align}
\\var{a4}\\boldsymbol{v} &= \\var{a4}\\times \\var{vector(a,b,g)}
&= \\var{a4*vector(a,b,g)}
\\end{align}
\\begin{align}
\\var{b4}\\boldsymbol{w} &= \\var{b4}\\times\\var{vector(c, d, f)}
&= \\var{b4*vector(c,d,f)}
\\end{align}
(c)
\n$4\\mathbf{v}-2\\mathbf{w} = 4\\times \\var{vector(a,b,g)}-2\\times \\var{vector(c,d,f)}=\\var{vector(4*a,4*b,4*g)}-\\var{vector(2*c,2*d,2*f)}= \\var{vector(4*a-2*c,4*b-2*d,4*g-2*f)}$
\n\n\n\n(d)
\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{z}= \\begin{pmatrix} z_1 \\\\ z_2 \\\\ z_3 \\end{pmatrix}$, the unit vector parallel to $\\boldsymbol{z}$ is given by:
\n\\[ \\boldsymbol{\\hat{z}} = \\frac{1}{\\lVert \\boldsymbol{z} \\rVert} \\begin{pmatrix} z_1 \\\\ z_2 \\\\ z_3 \\end{pmatrix} = \\begin{pmatrix} \\frac{z_1}{\\lVert \\boldsymbol{z} \\rVert} \\\\ \\frac{z_2}{\\lVert \\boldsymbol{z} \\rVert} \\\\ \\frac{z_3}{\\lVert \\boldsymbol{z} \\rVert} \\end{pmatrix} \\]
\nFor this example we have
\n$\\boldsymbol{v}+\\boldsymbol{w} = \\var{vector(a+c,b+d,g+f)}$ from part (a)
\nand
\n$\\lVert \\boldsymbol{v+w} \\rVert =\\simplify[std]{sqrt({(a+c)^2+(b+d)^2+(f+g)^2})}$ from part (d)
\n\n
Hence:
\n\\begin{align}
&& \\boldsymbol{\\hat{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}
Elementary operations on vectors; sum, modulus, unit vector, scalar multiple.
", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "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.
Calculate $\\mathbf{v}+\\mathbf{w} = $ [[0]]
", "gaps": [{"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "correctAnswer": "v", "type": "matrix", "variableReplacementStrategy": "originalfirst", "tolerance": 0, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "allowFractions": false, "numRows": "3", "correctAnswerFractions": false, "showFeedbackIcon": true, "numColumns": 1, "allowResize": false, "markPerCell": false, "customMarkingAlgorithm": ""}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "sortAnswers": false, "type": "gapfill", "prompt": "Calculate
\n$\\var{a4}\\mathbf{v} = $ [[0]]
\n$\\var{b4}\\mathbf{w} = $ [[1]]
", "gaps": [{"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "correctAnswer": "a4*v1", "type": "matrix", "variableReplacementStrategy": "originalfirst", "tolerance": 0, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "allowFractions": false, "numRows": "3", "correctAnswerFractions": false, "showFeedbackIcon": true, "numColumns": 1, "allowResize": false, "markPerCell": false, "customMarkingAlgorithm": ""}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "correctAnswer": "b4*v2", "type": "matrix", "variableReplacementStrategy": "originalfirst", "tolerance": 0, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "allowFractions": false, "numRows": "3", "correctAnswerFractions": false, "showFeedbackIcon": true, "numColumns": 1, "allowResize": false, "markPerCell": false, "customMarkingAlgorithm": ""}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "sortAnswers": false, "type": "gapfill", "prompt": "Calculate $4\\mathbf{v}-2\\mathbf{w} = $[[0]]
", "gaps": [{"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "correctAnswer": "4*v1 - 2*v2", "type": "matrix", "variableReplacementStrategy": "originalfirst", "tolerance": 0, "scripts": {}, "marks": 1, "showCorrectAnswer": true, "allowFractions": false, "numRows": "3", "correctAnswerFractions": false, "showFeedbackIcon": true, "numColumns": 1, "allowResize": false, "markPerCell": false, "customMarkingAlgorithm": ""}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "sortAnswers": false, "type": "gapfill", "prompt": "Calculate the following.
\n$\\vert \\mathbf{v} \\vert=$ [[0]]
\n$\\vert \\mathbf{w} \\vert = $ [[1]]
\n$\\vert \\mathbf{v}+\\mathbf{w} \\vert = $ [[2]]
\nYou must enter your answers exactly, using the function sqrt(x)
as necessary
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.