// Numbas version: exam_results_page_options {"name": "Matrix Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "variables": {"ba23": {"name": "ba23", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b21}*{a13}+{b22}*{a23}"}, "ba33": {"name": "ba33", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b31}*{a13}+{b32}*{a23}"}, "a21": {"name": "a21", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(0..10#1)"}, "ba22": {"name": "ba22", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b21}*{a12}+{b22}*{a22}"}, "b21": {"name": "b21", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(2..11#1)"}, "a12": {"name": "a12", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{a11}-1"}, "b32": {"name": "b32", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(0..14#1)"}, "b12": {"name": "b12", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..8#1)"}, "ab21": {"name": "ab21", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{a21}*{b11}+{a22}*{b21}+{a23}*{b31}"}, "b22": {"name": "b22", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(2..11#1)"}, "a13": {"name": "a13", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(4..12#1)"}, "b11": {"name": "b11", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..9#1)"}, "ab11": {"name": "ab11", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{a11}*{b11}+{a12}*{b21}+{a13}*{b31}"}, "ba21": {"name": "ba21", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b21}*{a11}+{b22}*{a21}"}, "ba13": {"name": "ba13", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b11}*{a13}+{b12}*{a23}"}, "ba31": {"name": "ba31", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b31}*{a11}+{b32}*{a21}"}, "k": {"name": "k", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..9#1)"}, "ba32": {"name": "ba32", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b31}*{a12}+{b32}*{a22}"}, "a11": {"name": "a11", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..10#1)"}, "a22": {"name": "a22", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(1..9#1)"}, "ab22": {"name": "ab22", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{a21}*{b12}+{a22}*{b22}+{a23}*{b32}"}, "ba12": {"name": "ba12", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b11}*{a12}+{b12}*{a22}"}, "ba11": {"name": "ba11", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{b11}*{a11}+{b12}*{a21}"}, "ab12": {"name": "ab12", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "{a11}*{b12}+{a12}*{b22}+{a13}*{b32}"}, "a23": {"name": "a23", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(10..16#1)"}, "b31": {"name": "b31", "templateType": "randrange", "description": "", "group": "Ungrouped variables", "definition": "random(0..5#1)"}}, "metadata": {"description": "

Multiplication of two matrices.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "name": "Matrix Multiplication", "parts": [{"variableReplacements": [], "showCorrectAnswer": true, "type": "gapfill", "gaps": [{"variableReplacements": [], "numRows": "1", "showCorrectAnswer": true, "type": "matrix", "markPerCell": true, "numColumns": "1", "allowFractions": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowResize": true, "correctAnswer": "matrix([\n [ab11,ab12],\n [ab21,ab22]\n])", "correctAnswerFractions": false, "tolerance": 0, "scripts": {}, "marks": "2"}], "prompt": "

Calculate the product $\\mathbf{AB}$

\n

First 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

\n

$\\mathbf{AB}$ =   [[0]]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 0}, {"variableReplacements": [], "showCorrectAnswer": true, "type": "gapfill", "gaps": [{"variableReplacements": [], "numRows": "1", "showCorrectAnswer": true, "type": "matrix", "markPerCell": true, "numColumns": "1", "allowFractions": false, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "allowResize": true, "correctAnswer": "matrix([\n [ba11,ba12,ba13],\n [ba21,ba22,ba23],\n [ba31,ba32,ba33]\n])", "correctAnswerFractions": false, "tolerance": 0, "scripts": {}, "marks": "4.5"}], "prompt": "

Calculate the product $\\mathbf{BA}$

\n

First 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

$\\mathbf{BA}$ = [[0]]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 0}], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "extensions": [], "statement": "

Given two matrices:

\n

\\(\\mathbf{A}=\\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a13}\\\\ \\var{a21}&\\var{a22}&\\var{a23}\\\\ \\end{pmatrix}\\;\\;and \\;\\;\\mathbf{B}=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\var{b31}&\\var{b32}\\\\\\end{pmatrix}\\)

\n

", "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["a11", "a12", "a21", "a22", "k", "a13", "a23", "b11", "b12", "b21", "b22", "b31", "b32", "ab11", "ab12", "ab21", "ab22", "ba11", "ba12", "ba13", "ba21", "ba22", "ba23", "ba31", "ba32", "ba33"], "advice": "

\\(\\mathbf{A}\\mathbf{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}\\)

\n

Remember multiplication of matrices is carried out by multiplying the rows of the first matrix, \\(\\mathbf{A}\\), by the columns of the second matrix, \\(\\mathbf{B}\\).

\n

\\(\\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}*\\var{b11}+\\var{a12}*\\var{b21}+\\var{a13}*\\var{b31}&\\var{a11}*\\var{b12}+\\var{a12}*\\var{b22}+\\var{a13}*\\var{b32}\\\\ \\var{a21}*\\var{b11}+\\var{a22}*\\var{b21}+\\var{a23}*\\var{b31}&\\var{a21}*\\var{b12}+\\var{a22}*\\var{b22}+\\var{a23}*\\var{b32}\\end{pmatrix}\\)

\n

\\(\\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}\\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}\\)

\n

To evaluate \\(\\mathbf{B}\\mathbf{A}\\) we swap their positions and this time multiply the rows of \\(\\mathbf{B}\\) by the columns of \\(\\mathbf{A}\\)

\n

\\(\\mathbf{B}\\mathbf{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{ba11}&\\var{ba12}&\\var{ba13}\\\\ \\var{ba21}&\\var{ba22}&\\var{ba23}\\\\ \\var{ba31}&\\var{ba32}&\\var{ba33}\\end{pmatrix}\\)

", "type": "question", "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}]}], "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}]}