// Numbas version: exam_results_page_options {"name": "Vectors: Scalar Product 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Vectors: Scalar Product 2", "tags": [], "metadata": {"description": "

Given three 3-dimensional vectors $\\mathbf a$, $\\mathbf b$ and $\\mathbf c$, calculate the scalar product between $\\mathbf a$ and $\\mathbf b$, the angle between $\\mathbf a$ and $\\mathbf b$, and $\\mathbf a (\\mathbf b \\cdot \\mathbf c)$,

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Given the vectors

\n

\\[ \\mathbf a = \\var{a},\\quad \\mathbf b  = \\var{b}, \\quad \\mathbf c = \\var{c}; \\]

\n

", "advice": "

To answer these questions, we want to use the equations for the scalar product. Recall:

\n

For the vectors $ \\mathbf v = \\pmatrix{v_1 \\\\ v_2 \\\\ v_3},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2 \\\\ w_3},$

\n

\\[ \\begin{split} \\mathbf{v \\cdot w} &\\,= v_1 \\times w_1 + v_2 \\times w_2 + v_3 \\times w_3 \\\\\\\\ \\mathbf{v \\cdot w} &\\,= |\\mathbf v| |\\mathbf w | \\cos(\\theta), \\end{split} \\]

\n

where $|\\mathbf v|$ and $|\\mathbf w|$ are the magnitudes of the vectors, and $\\theta$ is the angle between the vectors.

\n

So, for the vectors $\\mathbf a = \\var{a}$ and $ \\mathbf b  = \\var{b}$,

\n

\\[ \\begin{split} |\\mathbf a| &\\,= \\simplify[!collectNumbers]{sqrt({a[0]}^2+{a[1]}^2+{a[2]}^2)}  \\\\ &\\,=\\var{precround(length(a),2)}, \\end{split} \\]

\n

\\[ \\begin{split} |\\mathbf b| &\\,= \\simplify[!collectNumbers]{sqrt({b[0]}^2+{b[1]}^2+{b[2]}^2)}  \\\\ &\\,=\\var{precround(length(b),2)}, \\end{split} \\]

\n

and

\n

\\[ \\begin{split} \\mathbf{a \\cdot b} &\\,= \\simplify[alwaysTimes,!collectNumbers]{{a[0]}*{b[0]}+{a[1]}*{b[1]}+{a[2]}*{b[2]}} \\\\ &\\,= \\var{adotb}. \\end{split} \\]

\n

Using these results to find the angle between $\\mathbf a$ and $\\mathbf b$:

\n

\\[ \\begin{split} \\cos(\\theta) &\\,= \\frac{\\mathbf{a \\cdot b}}{|\\mathbf a| |\\mathbf b |} , \\\\ \\\\ &\\,=\\frac{\\var{adotb}}{\\var{precround(length(a),2)}\\times\\var{precround(length(b),2)}} \\\\\\\\ &\\,=\\var{precround(adotb/(length(a)*length(b)),2)}.\\end{split} \\]

\n

Therefore, \\[ \\begin{split} \\theta &\\,= \\cos^{-1}(\\var{precround(adotb/(length(a)*length(b)),2)}) \\\\ &\\,= \\var{angleab}^\\circ . \\end{split} \\]

\n

To calculate $\\mathbf a \\left( \\mathbf{b \\cdot c} \\right)$, we want to first find the dot product between $\\mathbf b$ and $\\mathbf c$:

\n

\\[ \\begin{split} \\mathbf{b \\cdot c} &\\,= \\simplify[alwaysTimes,!collectNumbers]{{b[0]}*{c[0]}+{b[1]}*{c[1]}+{b[2]}*{c[2]}} \\\\ &\\,= \\var{dot(b,c)}. \\end{split} \\]

\n

Therefore,

\n

\\[ \\begin{split} \\mathbf a \\left( \\mathbf{b \\cdot c} \\right) &\\,=  \\var{dot(b,c)} \\var{a} \\\\\\\\ &\\,= \\var{abdotc}. \\end{split} \\]

\n

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(random(1..7),random(-4..4 except [0,1]),random(-3..5))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(random(-2..7),random(3..8),random(-5..5))", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "vector(random(-4..3 except [a[0],b[0]]),random(2..7),random(-6..-1))", "description": "", "templateType": "anything", "can_override": false}, "angleab": {"name": "angleab", "group": "Ungrouped variables", "definition": "precround(arccos(adotb/(length(a)*length(b)))*(180/pi),2)", "description": "", "templateType": "anything", "can_override": false}, "adotb": {"name": "adotb", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything", "can_override": false}, "abdotc": {"name": "abdotc", "group": "Ungrouped variables", "definition": "dot(b,c)*a", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "adotb", "angleab", "abdotc"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the scalar product between $\\mathbf a$ and $\\mathbf b$:

\n

$\\mathbf{a \\cdot b} = $[[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{adotb}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The angle between vectors $\\mathbf a$ and $\\mathbf b$:

\n

$\\theta = $[[0]]$^\\circ$

\n

(Give your answer to 2 decimal places where necessary)

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{angleab}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$\\mathbf a \\left(\\mathbf{b \\cdot c}\\right) = $ [[0]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "vector(abdotc[0],abdotc[1])", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}]}], "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}]}