// Numbas version: exam_results_page_options {"name": "Multiply 2x2, 2x1 and 1x2 matrices", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"B": {"templateType": "anything", "group": "Ungrouped variables", "definition": "matrix([random(1..4),random(-1,1,2)],[random(-1,0,1),random(-4,-3,-2,-1,1,2,3,5)])", "description": "", "name": "B"}, "w": {"templateType": "anything", "group": "Ungrouped variables", "definition": "matrix([[random(-5..5),random(-7..7 except 0)]])", "description": "", "name": "w"}, "v": {"templateType": "anything", "group": "Ungrouped variables", "definition": "matrix([[random(-2..2)],[random(1..9)]])", "description": "", "name": "v"}}, "ungrouped_variables": ["B", "w", "v"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Multiply 2x2, 2x1 and 1x2 matrices", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"allowFractions": false, "correctAnswer": "w*v", "markPerCell": false, "allowResize": false, "correctAnswerFractions": false, "numRows": 1, "scripts": {}, "type": "matrix", "numColumns": 1, "tolerance": 0, "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

$\\mathbf{w} \\; \\mathbf{v} = $ [[0]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"allowFractions": false, "correctAnswer": "w*B", "markPerCell": false, "allowResize": false, "correctAnswerFractions": false, "numRows": 1, "scripts": {}, "type": "matrix", "numColumns": "2", "tolerance": 0, "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

$\\mathbf{w} \\mathbf{B} = $ [[0]]

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"allowFractions": false, "correctAnswer": "B*v", "markPerCell": false, "allowResize": false, "correctAnswerFractions": false, "numRows": "2", "scripts": {}, "type": "matrix", "numColumns": 1, "tolerance": 0, "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

$\\mathbf{B} \\mathbf{v} = $ [[0]]

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Answer the following questions on matrices.

\n

Let

\n

\\begin{align} \\mathbf{v} &= \\var{v}, & \\mathbf{B} &= \\var{B}, & \\mathbf{w} &= \\var{w} \\end{align}

", "tags": ["checked2015", "MAS1602", "matrices", "matrix", "matrix multiplication", "matrix product", "multiplication of matrices", "multiply matrix", "product of matrices", "tested1"], "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "

10/07/2012:

\n

Added tags.

\n

Perhaps it would be worthwhile restraining all components of the three matrices to be non zero?

\n

Question appears to be working correctly.

\n

24/12/2012:

\n

Calculation checked, OK. Added tested1 tag.

", "licence": "Creative Commons Attribution 4.0 International", "description": "

Very elementary matrix multiplication. 

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a)

\n

\\begin{align}
\\mathbf{w} \\mathbf{v} &= \\simplify{{w}*{v}} \\\\
&= \\simplify[]{{w[0][0]}*{v[0][0]}+{w[0][1]}*{v[1][0]}} \\\\
&= \\var{w*v}
\\end{align}

\n

b)

\n

Since $\\mathbf{w}$ is a $1 \\times 2$ matrix and has the same number of columns, $2$, as the rows in the $2 \\times 2$ matrix $\\mathbf{B}$ we can multiply and form $\\mathbf{w} \\mathbf{B}$ which is a $1 \\times 2$ row vector:

\n

\\begin{align}
\\mathbf{wB} &= \\simplify{{w}*{B}} \\\\
&= \\begin{pmatrix} \\simplify[]{ {w[0][0]}*{B[0][0]} + {w[0][1]}*{B[1][0]} }, & \\simplify[]{ {w[0][0]}*{B[0][1]} + {w[0][1]}*{B[1][1]} } \\end{pmatrix} \\\\
&= \\var{w*B}
\\end{align}

\n

c)

\n

Since $\\mathbf{B}$ is a $2 \\times 2$ matrix and has the same number of columns, $2$, as the rows in $\\mathbf{v}$ we can form the matrix $\\mathbf{Bv}$ which will be a $2 \\times 1$ column vector.

\n

We find this vector to be:

\n

\\begin{align}
\\mathbf{Bv} &= \\simplify{{B}*{v}} \\\\
&= \\begin{pmatrix} \\simplify[]{ {B[0][0]}*{v[0][0]} + {B[0][1]}*{v[1][0]} } \\\\ \\simplify[]{ {B[1][0]}*{v[0][0]} + {B[1][1]}*{v[1][0]} } \\end{pmatrix} \\\\
&= \\var{B*v}
\\end{align}

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}