// Numbas version: exam_results_page_options {"name": "Matrices: Multiplication 03", "extensions": [], "custom_part_types": [], "resources": [["question-resources/matrixMult.png", "/srv/numbas/media/question-resources/matrixMult.png"], ["question-resources/Matrix_Multiplication_02.gif", "/srv/numbas/media/question-resources/Matrix_Multiplication_02.gif"], ["question-resources/Matrix_Multiplication_01.gif", "/srv/numbas/media/question-resources/Matrix_Multiplication_01.gif"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Matrices: Multiplication 03", "tags": [], "metadata": {"description": "

Multiplying matrices (pre-defined sizes in answers)

\n

This set is designed to emphasise non-commutativity.

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

An $n \\times p$ matrix $A$ can be multiplied by a $p \\times n$ matrix $B$ to form an $n \\times m$ matrix $AB=C$.

\n

The number of columns of $A$ must match the number of rows of $B$.

\n

\n

The element in the $i^{th}$ row and $j^{th}$ column of $C$ is obtained by multiplying the $i^{th}$ row of $A$ with the $j^{th}$ column of $B$.

", "advice": "

We are asked to carry out matix multiplications.

\n

\n

First of all, you should always check that the multiplication is even possible. Write down the dimensions (in order) of the two matrices:

\n

\n

The number of columns in the first must match the number of rows in the second. As a bonus this will also give you the dimensions of the product matrix.

\n

The multiplication is then carried out moving across the rows of the first matrix and down the columns of the second:

\n

\n

\n

Using this techniques will give:

\n

$A_1A_2=\\var{A1}\\var{A2}$

\n

\n

$A_1 A_2=\\var{prodA}$ 

\n

\n

$A_2 A_1=\\var{A2}\\var{A1}$

\n

$A_2 A_1=\\var{prodA2}$ 

\n

 

\n

$B_1B_2=\\var{B1}\\var{B2}$

\n

$B_1B_2=\\var{prodB}$

\n

 

\n

$B_2B_1=\\var{B2}\\var{B1}$

\n

$B_2B_1=\\var{prodB2}$

\n

 

\n

Hopefully, you can see that when the multiplication is reversed we get a different answer! That is very different to what we see in conventional arithmatic.

\n

With \"normal\" multiplication   $3 \\times 2 = 2 \\times 3$, we say that multiplication is commutative - the order does not matter. That is not the case with matrix multiplication.

\n

It is clear that $AB$ and $BA$ are not in general the same. In fact it is the exception that $AB = BA$. In the special case in which $AB = BA$ we say that the matrices $A$ and $B$ commute.

\n

", "rulesets": {}, "extensions": [], "variables": {"n1": {"name": "n1", "group": "Matrix A", "definition": "2", "description": "", "templateType": "number"}, "m1": {"name": "m1", "group": "Matrix A", "definition": "2", "description": "", "templateType": "number"}, "A1": {"name": "A1", "group": "Matrix A", "definition": "transpose(matrix(repeat(repeat(random(0..9),n1),m1)))", "description": "", "templateType": "anything"}, "A2": {"name": "A2", "group": "Matrix A", "definition": "transpose(matrix(repeat(repeat(random(0..9),m1),n1)))", "description": "", "templateType": "anything"}, "ProdA": {"name": "ProdA", "group": "Matrix A", "definition": "{A1}{A2}", "description": "", "templateType": "anything"}, "n2": {"name": "n2", "group": "Matrix B", "definition": "3", "description": "", "templateType": "number"}, "m2": {"name": "m2", "group": "Matrix B", "definition": "3", "description": "", "templateType": "number"}, "B1": {"name": "B1", "group": "Matrix B", "definition": "transpose(matrix(repeat(repeat(random(0..9),n2),m2)))", "description": "", "templateType": "anything"}, "B2": {"name": "B2", "group": "Matrix B", "definition": "transpose(matrix(repeat(repeat(random(0..9),m2),n2)))", "description": "", "templateType": "anything"}, "ProdB": {"name": "ProdB", "group": "Matrix B", "definition": "{B1}{B2}", "description": "", "templateType": "anything"}, "n3": {"name": "n3", "group": "Matrix C", "definition": "random(2..4)", "description": "", "templateType": "anything"}, "m3": {"name": "m3", "group": "Matrix C", "definition": "random(1..1)", "description": "", "templateType": "anything"}, "C1": {"name": "C1", "group": "Matrix C", "definition": "transpose(matrix(repeat(repeat(random(0..9),n3),m3)))", "description": "", "templateType": "anything"}, "m3a": {"name": "m3a", "group": "Matrix C", "definition": "random(2..4)", "description": "", "templateType": "anything"}, "C2": {"name": "C2", "group": "Matrix C", "definition": "transpose(matrix(repeat(repeat(random(0..9),m3),m3a)))", "description": "", "templateType": "anything"}, "prodC": {"name": "prodC", "group": "Matrix C", "definition": "{C1}{C2}", "description": "", "templateType": "anything"}, "ProdA2": {"name": "ProdA2", "group": "Matrix A", "definition": "{A2}{A1}", "description": "", "templateType": "anything"}, "ProdB2": {"name": "ProdB2", "group": "Matrix B", "definition": "{B2}{B1}", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Matrix A", "variables": ["n1", "m1", "A1", "A2", "ProdA", "ProdA2"]}, {"name": "Matrix B", "variables": ["n2", "m2", "B1", "B2", "ProdB", "ProdB2"]}, {"name": "Matrix C", "variables": ["n3", "m3", "C1", "m3a", "C2", "prodC"]}], "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": "

Carry out the following multiplications:

\n

 

\n

$A_1A_2=\\var{A1}\\var{A2}$

\n

$A_1 A_2=$ [[0]]

\n

\n

$A_2 A_1=\\var{A2}\\var{A1}$

\n

$A_2 A_1=$ [[1]]

\n

 

\n

$B_1B_2=\\var{B1}\\var{B2}$

\n

$B_1B_2=$ [[2]]

\n

  

\n

$B_2B_1=\\var{B2}\\var{B1}$

\n

$B_2B_1=$ [[3]]

\n

 

\n

From these results, what can you conclude about matrix multiplication in general?

\n

[[4]]

\n

", "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": "{ProdA}", "correctAnswerFractions": false, "numRows": "{n1}", "numColumns": "{n1}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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": "{ProdA2}", "correctAnswerFractions": false, "numRows": "{n1}", "numColumns": "{n1}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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": "{prodB}", "correctAnswerFractions": false, "numRows": "n2", "numColumns": "m2", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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": "ProdB2", "correctAnswerFractions": false, "numRows": "{n2}", "numColumns": "{n2}", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["$AB=BA$", "$AB \\ne BA$\n
\n
\n
", "$AB \\approx BA$", "$AB < BA$"], "matrix": [0, "1", 0, 0], "distractors": ["", "", "", ""]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}]}]}], "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}]}