// 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": "

(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

\n

(b)

\n

\\begin{align}
\\var{a4}\\boldsymbol{v} &= \\var{a4}\\times \\var{vector(a,b,g)}
&= \\var{a4*vector(a,b,g)}
\\end{align}

\n

\\begin{align}
\\var{b4}\\boldsymbol{w} &= \\var{b4}\\times\\var{vector(c, d, f)}
&= \\var{b4*vector(c,d,f)}
\\end{align}

\n

\n

(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)

\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

(e)

\n

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

\n

For this example we have

\n

$\\boldsymbol{v}+\\boldsymbol{w} = \\var{vector(a+c,b+d,g+f)}$       from part (a)

\n

and

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

\n

\n

", "metadata": {"description": "

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}

\n

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

", "ungrouped_variables": ["b4", "q", "s3", "s2", "s1", "s5", "s4", "ssquares", "v1", "v2", "a4", "a", "c", "b", "d", "g", "f", "m", "n", "ssquaresb", "ssquaresa", "v"], "name": "Simon's copy of Elementary operations on vectors", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "variable_groups": [], "parts": [{"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "sortAnswers": false, "type": "gapfill", "prompt": "

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

\n

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

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

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

\n

Calculate 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)$

\n

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

", "gaps": [{"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "type": "jme", "answer": "({(a + c)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "vsetRangePoints": 5, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "showPreview": true, "expectedVariableNames": [], "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "vsetRange": [0, 1], "showFeedbackIcon": true, "failureRate": 1, "checkingAccuracy": 0.001, "checkVariableNames": false, "customMarkingAlgorithm": "", "answerSimplification": "std"}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "type": "jme", "answer": "({(b + d)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "vsetRangePoints": 5, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "showPreview": true, "expectedVariableNames": [], "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "vsetRange": [0, 1], "showFeedbackIcon": true, "failureRate": 1, "checkingAccuracy": 0.001, "checkVariableNames": false, "customMarkingAlgorithm": "", "answerSimplification": "std"}, {"variableReplacements": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "type": "jme", "answer": "({(g + f)} / Sqrt({(((a + c) ^ 2) + ((b + d) ^ 2) + ((g + f) ^ 2))}))", "vsetRangePoints": 5, "scripts": {}, "marks": "1", "showCorrectAnswer": true, "showPreview": true, "expectedVariableNames": [], "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "vsetRange": [0, 1], "showFeedbackIcon": true, "failureRate": 1, "checkingAccuracy": 0.001, "checkVariableNames": false, "customMarkingAlgorithm": "", "answerSimplification": "std"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": ""}], "preamble": {"css": "", "js": ""}, "tags": [], "extensions": [], "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": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "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": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}