// Numbas version: exam_results_page_options {"name": "Properties of the transpose", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Properties of the transpose", "tags": [], "metadata": {"description": "Question involving distributing the transpose operator across a number of matrices that are multiplied.", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

If $A = \\begin{pmatrix} 1 & 0 & -1\\\\ 2 & 3 & 4  \\end{pmatrix}$ and $B = \\begin{pmatrix} 1 & 2\\\\ 2 & 1\\\\ 3 & 2  \\end{pmatrix}$, verify that $(AB)^T = B^T A^T$.

", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"AB": {"name": "AB", "group": "Ungrouped variables", "definition": "matrix([-2,0],[20,15])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["AB"], "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": "

Increase/decrease the number of rows or columns if necessary:

\n

$(AB)^T = $ [[0]]

\n

$B^TA^T = $ [[1]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "malrules:\n [\n [\"matrix([-2,0],[20,15])\",\"Did you remember to transpose your answer?\"]\n ]\n\nparsed_malrules: \n map(\n [\"expr\":parse(x[0]),\"feedback\":x[1]],\n x,\n malrules\n )\n\nagree_malrules (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n len(filter(not x ,x,map(\n try(\n resultsEqual(unset(question_definitions,eval(studentMatrix,vars)),unset(question_definitions,eval(malrule[\"expr\"],vars)),settings[\"checkingType\"],settings[\"checkingAccuracy\"]),\n message,\n false\n ),\n vars,\n vset\n )))You have correctly calculated $AB$ but have not transposed your answer.

", "useAlternativeFeedback": false, "correctAnswer": "matrix([-2,0],[20,15])", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "correctAnswer": "matrix([-2,20],[0,15])", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "alternatives": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you have found $BA$ rather than $B^T A^T$. Don't forget to transpose the matrices before multiplying.

", "useAlternativeFeedback": false, "correctAnswer": "matrix([5,6,7],[4,3,2],[7,6,5])", "correctAnswerFractions": true, "numRows": "3", "numColumns": "3", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

It looks like you have calculated $A^T B^T$ rather than $B^T A^T$. Remember that matrix multiplicaton is non-commutative i.e., order matters, so $B^T A^T \\neq A^T B^T$.

", "useAlternativeFeedback": false, "correctAnswer": "matrix([5,4,7],[6,3,6],[7,2,5])", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "correctAnswer": "matrix([-2,20],[0,15])", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": true, "tolerance": 0, "markPerCell": true, "allowFractions": true, "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": "

With the aid of this result (in other words, using the fact that $(AB)^T = B^TA^T$ for any matrices $A$ and $B$ where $AB$ can be calculated) simplify the expressions below, where $X$ and $Y$ are arbitrary (i.e. unspecified) matrices:

\n

\n

Note: Whenever you wish Numbas to multiply two variables, you need to use the multiplication sign, so for $AB$, write $A*B$ etc

\n

To write $X^T$ or $Y^T$, type transpose(X) or transpose(Y).

\n

$(XY^T)^T = $ [[0]]

\n

$(X^TY^T)^T = $ [[1]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "malrules:\n [\n [\"transpose(X)*Y\",\"Be very careful with the order of multiplication. Remember when you apply the transpose to a bracketed expression, you must reverse the order\u00a0in which the matrices are being multiplied!\"], \n [\"transpose(X)*transpose(Y)\",\"Be very careful with the order of multiplication. Remember when you apply the transpose to a bracketed expression, you must reverse the order\u00a0in which the matrices are being multiplied! Also, note that there was already a $Y^T$ inside the bracket. What is $(Y^T)^T$?\"],\n [\"transpose(Y)*transpose(X)\",\"Almost there - you remembered to reverse the order of multiplication when applying the transpose to the bracketed expression - well done. However, note that there was already a $Y^T$ inside the bracket. What is $(Y^T)^T$?\"],\n [\"X*transpose(Y)\",\"You haven't applied the transpose that was outside the bracket.\"],\n [\"Y*X\",\"Did you remember to apply the transpose operator to $\\\\textit{both}$ matrices?\"],\n [\"X*Y\",\"Be very careful with the order of multiplication. Remember when you apply the transpose to a bracketed expression, you must reverse the order\u00a0in which the matrices are being multiplied! Also, did you remember to apply the transpose operator to both matrices?\"]\n ]\n\n\nparsed_malrules: \n map(\n [\"expr\":parse(x[0]),\"feedback\":x[1]],\n x,\n malrules\n )\n\nagree_malrules (Do the student's answer and the expected answer agree on each of the sets of variable values?):\n map(\n len(filter(not x ,x,map(\n try(\n resultsEqual(unset(question_definitions,eval(studentexpr,vars)),unset(question_definitions,eval(malrule[\"expr\"],vars)),settings[\"checkingType\"],settings[\"checkingAccuracy\"]),\n message,\n false\n ),\n vars,\n vset\n )))