// Numbas version: finer_feedback_settings {"name": "My First Exam", "metadata": {"description": "

A couple of questions. Some hard, some easy.

", "licence": "Creative Commons Attribution 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", ""], "variable_overrides": [[], [], [], []], "questions": [{"name": "Subtraction", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["algorithms", "minus", "subtracting", "subtraction", "take away"], "metadata": {"description": "

The subtraction algortihm using the borrow and pay back method with integers.

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

Write the following question down on paper and evaluate it without using a calculator.

\n

If you are unsure of how to do a question, click on Show steps to see the full working. Then, once you understand how to do the question, click on Try another question like this one to start again.

", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"newtopten": {"name": "newtopten", "group": "c", "definition": "if(unitdiff>=0,top[1],top[1]-1)", "description": "", "templateType": "anything", "can_override": false}, "ansunit": {"name": "ansunit", "group": "c", "definition": "mod(ans,10)", "description": "", "templateType": "anything", "can_override": false}, "hundiff": {"name": "hundiff", "group": "c", "definition": "if(tendiff>=0,top[2]-bot[2],top[2]-1-bot[2])", "description": "", "templateType": "anything", "can_override": false}, "botnum": {"name": "botnum", "group": "c", "definition": "bot[0]+bot[1]*10+bot[2]*100", "description": "", "templateType": "anything", "can_override": false}, "ansten": {"name": "ansten", "group": "c", "definition": "mod(floor(ans/10),10)", "description": "", "templateType": "anything", "can_override": false}, "tendiff": {"name": "tendiff", "group": "c", "definition": "if(unitdiff>=0,top[1]-bot[1],top[1]-1-bot[1])", "description": "", "templateType": "anything", "can_override": false}, "unitdiff": {"name": "unitdiff", "group": "c", "definition": "top[0]-bot[0]", "description": "", "templateType": "anything", "can_override": false}, "bot": {"name": "bot", "group": "c", "definition": "random(\nif(top[0]<9,[random(top[0]+1..9), random(top[1]..9), random(1..top[2]-1)],\n if(top[1]<9,[random(top[0]..9), random(top[1]+1..9), random(1..top[2]-1)],\"error\")),\nif(top[1]<9,[random(0..top[0]), random(top[1]+1..9), random(1..top[2]-1)],\n if(top[1]=9,[random(top[0]..9), random(0..9), random(1..top[2]-1)],\"error\"))\n)\n", "description": "

This should force some borrowing and paying back, and that the final answer is positive.

", "templateType": "anything", "can_override": false}, "newtophun": {"name": "newtophun", "group": "c", "definition": "if(tendiff>=0,top[2],top[2]-1)", "description": "", "templateType": "anything", "can_override": false}, "topnum": {"name": "topnum", "group": "c", "definition": "top[0]+top[1]*10+top[2]*100", "description": "", "templateType": "anything", "can_override": false}, "anshun": {"name": "anshun", "group": "c", "definition": "mod(floor(ans/100),10)", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "c", "definition": "topnum-botnum", "description": "", "templateType": "anything", "can_override": false}, "top": {"name": "top", "group": "c", "definition": "random([random(0..9),random(1..8),random(2..9)],[random(0..8),random(1..9),random(2..9)])", "description": "

Borrowing from the hundreds to do the units is not covered with this randomisation. We will do that in another part.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "c", "variables": ["top", "bot", "topnum", "botnum", "ans", "unitdiff", "tendiff", "hundiff", "ansunit", "ansten", "anshun", "newtopten", "newtophun"]}], "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": "

$\\var{topnum}-\\var{botnum} = $ [[0]]

", "stepsPenalty": "1", "steps": [{"type": "information", "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": "

Generally we set up $\\var{topnum}-\\var{botnum}$ with the ones, tens and hundreds columns lined up vertically:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{top[2]}$$\\var{top[1]}$$\\var{top[0]}$$-$
$\\var{bot[2]}$$\\var{bot[1]}$$\\var{bot[0]}$
$\\phantom{0}$
\n

\n

Now we try to subtract the digits in the ones column.

\n

Since this is $\\var{ansunit}$ we write $\\var{ansunit}$ under the line in the ones column.

\n

Since we can't take $\\var{bot[0]}$ away from $\\var{top[0]}$ (without using negative numbers) we borrow a ten from the tens column. This means we cross out the $\\var{top[1]}$ in the tens column and replace it with a $\\var{top[1]-1}$, and the $\\var{top[0]}$ becomes a $\\var{10+top[0]}$. Now we can do $\\var{10+top[0]}-\\var{bot[0]}$, and write the result, $\\var{ansunit}$, under the line in the ones column. 

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\overset{\\phantom{1}}{\\var{top[2]}}$$\\overset{\\color{red}{\\var{newtopten}}}{\\var{top[1]}\\mkern-7.5mu\\color{red}/}$ $\\overset{\\phantom{1}}{\\var{top[1]}}$$\\color{red}{^1}\\overset{\\phantom{1}}{\\var{top[0]}}$ $\\overset{\\phantom{1}}{\\var{top[0]}}$$-$
$\\var{bot[2]}$$\\var{bot[1]}$$\\var{bot[0]}$
$\\color{red}{\\var{ansunit}}$
\n

\n

Now we try to subtract the digits in the tens column.

\n

Since this is $\\var{ansten}$ we write $\\var{ansten}$ under the line in the tens column.

\n

Since we can't take $\\var{bot[1]}$ away from $\\var{newtopten}$ (without using negative numbers) we borrow a hundred from the hundred column. This means we cross out the $\\var{top[2]}$ in the hundreds column and replace it with a $\\var{top[2]-1}$, and the $\\var{newtopten}$ in the tens column becomes a $\\var{10+newtopten}$. Now we can do $\\var{10+newtopten}-\\var{bot[1]}$, and write the result, $\\var{ansten}$, under the line in the tens column. 

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

$\\overset{\\color{red}{\\var{newtophun}}}{\\var{top[2]}\\mkern-7.5mu\\color{red}{/}}$ $\\overset{\\phantom{1}}{\\var{top[2]}}$

\n
\n

$\\overset{\\color{red}{1}\\var{newtopten}}{\\var{top[1]}\\mkern-7.5mu/}$ $\\overset{\\var{newtopten}}{\\var{top[1]}\\mkern-7.5mu/}$ $\\color{red}{^1}\\overset{\\phantom{1}}{\\var{top[1]}}$ $\\overset{\\phantom{1}}{\\var{top[1]}}$

\n
${^1}\\overset{\\phantom{1}}{\\var{top[0]}}$ $\\overset{\\phantom{1}}{\\var{top[0]}}$$-$
$\\var{bot[2]}$$\\var{bot[1]}$$\\var{bot[0]}$
$\\color{red}{\\var{ansten}}$$\\var{ansunit}$
\n

\n

Now we try to subtract the digits in the hundreds column.

\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

$\\overset{\\var{newtophun}}{\\var{top[2]}\\mkern-7.5mu/}$ $\\overset{\\phantom{1}}{\\var{top[2]}}$

\n
\n

$\\overset{{1}\\var{newtopten}}{\\var{top[1]}\\mkern-7.5mu/}$ $\\overset{\\var{newtopten}}{\\var{top[1]}\\mkern-7.5mu/}$ ${^1}\\overset{\\phantom{1}}{\\var{top[1]}}$ $\\overset{\\phantom{1}}{\\var{top[1]}}$

\n
${^1}\\overset{\\phantom{1}}{\\var{top[0]}}$ $\\overset{\\phantom{1}}{\\var{top[0]}}$$-$
$\\var{bot[2]}$$\\var{bot[1]}$$\\var{bot[0]}$
$\\color{red}{\\var{anshun}}$$\\var{ansten}$$\\var{ansunit}$
\n

\n

The answer is therefore $\\var{ans}$.

"}], "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ans", "maxValue": "ans", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Lengths of vectors and dot products", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Jessica Claridge", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1728/"}], "tags": [], "metadata": {"description": "

Calculations of the lengths of two 3D vectors, the distance between their terminal points, their sum, difference, and dot and cross products.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Given the vectors $\\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]}}$ find:

", "advice": "

For the general 3-component vectors $\\boldsymbol{a}=\\pmatrix{a_1,a_2,a_3}$ and $\\boldsymbol{b}=\\pmatrix{b_1,b_2,b_3}$, we have

\n

a)

\n

Lengths: $a=\\lvert\\boldsymbol{a}\\rvert=\\sqrt{a_1^2+a_2^2+a_3^2}$ and $b=\\lvert\\boldsymbol{b}\\rvert=\\sqrt{b_1^2+b_2^2+b_3^2}$, which are scalar quantities.

\n

 

\n

b)

\n

Distance between the terminal points: $d=\\sqrt{(a_1-b_1)^2+(a_2-b_2)^2+(a_3-b_3)^2}$, which is a scalar quantity.

\n

 

\n

c)

\n

Sum $\\boldsymbol{a}+\\boldsymbol{b}=\\pmatrix{a_1+b_1,a_2+b_2,a_3+b_3}$ and difference $\\boldsymbol{a}-\\boldsymbol{b}=\\pmatrix{a_1-b_1,a_2-b_2,a_3-b_3}$, which are vector quantities.

\n

 

\n

d)

\n

Dot product: $\\boldsymbol{a\\cdot b}=a_1b_1+a_2b_2+a_3b_3$, which is a scalar quantity.

\n

 

\n

e)

\n

Cross product: $\\boldsymbol{a}\\times\\boldsymbol{b}=\\pmatrix{a_2b_3-a_3b_2,a_3b_1-a_1b_3,a_1b_2-a_2b_1}$, which is a vector quantity.

\n

 

\n

In this question, therefore, we have:

\n

a)

\n

Lengths: $a=\\lvert\\boldsymbol{a}\\rvert=\\sqrt{\\var{a[0]^2}+\\var{a[1]^2}+\\var{a[2]^2}}=\\var{lena}$ and $b=\\lvert\\boldsymbol{b}\\rvert=\\sqrt{\\var{b[0]^2}+\\var{b[1]^2}+\\var{b[2]^2}}=\\var{lenb}$.

\n

 

\n

b)

\n

Distance between the terminal points: $d=\\sqrt{(\\simplify[std]{{a[0]}-{b[0]}})^2+(\\simplify[std]{{a[1]}-{b[1]}})^2+(\\simplify[std]{{a[2]}-{b[2]}})^2}=\\var{dist}$.

\n

 

\n

c)

\n

Sum $\\boldsymbol{a}+\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[0]}+{b[0]}},\\simplify[std]{{a[1]}+{b[1]}},\\simplify[std]{{a[2]}+{b[2]}}}=\\pmatrix{\\var{sumab[0]},\\var{sumab[1]},\\var{sumab[2]}}$ and difference $\\boldsymbol{a}-\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[0]}-{b[0]}},\\simplify[std]{{a[1]}-{b[1]}},\\simplify[std]{{a[2]}-{b[2]}}}=\\pmatrix{\\var{diffab[0]},\\var{diffab[1]},\\var{diffab[2]}}$.

\n

 

\n

d)

\n

Dot product: $\\boldsymbol{a\\cdot b}=(\\var{a[0]}\\times\\var{b[0]})+(\\var{a[1]}\\times\\var{b[1]})+(\\var{a[2]}\\times\\var{b[2]})=\\var{dotab}$.

\n

 

\n

e)

\n

Cross product: $\\boldsymbol{a}\\times\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[1]*b[2]}-{a[2]*b[1]}},\\simplify[std]{{a[2]*b[0]}-{a[0]*b[2]}},\\simplify[std]{{a[0]*b[1]}-{a[1]*b[0]}}}=\\pmatrix{\\var{crossab[0]},\\var{crossab[1]},\\var{crossab[2]}}$.

", "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "description": "", "templateType": "anything"}, "crossab": {"name": "crossab", "group": "Ungrouped variables", "definition": "cross(a,b)", "description": "", "templateType": "anything"}, "lena": {"name": "lena", "group": "Ungrouped variables", "definition": "precround(abs(a),2)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "description": "", "templateType": "anything"}, "dotab": {"name": "dotab", "group": "Ungrouped variables", "definition": "dot(a,b)", "description": "", "templateType": "anything"}, "sumab": {"name": "sumab", "group": "Ungrouped variables", "definition": "a+b", "description": "", "templateType": "anything"}, "dist": {"name": "dist", "group": "Ungrouped variables", "definition": "precround(abs(a-b),2)", "description": "", "templateType": "anything"}, "lenb": {"name": "lenb", "group": "Ungrouped variables", "definition": "precround(abs(b),2)", "description": "", "templateType": "anything"}, "diffab": {"name": "diffab", "group": "Ungrouped variables", "definition": "a-b", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "lenb", "lena", "b", "dist", "dotab", "diffab", "sumab", "crossab"], "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": "

Their lengths: $a=\\lvert\\boldsymbol{a}\\rvert=$ [[0]], $b=\\lvert\\boldsymbol{b}\\rvert=$ [[1]].  (Enter your answers to 2d.p.)

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lena-0.01", "maxValue": "lena+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "lenb-0.01", "maxValue": "lenb+0.01", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "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": "

Their dot product $\\boldsymbol{a\\cdot b}=$ [[0]].

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "dotab", "maxValue": "dotab", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Dot and cross product combinations", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}], "parts": [{"displayType": "radiogroup", "layout": {"type": "all", "expression": ""}, "choices": ["$\\boldsymbol{(v\\cdot w)\\cdot u}$", "$\\boldsymbol{(v\\cdot w)u}$", "$\\boldsymbol{(v\\cdot w)\\times u}$", "$\\boldsymbol{(v\\times w)\\times u}$", "

$\\boldsymbol{(v\\times w)\\cdot u}$

"], "variableReplacementStrategy": "originalfirst", "matrix": [[0, 0, 0.4], [0, 0.4, 0], [0, 0, 0.4], [0, 0.4, 0], [0.4, 0, 0]], "shuffleChoices": true, "type": "m_n_x", "maxAnswers": 0, "marks": 0, "warningType": "none", "scripts": {}, "minMarks": 0, "minAnswers": 0, "maxMarks": 0, "shuffleAnswers": true, "showCorrectAnswer": true, "variableReplacements": [], "answers": ["

Scalar

", "

Vector

", "

Undefined

"]}], "variables": {}, "ungrouped_variables": [], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "variable_groups": [], "showQuestionGroupNames": false, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

Given the vectors $\\boldsymbol{v}$, $\\boldsymbol{w}$, $\\boldsymbol{u}$ in $\\mathbb{R}^3$, state whether the following quantities are scalars (real numbers), vectors (elements of $\\mathbb{R}^3$) or undefined.

\n

In this question, the symbol $\\cdot$ denotes the inner product and $\\times$ always denotes the cross product.

", "tags": ["checked2015", "cross product", "dot product", "inner product", "MAS1602", "mas1602", "scalar product", "scalars", "unused", "vector", "Vector", "vector product", "vectors"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "\n \t\t

15/07/2012:

\n \t\t

Added tags.

\n \t\t

16/07/2012:

\n \t\t

Added tags.

\n \t\t

 

\n \t\t

 

\n \t\t", "licence": "Creative Commons Attribution 4.0 International", "description": "

Determine if various combinations of vectors are defined or not.

"}, "advice": "

1. $\\boldsymbol{(v\\cdot w)\\cdot u}$ is undefined as $\\boldsymbol{v\\cdot w}$ is a scalar and we cannot take the inner product of a scalar with the vector $\\boldsymbol{u}$.

\n

2. $\\boldsymbol{(v\\cdot w) u}$ is a vector and is a scalar multiple of $\\boldsymbol{u}$ as $\\boldsymbol{v \\cdot w}$ is a scalar.

\n

3. $\\boldsymbol{(v \\cdot w)\\times u}$ is undefined as $\\boldsymbol{v\\cdot w}$ is a scalar and the cross product is only defined between vectors.

\n

4. $\\boldsymbol{(v\\times w)\\times u}$ is a vector as $\\boldsymbol{v \\times w}$ and $\\boldsymbol{u}$ are vectors and the cross product between vectors produces a vector.

\n

5. $\\boldsymbol{(v\\times w)\\cdot u}$ is a scalar as $\\boldsymbol{v \\times w}$ and $\\boldsymbol{u}$ are vectors and the inner or dot product is between vectors and produces a scalar.

"}, {"name": "Vectors: Scalar Product 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben McGovern", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4872/"}], "tags": [], "metadata": {"description": "

Given three 2-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},\\, \\mathbf w = \\pmatrix{w_1 \\\\ w_2},$

\n

\\[ \\begin{split} \\mathbf{v \\cdot w} &\\,= v_1 \\times w_1 + v_2 \\times w_2 \\\\\\\\ \\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)}  \\\\ &\\,=\\var{precround(length(a),2)}, \\end{split} \\]

\n

\\[ \\begin{split} |\\mathbf b| &\\,= \\simplify[!collectNumbers]{sqrt({b[0]}^2+{b[1]}^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]}} \\\\ &\\,= \\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]}} \\\\ &\\,= \\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": {}, "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]))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "vector(random(-2..7),random(3..8))", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "vector(random(-4..3 except [a[0],b[0]]),random(2..9))", "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", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": "", "allowAttemptDownload": false, "downloadEncryptionKey": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "George Li", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/20490/"}], "extensions": [], "custom_part_types": [], "resources": []}