// Numbas version: finer_feedback_settings {"name": "Matrix Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Matrix Multiplication", "tags": [], "metadata": {"description": "
Multiplication of two matrices.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "Given two matrices:
\n$$
\\boldsymbol{A}=\\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a13}\\\\ \\var{a21}&\\var{a22}&\\var{a23}\\\\ \\end{pmatrix} ,\\boldsymbol{B}=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\var{b31}&\\var{b32}\\\\\\end{pmatrix}
$$
Calculate the following matrix multiplications.
\n", "advice": "Remember multiplication of matrices is carried out by multiplying the rows of the first matrix by the columns of the second matrix
\na)
\n$$
\\begin{aligned}
\\boldsymbol{A}\\boldsymbol{B} &= \\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a13}\\\\ \\var{a21}&\\var{a22}&\\var{a23} \\end{pmatrix}\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22} \\\\ \\var{b31}&\\var{b32}\\end{pmatrix} \\\\
&= \\begin{pmatrix}\\var{a11}\\times\\var{b11}+\\var{a12}\\times\\var{b21}+\\var{a13}\\times\\var{b31}&\\var{a11}\\times\\var{b12}+\\var{a12}\\times\\var{b22}+\\var{a13}\\times\\var{b32} \\\\ \\var{a21}\\times\\var{b11}+\\var{a22}\\times\\var{b21}+\\var{a23}\\times\\var{b31}&\\var{a21}\\times\\var{b12}+\\var{a22}\\times\\var{b22}+\\var{a23}\\times\\var{b32}\\end{pmatrix} \\\\
&=\\begin{pmatrix}\\simplify{{a11}*{b11}+{a12}*{b21}+{a13}*{b31}}&\\simplify{{a11}*{b12}+{a12}*{b22}+{a13}*{b32}}\\\\ \\simplify{{a21}*{b11}+{a22}*{b21}+{a23}*{b31}}&\\simplify{{a21}*{b12}+{a22}*{b22}+{a23}*{b32}}\\end{pmatrix}
\\end{aligned}
$$
b)
\nTo evaluate \\(\\boldsymbol{B}\\boldsymbol{A}\\) we swap their positions and this time multiply the rows of \\(\\boldsymbol{B}\\) by the columns of \\(\\boldsymbol{A}\\)
\n$$
\\begin{aligned}
\\boldsymbol{B}\\boldsymbol{A} &=
\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22} \\\\ \\var{b31}&\\var{b32}\\end{pmatrix}
\\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a13}\\\\ \\var{a21}&\\var{a22}&\\var{a23} \\end{pmatrix} \\\\
&=
\\begin{pmatrix}
\\var{b11} \\times \\var{a11} + \\var{b12} \\times \\var{a21} & \\var{b11} \\times \\var{a12} + \\var{b12} \\times \\var{a22} & \\var{b11} \\times \\var{a13} + \\var{b12} \\times \\var{a23} \\\\
\\var{b21} \\times \\var{a11} + \\var{b22} \\times \\var{a21} & \\var{b21} \\times \\var{a12} + \\var{b22} \\times \\var{a22} & \\var{b21} \\times \\var{a13} + \\var{b22} \\times \\var{a23} \\\\
\\var{b31} \\times \\var{a11} + \\var{b32} \\times \\var{a21} & \\var{b31} \\times \\var{a12} + \\var{b32} \\times \\var{a22} & \\var{b31} \\times \\var{a13} + \\var{b32} \\times \\var{a23} \\\\
\\end{pmatrix} \\\\
&=
\\begin{pmatrix}
\\simplify{{b11}*{a11}+{b12}*{a21}} & \\simplify{{b11} *{a12} + {b12} *{a22}} & \\simplify{{b11}*{a13} + {b12}*{a23}} \\\\
\\simplify{{b21}*{a11}+{b22}*{a21}} & \\simplify{{b21}*{a12} + {b22}*{a22}} & \\simplify{{b21}*{a13} + {b22}*{a23}} \\\\
\\simplify{{b31}*{a11}+{b32}*{a21}} & \\simplify{{b31}*{a12} + {b32}*{a22}} & \\simplify{{b31}*{a13} + {b32}*{a23}} \\\\
\\end{pmatrix} \\\\
\\end{aligned}
$$
Calculate the product $\\boldsymbol{AB}$
\nFirst set up the size of the answer matrix (choose the correct number of rows and columns in the boxes) and then input the entries:
\n$\\boldsymbol{AB} =$ [[0]]
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([\n [ab11,ab12],\n [ab21,ab22]\n])", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "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": "Calculate the product $\\boldsymbol{BA}$
\nFirst set up the size of the answer matrix (choose the correct number of rows and columns in the boxes) and then input the entries:
\n$\\boldsymbol{BA} =$ [[0]]
", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([\n [ba11,ba12,ba13],\n [ba21,ba22,ba23],\n [ba31,ba32,ba33]\n])", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}]}