// Numbas version: finer_feedback_settings {"name": "Matrix Multiplication", "metadata": {"description": "
This exam gives tests for an overview of the skills students need to be able to perfom matrix multiplications.
", "licence": "Creative Commons Attribution-NonCommercial 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": "Conformable for Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}], "tags": [], "metadata": {"description": "This question tests if a students understands when matrices are conformable
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "For each of the following pairs of matrices, determine whether they are conformable for multiplication
", "advice": "We are asked to determine whether two matrices are conformable for multiplication
\nTo do this, we must determine the dimensions of each matrix
\na)
\n$\\boldsymbol{A}$ has $\\var{n1q1}$ columns and $\\boldsymbol{B}$ has $\\var{m2q1}$ rows
\nSince both of these values are $\\var{n1q1}$, the product $\\boldsymbol{AB}$ is defined and the matrices are conformable
\nSince $\\var{n1q1}$ is not equal to $\\var{m2q1}$, the product $\\boldsymbol{AB}$ is not defined and the matrices are not conformable
\nb)
\n$\\boldsymbol{C}$ has $\\var{n1q2}$ columns and $\\boldsymbol{D}$ has $\\var{m2q2}$ rows
\nSince both of these values are $\\var{n1q2}$, the product $\\boldsymbol{CD}$ is defined and the matrices are conformable
\nSince $\\var{n1q2}$ is not equal to $\\var{m2q2}$, the product $\\boldsymbol{CD}$ is not defined and the matrices are not conformable
\nc)
\n$\\boldsymbol{E}$ has $\\var{n1q3}$ columns and $\\boldsymbol{F}$ has $\\var{m2q3}$ rows
\nSince both of these values are $\\var{n1q3}$, the product $\\boldsymbol{EF}$ is defined and the matrices are conformable
\nSince $\\var{n1q3}$ is not equal to $\\var{m2q3}$, the product $\\boldsymbol{AB}$ is not defined and the matrices are not conformable
\nConsider:
\n$$
\\boldsymbol{A} = \\var{A}, \\boldsymbol{B} = \\var{B}
$$
The product $\\boldsymbol{AB}$ [[0]], and therefore the matrices are [[1]].
", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['exists','does not exist']", "matrix": "[if(conf1,1,0),if(conf1,0,1)]"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['conformable for multiplication','not conformable for multiplication']", "matrix": "[if(conf1,1,0),if(conf1,0,1)]"}], "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": "Consider:
\n$$
\\boldsymbol{C} = \\var{C}, \\boldsymbol{D} = \\var{D}
$$
The product $\\boldsymbol{CD}$ [[0]], and therefore the matrices are [[1]].
", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['exists','does not exist']", "matrix": "[if(conf2,1,0),if(conf2,0,1)]"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['conformable for multiplication','not conformable for multiplication']", "matrix": "[if(conf2,1,0),if(conf2,0,1)]"}], "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": "Consider:
\n$$
\\boldsymbol{E} = \\var{E}, \\boldsymbol{F} = \\var{F}
$$
The product $\\boldsymbol{EF}$ [[0]], and therefore the matrices are [[1]].
", "gaps": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['exists','does not exist']", "matrix": "[if(conf3,1,0),if(conf3,0,1)]"}, {"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showCellAnswerState": true, "choices": "['conformable for multiplication','not conformable for multiplication']", "matrix": "[if(conf3,1,0),if(conf3,0,1)]"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Matrix Multiplication", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Frank Doheny", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/789/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}], "tags": [], "metadata": {"description": "Multiplication of two matrices.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "Given two matrices:
\n$$
\\boldsymbol{A}=\\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a13}\\\\ \\var{a21}&\\var{a22}&\\var{a23}\\\\ \\end{pmatrix} ,\\boldsymbol{B}=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\var{b31}&\\var{b32}\\\\\\end{pmatrix}
$$
Calculate the following matrix multiplications.
\n", "advice": "Remember multiplication of matrices is carried out by multiplying the rows of the first matrix by the columns of the second matrix
\na)
\n$$
\\begin{aligned}
\\boldsymbol{A}\\boldsymbol{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} \\\\
&= \\begin{pmatrix}\\var{a11}\\times\\var{b11}+\\var{a12}\\times\\var{b21}+\\var{a13}\\times\\var{b31}&\\var{a11}\\times\\var{b12}+\\var{a12}\\times\\var{b22}+\\var{a13}\\times\\var{b32} \\\\ \\var{a21}\\times\\var{b11}+\\var{a22}\\times\\var{b21}+\\var{a23}\\times\\var{b31}&\\var{a21}\\times\\var{b12}+\\var{a22}\\times\\var{b22}+\\var{a23}\\times\\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}
\\end{aligned}
$$
b)
\nTo evaluate \\(\\boldsymbol{B}\\boldsymbol{A}\\) we swap their positions and this time multiply the rows of \\(\\boldsymbol{B}\\) by the columns of \\(\\boldsymbol{A}\\)
\n$$
\\begin{aligned}
\\boldsymbol{B}\\boldsymbol{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{b11} \\times \\var{a11} + \\var{b12} \\times \\var{a21} & \\var{b11} \\times \\var{a12} + \\var{b12} \\times \\var{a22} & \\var{b11} \\times \\var{a13} + \\var{b12} \\times \\var{a23} \\\\
\\var{b21} \\times \\var{a11} + \\var{b22} \\times \\var{a21} & \\var{b21} \\times \\var{a12} + \\var{b22} \\times \\var{a22} & \\var{b21} \\times \\var{a13} + \\var{b22} \\times \\var{a23} \\\\
\\var{b31} \\times \\var{a11} + \\var{b32} \\times \\var{a21} & \\var{b31} \\times \\var{a12} + \\var{b32} \\times \\var{a22} & \\var{b31} \\times \\var{a13} + \\var{b32} \\times \\var{a23} \\\\
\\end{pmatrix} \\\\
&=
\\begin{pmatrix}
\\simplify{{b11}*{a11}+{b12}*{a21}} & \\simplify{{b11} *{a12} + {b12} *{a22}} & \\simplify{{b11}*{a13} + {b12}*{a23}} \\\\
\\simplify{{b21}*{a11}+{b22}*{a21}} & \\simplify{{b21}*{a12} + {b22}*{a22}} & \\simplify{{b21}*{a13} + {b22}*{a23}} \\\\
\\simplify{{b31}*{a11}+{b32}*{a21}} & \\simplify{{b31}*{a12} + {b32}*{a22}} & \\simplify{{b31}*{a13} + {b32}*{a23}} \\\\
\\end{pmatrix} \\\\
\\end{aligned}
$$
Calculate the product $\\boldsymbol{AB}$
\nFirst 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$\\boldsymbol{AB} =$ [[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": "matrix([\n [ab11,ab12],\n [ab21,ab22]\n])", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "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": "Calculate the product $\\boldsymbol{BA}$
\nFirst 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$\\boldsymbol{BA} =$ [[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": "matrix([\n [ba11,ba12,ba13],\n [ba21,ba22,ba23],\n [ba31,ba32,ba33]\n])", "correctAnswerFractions": false, "numRows": "1", "numColumns": "1", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "typeendtoleave": false, "startpassword": "", "allowAttemptDownload": false, "downloadEncryptionKey": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "results_options": {"printquestions": true, "printadvice": true}, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}], "extensions": [], "custom_part_types": [], "resources": []}