// Numbas version: exam_results_page_options {"name": "Matrices: Multiplication 01", "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 01", "tags": [], "metadata": {"description": "
Multiplying matrices (pre-defined sizes in answers)
\nAn $n \\times p$ matrix $A$ can be multiplied by a $p \\times n$ matrix $B$ to form an $n \\times m$ matrix $AB=C$.
\nThe number of columns of $A$ must match the number of rows of $B$.
\n\nThe 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": "First of all, you should always check that the multiplication is even possible. Write down the dimensions (in order) of the two matrices:
\n\nThe 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.
\nThe multiplication is then carried out moving across the rows of the first matrix and down the columns of the second:
\n\n\nUsing this techniques will give:
\n$A_1A_2=\\var{A1}\\var{A2}$
\n\n$A_1 A_2=\\var{prodA}$
\n\n$B_1B_2=\\var{B1}\\var{B2}$
\n$B_1 B_2=\\var{prodB}$
\n\n
$C_1C_2=\\var{C1}\\var{C2}$
\n$C_1 C_2=\\var{prodC}$
\n", "rulesets": {}, "extensions": [], "variables": {"n1": {"name": "n1", "group": "Matrix A", "definition": "random(2..3)", "description": "", "templateType": "anything"}, "m1": {"name": "m1", "group": "Matrix A", "definition": "random(2..3 except n1)", "description": "", "templateType": "anything"}, "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": "random(2..3)", "description": "", "templateType": "anything"}, "m2": {"name": "m2", "group": "Matrix B", "definition": "random(2..3 except n2)", "description": "", "templateType": "anything"}, "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"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Matrix A", "variables": ["n1", "m1", "A1", "A2", "ProdA"]}, {"name": "Matrix B", "variables": ["n2", "m2", "B1", "B2", "ProdB"]}, {"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": "\n
$A_1A_2=\\var{A1}\\var{A2}$
\n$A_1 A_2=$ [[0]]
\n\n$B_1B_2=\\var{B1}\\var{B2}$
\n$B_1 B_2=$ [[1]]
\n\n
$C_1C_2=\\var{C1}\\var{C2}$
\n$C_1 C_2=$ [[2]]
\n\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": "{prodB}", "correctAnswerFractions": false, "numRows": "{n2}", "numColumns": "{n2}", "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": "{prodC}", "correctAnswerFractions": false, "numRows": "n3", "numColumns": "m3a", "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": "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/"}]}