// Numbas version: exam_results_page_options {"name": "Alexander's copy of Matrix Multiplication 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Alexander's copy of Matrix Multiplication 2", "tags": [], "metadata": {"description": "

Matrix by scalar and matrix by matrix multiplication exercises.

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

Matrix Multiplication

\n

\n

Answer the following questions on matrix multiplication.

", "advice": "

Scalar Multiplication

\n

For scalar multiplication, multiply each element by the scalar value. The resultant matrix will be of the same order (size) as the starting matrix.

\n

e.g. for the first question:

\n

$\\simplify{{maS1}}\\times\\var{rand1} = \\begin{pmatrix}
\\var{maS1[0][0]}\\times\\var{rand1} & \\var{maS1[0][1]}\\times\\var{rand1} \\\\
\\var{maS1[1][0]}\\times\\var{rand1} & \\var{maS1[1][1]}\\times\\var{rand1}
\\end{pmatrix} = \\simplify{{maS1a}}$

\n

\n

Matrix by Matrix Multiplcation

\n

Matrices can only be multiplied together when the number of columns in the first matrix is equal to the number of rows in the second matrix. The resultant matrix will have the same number of rows as the first matrix, and the same number of columns as the second matrix.

\n

For $AC$,

\n

$A = \\simplify{{maMa}} C = \\simplify{{maMc}}$

\n

The order of $A$ is [3 x 2] and the order of $C$ is [2 x 4].

\n

[3 x 2] x [2 x 4] : The inner numbers match, therefore these matrices can be multiplied. The outer numbers give the size of the new matrix, which will be [3 x 4].

\n

The answer matrix will look like this: $\\begin{pmatrix}
ac_{11} & ac_{12} & ac_{13} & ac_{14} \\\\
ac_{21} & ac_{22} & ac_{23} & ac_{24} \\\\
ac_{31} & ac_{32} & ac_{33} & ac_{34}
\\end{pmatrix}$

\n

To work out the values for the answer matrix we multiply:-

\n\n

So:

\n

$ac_{11} = a_{11}c_{11}+a_{12}c_{21} = \\var{maMa[0][0]}\\times\\var{maMc[0][0]} + \\var{maMa[0][1]}\\times\\var{maMc[1][0]} = \\var{maMac[0][0]}$

\n

$ac_{12} = a_{11}c_{12}+a_{12}c_{22} = \\var{maMa[0][0]}\\times\\var{maMc[0][1]} + \\var{maMa[0][1]}\\times\\var{maMc[1][1]} = \\var{maMac[0][1]}$

\n

$ac_{13} = a_{11}c_{13}+a_{12}c_{23} = \\var{maMa[0][0]}\\times\\var{maMc[0][2]} + \\var{maMa[0][1]}\\times\\var{maMc[1][2]} = \\var{maMac[0][2]}$

\n

$ac_{14} = a_{11}c_{14}+a_{12}c_{24} = \\var{maMa[0][0]}\\times\\var{maMc[0][3]} + \\var{maMa[0][1]}\\times\\var{maMc[1][3]} = \\var{maMac[0][3]}$

\n

$ac_{21} = a_{21}c_{11}+a_{22}c_{21} = \\var{maMa[1][0]}\\times\\var{maMc[0][0]} + \\var{maMa[1][1]}\\times\\var{maMc[1][0]} = \\var{maMac[1][0]}$

\n

and so on...

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"maS1": {"name": "maS1", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "rand1": {"name": "rand1", "group": "Ungrouped variables", "definition": "random(1..9)*random(1,1,1,-1)", "description": "", "templateType": "anything", "can_override": false}, "maS2": {"name": "maS2", "group": "Ungrouped variables", "definition": "matrixrandomN(2,3)", "description": "", "templateType": "anything", "can_override": false}, "rand2": {"name": "rand2", "group": "Ungrouped variables", "definition": "random(1..9)*random(1,1,1,-1)", "description": "", "templateType": "anything", "can_override": false}, "maS3": {"name": "maS3", "group": "Ungrouped variables", "definition": "matrixrandomN(1,4)", "description": "", "templateType": "anything", "can_override": false}, "rand3": {"name": "rand3", "group": "Ungrouped variables", "definition": "random(1..9)*random(1,1,1,-1)", "description": "", "templateType": "anything", "can_override": false}, "maMa": {"name": "maMa", "group": "Ungrouped variables", "definition": "matrixrandomN(3,2)", "description": "", "templateType": "anything", "can_override": false}, "maMb": {"name": "maMb", "group": "Ungrouped variables", "definition": "matrixrandomN(3,3)", "description": "", "templateType": "anything", "can_override": false}, "maMc": {"name": "maMc", "group": "Ungrouped variables", "definition": "matrixrandomN(2,4)", "description": "", "templateType": "anything", "can_override": false}, "maMd": {"name": "maMd", "group": "Ungrouped variables", "definition": "matrixrandomN(4,3)", "description": "", "templateType": "anything", "can_override": false}, "maMe": {"name": "maMe", "group": "Ungrouped variables", "definition": "matrixrandomN(4,2)", "description": "", "templateType": "anything", "can_override": false}, "maS1a": {"name": "maS1a", "group": "Ungrouped variables", "definition": "maS1*rand1", "description": "", "templateType": "anything", "can_override": false}, "maMac": {"name": "maMac", "group": "Ungrouped variables", "definition": "maMa*maMc", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["maS1", "rand1", "maS2", "rand2", "maS3", "rand3", "maMa", "maMb", "maMc", "maMd", "maMe", "maS1a", "maMac"], "variable_groups": [], "functions": {"matrixrandom": {"parameters": [["rows", "integer"], ["columns", "integer"]], "type": "matrix", "language": "jme", "definition": "matrix(repeat(repeat(random(0..9)*(random(1,1,1,-1)),columns),rows))"}, "matrixrandomN": {"parameters": [["rows", "integer"], ["columns", "integer"]], "type": "matrix", "language": "jme", "definition": "matrix(repeat(repeat(random(0..9),columns),rows))"}}, "preamble": {"js": "", "css": ""}, "parts": [{"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": "

Scalar Multiplication

"}, {"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": "

Matrix by Matrix Multiplication

\n

Consider the following matrices

\n

\n

$A=\\simplify{{maMa}}$  $B=\\simplify{{maMb}}$  $C=\\simplify{{maMc}}$  $D=\\simplify{{maMd}}$  $E=\\simplify{{maMe}}$

\n

\n

"}, {"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, "prompt": "

Calculate the product of AC.

\n

AC = $\\simplify{{maMa}}\\times\\simplify{{maMc}} =$ ? 

", "correctAnswer": "maMa*maMc", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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, "prompt": "

Calculate the product of CE.

\n

CE = $\\simplify{{maMc}}\\times\\simplify{{maMe}} =$ ? 

", "correctAnswer": "maMc*maMe", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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, "prompt": "

Calculate the product of EC.

\n

EC = $\\simplify{{maMe}}\\times\\simplify{{maMc}} =$ ? 

", "correctAnswer": "maMe*maMc", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Mark Patterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5064/"}, {"name": "Alexander Corner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5328/"}]}]}], "contributors": [{"name": "Mark Patterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5064/"}, {"name": "Alexander Corner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5328/"}]}