// Numbas version: exam_results_page_options {"name": "Matrix Operations", "metadata": {"description": "

Some basic tests of adding, scaling, and multiplying matrices.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", ""], "variable_overrides": [[], [], []], "questions": [{"name": "Alexander's copy of Matrix Addition and Subtraction", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "tags": [], "metadata": {"description": "

Exercises covering matrix addition and subtraction

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

Matrix Addition and Subtraction

\n

\n

Perform the following matrix additions and subtractions:

", "advice": "

To add or subtract matrices, the matrices need to be of the same order (same number of rows and columns). We then add or subtract each corresponding element.

\n

e.g.

\n

\\[ \\begin{pmatrix} a_{1,1} & a_{1,2} \\\\ a_{2,1} & a_{2,2} \\\\ \\end{pmatrix} + \\begin{pmatrix} b_{1,1} & b_{1,2} \\\\ b_{2,1} & b_{2,2} \\\\ \\end{pmatrix} = \\begin{pmatrix} a_{1,1} + b_{1,1} & a_{1,2} + b_{1,2} \\\\ a_{2,1} + b_{2,1} & a_{2,2} + b_{2,2} \\\\ \\end{pmatrix} \\]

\n

\n

The resulting matrix will also be of the same order.

\n

\n

e.g. Part a)

\n

\\[ \\simplify{{maP1a}} + \\simplify{{maP1b}} = \\begin{pmatrix} \\var{maP1a[0][0]} + \\var{maP1b[0][0]} & \\var{maP1a[0][1]} + \\var{maP1b[0][1]} \\\\ \\var{maP1a[1][0]} + \\var{maP1b[1][0]} & \\var{maP1a[1][1]} + \\var{maP1b[1][1]} \\\\ \\end{pmatrix} = \\simplify{{maP1a + maP1b}} \\]

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"maP1a": {"name": "maP1a", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP1b": {"name": "maP1b", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP2a": {"name": "maP2a", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP2b": {"name": "maP2b", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP3a": {"name": "maP3a", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP3b": {"name": "maP3b", "group": "Ungrouped variables", "definition": "matrixrandomN(2,2)", "description": "", "templateType": "anything", "can_override": false}, "maP4a": {"name": "maP4a", "group": "Ungrouped variables", "definition": "matrixrandomN(2,4)", "description": "", "templateType": "anything", "can_override": false}, "maP4b": {"name": "maP4b", "group": "Ungrouped variables", "definition": "matrixrandomN(2,4)", "description": "", "templateType": "anything", "can_override": false}, "maP5a": {"name": "maP5a", "group": "Ungrouped variables", "definition": "matrixrandomN(4,4)", "description": "", "templateType": "anything", "can_override": false}, "maP5b": {"name": "maP5b", "group": "Ungrouped variables", "definition": "matrixrandomN(4,4)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["maP1a", "maP1b", "maP2a", "maP2b", "maP3a", "maP3b", "maP4a", "maP4b", "maP5a", "maP5b"], "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": [["columns", "integer"], ["rows", "integer"]], "type": "matrix", "language": "jme", "definition": "matrix(repeat(repeat(random(0..9),columns),rows))"}}, "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": "

$\\simplify{{maP1a}}+\\simplify{{maP1b}} =$ [[0]]

", "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": "maP1a + maP1b", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": "1", "maxColumns": "9", "minRows": 1, "maxRows": "9"}], "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": "

$\\simplify{{maP2a}}+\\simplify{{maP2b}} =$ [[0]]

", "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": "maP2a + maP2b", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": "1", "maxColumns": "9", "minRows": 1, "maxRows": "9"}], "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": "

$\\simplify{{maP3a}}-\\simplify{{maP3b}} =$ [[0]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "maP3a - maP3b", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "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": "

$\\simplify{{maP4a}}+\\simplify{{maP4b}} =$ [[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": "maP4a + maP4b", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": "9", "minRows": 1, "maxRows": "9"}], "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": "

$\\simplify{{maP5a}}-\\simplify{{maP5b}} =$ [[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": "maP5a - maP5b", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": "9", "minRows": 1, "maxRows": "9"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Alexander's copy of Matrix Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "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": {}, "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,2)", "description": "", "templateType": "anything", "can_override": false}, "maMd": {"name": "maMd", "group": "Ungrouped variables", "definition": "matrixrandomN(3,3)", "description": "", "templateType": "anything", "can_override": false}, "maMe": {"name": "maMe", "group": "Ungrouped variables", "definition": "matrixrandomN(2,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": "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": "

Perform the following matrix scalar multiplications.

\n

\n

$\\simplify{{maS1}}\\times\\simplify{{rand1}} =$ [[0]]

\n

\n

$\\simplify{{maS2}}\\times\\simplify{{rand2}} =$ [[1]]

\n

\n

$\\simplify{{maS3}}\\times\\simplify{{rand3}} =$ [[2]]

\n

\n

\n

", "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": "maS1*rand1", "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": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "maS2*rand2", "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": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "maS3*rand3", "correctAnswerFractions": false, "numRows": 1, "numColumns": 1, "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}, {"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": "m_n_x", "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": "

Which of the following combinations can be defined?

", "minMarks": 0, "maxMarks": "7", "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": true, "shuffleAnswers": false, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["AB", "DB", "AC", "CE", "EC", "DE", "BD"], "matrix": [[0, "1"], ["1", 0], ["1", 0], ["1", 0], ["1", 0], [0, "1"], ["1", "0"]], "layout": {"type": "all", "expression": ""}, "answers": ["Yes", "No"]}, {"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": "

What will the size of the matrix be for each of these multiplications?

\n

\n

AC:    [[0]]x  [[1]]

\n

BA:    [[2]]x  [[3]]

\n

CE:    [[4]]x  [[5]]

\n

EC:    [[6]]x  [[7]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numrows(maMa*maMc)", "maxValue": "numrows(maMa*maMc)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numcolumns(maMa*maMc)", "maxValue": "numcolumns(maMa*maMc)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numrows(maMb*maMa)", "maxValue": "numrows(maMb*maMa)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numcolumns(maMb*maMa)", "maxValue": "numcolumns(maMb*maMa)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numrows(maMc*maMe)", "maxValue": "numrows(maMc*maMe)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numcolumns(maMc*maMe)", "maxValue": "numcolumns(maMc*maMe)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numrows(maMe*maMc)", "maxValue": "numrows(maMe*maMc)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "numcolumns(maMe*maMc)", "maxValue": "numcolumns(maMe*maMc)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"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"}, {"name": "Alexander's copy of Matrix Multiplication 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "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": {}, "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"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": []}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Alexander Corner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5328/"}], "extensions": [], "custom_part_types": [], "resources": []}