// Numbas version: finer_feedback_settings {"name": "John's copy of Matrix Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"ba12": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba12", "definition": "{b11}*{a12}+{b12}*{a22}"}, "b21": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b21", "definition": "random(2 .. 9#1)"}, "b22": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b22", "definition": "random(-9 .. -2#1)"}, "ba13": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba13", "definition": "{b11}*{a13}+{b12}*{a23}"}, "b12": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b12", "definition": "random(1 .. 8#1)"}, "ab11": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ab11", "definition": "{a11}*{b11}+{a12}*{b21}+{a13}*{b31}"}, "ba33": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba33", "definition": "{b31}*{a13}+{b32}*{a23}"}, "a11": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "a11", "definition": "random(-5 .. 5#1)"}, "ba23": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba23", "definition": "{b21}*{a13}+{b22}*{a23}"}, "a21": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "a21", "definition": "random(-5 .. 5#1)"}, "a23k": {"description": "", "group": "Unnamed group", "templateType": "randrange", "name": "a23k", "definition": "random(4 .. 11#1)"}, "k": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "k", "definition": "random(-1 .. 1#2)"}, "a22": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "a22", "definition": "random(-3 .. 4#1)"}, "ab22": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ab22", "definition": "{a21}*{b12}+{a22}*{b22}+{a23}*{b32}"}, "a23": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "a23", "definition": "{a23k}*k"}, "ab21": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ab21", "definition": "{a21}*{b11}+{a22}*{b21}+{a23}*{b31}"}, "b31": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b31", "definition": "random(-2 .. 2#1)"}, "ba22": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba22", "definition": "{b21}*{a12}+{b22}*{a22}"}, "b32": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b32", "definition": "random(0 .. 14#1)"}, "ba11": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba11", "definition": "{b11}*{a11}+{b12}*{a21}"}, "a13": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "a13", "definition": "random(1 .. 10#1)"}, "ab12": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ab12", "definition": "{a11}*{b12}+{a12}*{b22}+{a13}*{b32}"}, "ba31": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba31", "definition": "{b31}*{a11}+{b32}*{a21}"}, "ba21": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba21", "definition": "{b21}*{a11}+{b22}*{a21}"}, "ba32": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "ba32", "definition": "{b31}*{a12}+{b32}*{a22}"}, "a12": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "a12", "definition": "{a11}-1"}, "b11": {"description": "", "group": "Ungrouped variables", "templateType": "randrange", "name": "b11", "definition": "random(-4 .. 5#1)"}}, "preamble": {"css": "", "js": ""}, "functions": {}, "extensions": [], "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "parts": [{"useCustomName": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "gaps": [{"useCustomName": false, "correctAnswer": "matrix([\n [ab11,ab12],\n [ab21,ab22]\n])", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "numColumns": "1", "correctAnswerFractions": false, "allowResize": true, "allowFractions": false, "tolerance": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true, "numRows": "1", "unitTests": [], "marks": "2", "type": "matrix", "customName": "", "markPerCell": true}], "sortAnswers": false, "customName": "", "marks": 0, "type": "gapfill", "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}, {"useCustomName": false, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "gaps": [{"useCustomName": false, "correctAnswer": "matrix([\n [ba11,ba12,ba13],\n [ba21,ba22,ba23],\n [ba31,ba32,ba33]\n])", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "numColumns": "1", "correctAnswerFractions": false, "allowResize": true, "allowFractions": false, "tolerance": 0, "customMarkingAlgorithm": "", "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true, "numRows": "1", "unitTests": [], "marks": "4.5", "type": "matrix", "customName": "", "markPerCell": true}], "sortAnswers": false, "customName": "", "marks": 0, "type": "gapfill", "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}], "name": "John's copy of Matrix Multiplication", "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}\\)

", "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"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": "

Multiplication of two matrices.

"}, "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [{"variables": ["a23k"], "name": "Unnamed group"}], "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

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