// Numbas version: exam_results_page_options {"name": "Matrix multiplication via linear combinations of columns", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Matrix multiplication via linear combinations of columns", "tags": ["linear combination", "linear combination of column vectors", "matrix multiplication"], "metadata": {"description": "

To understand matrix multiplication in terms of linear combinations of column vectors.

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

Let \\(A=\\var{A}\\) and \\(B=\\var{B}\\).

", "advice": "

To answer b) and c), we use the definition of matrix multiplication which is in terms of the column vectors of the second matrix:

\n

if
 \\[B=\\begin{pmatrix}   \\uparrow & &\\uparrow & & \\uparrow\\\\  b_1 & \\cdots & b_k & \\cdots & b_n\\\\  \\downarrow & & \\downarrow & & \\downarrow  \\end{pmatrix}, \\]
then
\\[ AB=\\begin{pmatrix}   \\uparrow & &\\uparrow & & \\uparrow\\\\ Ab_1 & \\cdots & Ab_k & \\cdots & Ab_n\\\\  \\downarrow & & \\downarrow & & \\downarrow \\end{pmatrix},\\]

\n

and \\[\\begin{pmatrix} \\phantom{.} & & & & \\\\   \\uparrow & &\\uparrow & & \\uparrow\\\\  a_1 & \\cdots & a_k & \\cdots & a_n\\\\  \\downarrow & & \\downarrow & & \\downarrow\\\\ \\phantom{.}&&&& \\end{pmatrix}\\begin{pmatrix} x_1\\\\x_2\\\\\\vdots\\\\x_{n-1}\\\\x_n\\end{pmatrix}  = x_1\\begin{pmatrix} \\\\\\uparrow\\\\a_1\\\\\\downarrow\\\\ \\ \\end{pmatrix}+x_2\\begin{pmatrix} \\\\\\uparrow\\\\a_2\\\\\\downarrow\\\\\\ \\end{pmatrix}+\\cdots+x_{n-1}\\begin{pmatrix} \\\\\\uparrow\\\\a_{n-1}\\\\\\downarrow\\\\\\ \\end{pmatrix}+x_n\\begin{pmatrix} \\\\\\uparrow\\\\a_n\\\\\\downarrow\\\\\\ \\end{pmatrix}\\]

\n

So the first column of \\(A^2\\) is \\((A^2)_1= Aa_1=A_{11}a_1+A_{21}a_2+A_{31}a_3=\\var{A[0][0]}\\var{A1}+\\var{A[1][0]}\\var{A2}+\\var{A[2][0]}\\var{A3}\\).

\n

And the second column of \\(B^2\\) is \\((B^2)_2=Bb_2=B_{12}b_1+B_{22}b_2+B_{32}b_3=\\var{B[0][1]}\\var{b1}+\\var{B[1][1]}\\var{b2}+\\var{B[2][1]}\\var{b3}\\).

\n

You can calculate these linear combinations to check your own answer.

", "rulesets": {}, "extensions": [], "variables": {"A": {"name": "A", "group": "Ungrouped variables", "definition": "matrix([3,-2,7],[6,5,4],[0,4,9])", "description": "", "templateType": "anything"}, "B": {"name": "B", "group": "Ungrouped variables", "definition": "matrix([6,-2,4],[0,1,3],[7,7,5])", "description": "", "templateType": "anything"}, "A1": {"name": "A1", "group": "Ungrouped variables", "definition": "vector(A[0][0],A[1][0],A[2][0])", "description": "

first column of A

", "templateType": "anything"}, "A2": {"name": "A2", "group": "Ungrouped variables", "definition": "vector(A[0][1],A[1][1],A[2][1])", "description": "

second column of A

", "templateType": "anything"}, "A3": {"name": "A3", "group": "Ungrouped variables", "definition": "vector(A[0][2],A[1][2],A[2][2])", "description": "

third column of A

", "templateType": "anything"}, "B1": {"name": "B1", "group": "Ungrouped variables", "definition": "vector(B[0][0],B[1][0],B[2][0])", "description": "", "templateType": "anything"}, "B2": {"name": "B2", "group": "Ungrouped variables", "definition": "vector(B[0][1],B[1][1],B[2][1])", "description": "", "templateType": "anything"}, "B3": {"name": "B3", "group": "Ungrouped variables", "definition": "vector(B[0][2],B[1][2],B[2][2])", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["A", "B", "A1", "A2", "A3", "B1", "B2", "B3"], "variable_groups": [], "functions": {}, "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": "

Compute

\n

\\(A^2= \\) [[0]]

\n

\\(B^2= \\) [[1]]

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

Express the first column vector of \\(A^2\\) as a linear combination of the column vectors of \\(A\\). You can write a1, a2, a3 for the three columns of \\(A\\), i.e.

\n

\\(a_1=\\var{A1}\\), \\(a_2=\\var{A2}\\) and \\(a_3=\\var{A3}\\).

\n

First column of \\(A^2\\) is [[0]]

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": true, "answer": "{A[0][0]}*A_1+{A[1][0]}*A_2+{A[2][0]}*A_3", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "a_1", "value": ""}, {"name": "a_2", "value": ""}, {"name": "a_3", "value": ""}]}], "answer": "{A[0][0]}*A1+{A[1][0]}*A2+{A[2][0]}*A3", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "a1", "value": ""}, {"name": "a2", "value": ""}, {"name": "a3", "value": ""}]}], "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": "

Express the second column vector of \\(B^2\\) as a linear combination of the column vectors of \\(B\\). You can write b1, b2, b3 for the three columns of \\(B\\), i.e.

\n

\\(b_1=\\var{B1}\\), \\(b_2=\\var{B2}\\) and \\(b_3=\\var{B3}\\).

\n

second column of \\(B^2\\) is [[0]]

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "", "useAlternativeFeedback": true, "answer": "{B[0][1]}*b_1+{B[1][1]}*b_2+{B[2][1]}*b_3", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "b_1", "value": ""}, {"name": "b_2", "value": ""}, {"name": "b_3", "value": ""}]}], "answer": "{B[0][1]}*b1+{B[1][1]}*b2+{B[2][1]}*b3", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "b1", "value": ""}, {"name": "b2", "value": ""}, {"name": "b3", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}]}], "contributors": [{"name": "Julia Goedecke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5121/"}]}