// Numbas version: exam_results_page_options {"name": "MATH6005 Assessment 2_Q3of6", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"ans2": {"templateType": "anything", "description": "", "name": "ans2", "definition": "precround(dot(c,d)/(lenc*lend),2)", "group": "Ungrouped variables"}, "lenc": {"templateType": "anything", "description": "", "name": "lenc", "definition": "abs(c)", "group": "Ungrouped variables"}, "d": {"templateType": "anything", "description": "", "name": "d", "definition": "vector(repeat(random(2..9)*sign(random(1,1)),3))", "group": "Ungrouped variables"}, "dot_of_cd": {"templateType": "anything", "description": "", "name": "dot_of_cd", "definition": "dot(c,d)", "group": "Ungrouped variables"}, "a": {"templateType": "anything", "description": "", "name": "a", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "group": "Ungrouped variables"}, "ans1": {"templateType": "anything", "description": "", "name": "ans1", "definition": "precround(dot(a,b)/(lena*lenb),2)", "group": "Ungrouped variables"}, "dot_of_ab": {"templateType": "anything", "description": "", "name": "dot_of_ab", "definition": "dot(a,b)", "group": "Ungrouped variables"}, "lenb": {"templateType": "anything", "description": "", "name": "lenb", "definition": "abs(b)", "group": "Ungrouped variables"}, "b": {"templateType": "anything", "description": "", "name": "b", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "group": "Ungrouped variables"}, "lena": {"templateType": "anything", "description": "", "name": "lena", "definition": "abs(a)", "group": "Ungrouped variables"}, "c": {"templateType": "anything", "description": "", "name": "c", "definition": "vector(repeat(random(2..9)*sign(random(1,1)),3))", "group": "Ungrouped variables"}, "ansrad2": {"templateType": "anything", "description": "", "name": "ansrad2", "definition": "precround(arccos(ans2),1)", "group": "Ungrouped variables"}, "lend": {"templateType": "anything", "description": "", "name": "lend", "definition": "abs(d)", "group": "Ungrouped variables"}, "ansrad": {"templateType": "anything", "description": "", "name": "ansrad", "definition": "precround(arccos(ans1),1)", "group": "Ungrouped variables"}}, "parts": [{"scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "gaps": [{"notationStyles": ["plain", "en", "si-en"], "minValue": "ans1-0.005", "mustBeReducedPC": 0, "allowFractions": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "mustBeReduced": false, "unitTests": [], "type": "numberentry", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "maxValue": "ans1+0.005", "marks": "0.5", "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "correctAnswerFraction": false}, {"notationStyles": ["plain", "en", "si-en"], "minValue": "ansrad-0.05", "mustBeReducedPC": 0, "allowFractions": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "mustBeReduced": false, "unitTests": [], "type": "numberentry", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "maxValue": "ansrad+0.05", "marks": "1", "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "correctAnswerFraction": false}, {"notationStyles": ["plain", "en", "si-en"], "minValue": "dot_of_ab-0.001", "mustBeReducedPC": 0, "allowFractions": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "mustBeReduced": false, "unitTests": [], "type": "numberentry", "showCorrectAnswer": true, "customMarkingAlgorithm": "", "maxValue": "dot_of_ab+0.001", "marks": "0.5", "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "correctAnswerFraction": false}], "unitTests": [], "type": "gapfill", "showCorrectAnswer": true, "prompt": "

$\\boldsymbol{a}=\\pmatrix{\\var{a[0]},\\var{a[1]},\\var{a[2]}}$ and $\\boldsymbol{b}=\\pmatrix{\\var{b[0]},\\var{b[1]},\\var{b[2]}}$

\n

$\\boldsymbol{a} \\cdot \\boldsymbol{b}=$ [[2]]

\n

$\\cos({\\theta})=$ [[0]]  (Give your answer to 2d.p.)

\n

$\\theta=$ [[1]](Give your answer, in radians, to 1d.p.)

", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst", "sortAnswers": false}], "statement": "

Find the angle  $ \\theta $  between the following pairs of vectors.

", "functions": {}, "extensions": [], "tags": [], "ungrouped_variables": ["a", "lenb", "c", "b", "lenc", "d", "lend", "ans1", "ans2", "lena", "ansrad", "ansrad2", "dot_of_ab", "dot_of_cd"], "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "advice": "

Note that in this advice, the full calculator display is used in the calculation of each step; any rounding is purely for display clarity.

\n

The dot product of two vectors $\\boldsymbol{a}=\\pmatrix{a_1,a_2,a_3}$ and $\\boldsymbol{b}=\\pmatrix{b_1,b_2,b_3}$ is given by

\n

\\[\\boldsymbol{a\\cdot b}=a_1b_1+a_2b_2+a_3b_3\\]

\n

\n

$\\lvert\\boldsymbol{a}\\rvert=\\sqrt{a_1^2+a_2^2+a_3^2}$ ,$\\lvert\\boldsymbol{b}\\rvert=\\sqrt{b_1^2+b_2^2+b_3^2}$ are the lengths of the vectors $\\boldsymbol{a}$ and $\\boldsymbol{b}$.

\n

\n

and so

\n

\\[\\cos(\\theta)=\\frac{\\boldsymbol{a\\cdot b}}{\\lvert\\boldsymbol{a}\\rvert \\lvert\\boldsymbol{b}\\rvert}=\\frac{a_1b_1+a_2b_2+a_3b_3}{\\lvert\\boldsymbol{a}\\rvert \\lvert\\boldsymbol{b}\\rvert}.\\]

\n

In part a) therefore, we have

\n

\\[\\cos(\\theta)=\\frac{\\var{dot(a,b)}}{\\var{precround(lena,2)}\\times\\var{precround(lenb,2)}}=\\frac{\\var{dot(a,b)}}{\\var{precround(lena*lenb,2)}}=\\var{ans1} \\; \\text{to 2d.p.,}\\]

\n

Which gives an angle $\\theta =\\var{ansrad}$ radians to 1 d.p.

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

Find the dot product and the angle between two vectors

", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "name": "MATH6005 Assessment 2_Q3of6", "preamble": {"js": "", "css": ""}, "type": "question", "contributors": [{"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/"}]}]}], "contributors": [{"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/"}]}