// Numbas version: exam_results_page_options {"name": "Determinant and inverse of matrices", "metadata": {"description": "

Quiz to assess matrix addition, subtraction, multiplication and multiplication by scalar, determinants and inverses, solving a system of simultaneous equations.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "duration": 0, "percentPass": "80", "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", ""], "variable_overrides": [[], [], []], "questions": [{"name": "Determinant and inverse of 2x2 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Martin Jones", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/145/"}], "preamble": {"js": "", "css": ""}, "variable_groups": [], "variablesTest": {"condition": "det<>0", "maxRuns": 100}, "functions": {}, "tags": [], "advice": "", "variables": {"a": {"description": "", "definition": "random(-5..5)", "name": "a", "group": "Ungrouped variables", "templateType": "anything"}, "det": {"description": "", "definition": "a*d-b*c", "name": "det", "group": "Ungrouped variables", "templateType": "anything"}, "c": {"description": "", "definition": "random(-5..5)", "name": "c", "group": "Ungrouped variables", "templateType": "anything"}, "M": {"description": "", "definition": "matrix([a,b],[c,d])", "name": "M", "group": "Ungrouped variables", "templateType": "anything"}, "b": {"description": "", "definition": "random(-5..5)", "name": "b", "group": "Ungrouped variables", "templateType": "anything"}, "d": {"description": "", "definition": "random(-5..5)", "name": "d", "group": "Ungrouped variables", "templateType": "anything"}}, "parts": [{"vsetrange": [0, 1], "scripts": {}, "showCorrectAnswer": true, "checkingaccuracy": 0.001, "variableReplacements": [], "marks": 1, "checkvariablenames": false, "answer": "{det}", "type": "jme", "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "showpreview": false, "prompt": "

What is determinant of $A$?

", "showFeedbackIcon": true, "expectedvariablenames": [], "checkingtype": "absdiff"}, {"scripts": {}, "showCorrectAnswer": true, "tolerance": 0, "allowFractions": false, "correctAnswer": "matrix([d,-b],[-c,a])", "variableReplacements": [], "marks": "4", "numColumns": "2", "allowResize": false, "type": "matrix", "variableReplacementStrategy": "originalfirst", "numRows": "2", "markPerCell": true, "correctAnswerFractions": false, "prompt": "

Write down the adjoint of $A$. (Swap top-left and bottom-right entries; change signs of top-right and bottom-left entries.)

", "showFeedbackIcon": true}, {"scripts": {}, "showCorrectAnswer": true, "tolerance": 0, "allowFractions": true, "correctAnswer": "matrix([d/det,-b/det],[-c/det,a/det])", "variableReplacements": [], "marks": "4", "numColumns": "2", "allowResize": false, "type": "matrix", "variableReplacementStrategy": "originalfirst", "numRows": "2", "markPerCell": true, "correctAnswerFractions": true, "prompt": "

Hence write down the inverse of $A$. Write the entries as fractions or decimals.

", "showFeedbackIcon": true}], "ungrouped_variables": ["M", "a", "b", "c", "d", "det"], "metadata": {"description": "", "licence": "None specified"}, "statement": "

The matrix $A$ is:

\n

\\[A=\\var{M}\\]

", "rulesets": {}, "type": "question"}, {"name": "Determinant and inverse of 3x3 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Martin Jones", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/145/"}], "variables": {"m11": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m11", "description": ""}, "a22": {"group": "Minors", "templateType": "anything", "definition": "m11*m33-m13*m31", "name": "a22", "description": ""}, "a23": {"group": "Minors", "templateType": "anything", "definition": "m11*m32-m12*m31", "name": "a23", "description": ""}, "m12": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m12", "description": ""}, "m13": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m13", "description": ""}, "m32": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m32", "description": ""}, "M": {"group": "Ungrouped variables", "templateType": "anything", "definition": "matrix([m11,m12,m13],[m21,m22,m23],[m31,m32,m33])", "name": "M", "description": ""}, "a32": {"group": "Minors", "templateType": "anything", "definition": "m11*m23-m13*m21", "name": "a32", "description": ""}, "m23": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m23", "description": ""}, "a21": {"group": "Minors", "templateType": "anything", "definition": "m12*m33-m13*m32", "name": "a21", "description": ""}, "a13": {"group": "Minors", "templateType": "anything", "definition": "m21*m32-m22*m31", "name": "a13", "description": ""}, "m22": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m22", "description": ""}, "a31": {"group": "Minors", "templateType": "anything", "definition": "m12*m23-m13*m22", "name": "a31", "description": ""}, "a12": {"group": "Minors", "templateType": "anything", "definition": "m21*m33-m23*m31", "name": "a12", "description": ""}, "det": {"group": "Ungrouped variables", "templateType": "anything", "definition": "det(M)", "name": "det", "description": ""}, "m33": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m33", "description": ""}, "a33": {"group": "Minors", "templateType": "anything", "definition": "m11*m22-m12*m21", "name": "a33", "description": ""}, "m31": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m31", "description": ""}, "m21": {"group": "Matrix entries", "templateType": "anything", "definition": "random(-5..5)", "name": "m21", "description": ""}, "a11": {"group": "Minors", "templateType": "anything", "definition": "m22*m33-m23*m32", "name": "a11", "description": ""}}, "functions": {}, "tags": [], "parts": [{"showFeedbackIcon": true, "vsetrange": [0, 1], "scripts": {}, "vsetrangepoints": 5, "expectedvariablenames": [], "prompt": "

What is the determinant of $A$?

", "type": "jme", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "checkingaccuracy": 0.001, "variableReplacements": [], "marks": "4", "checkvariablenames": false, "checkingtype": "absdiff", "showpreview": false, "answer": "{det}"}, {"showFeedbackIcon": true, "scripts": {}, "numRows": "3", "correctAnswerFractions": false, "prompt": "

Write down the minor matrix of $A$.

", "type": "matrix", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowResize": false, "numColumns": "3", "marks": "9", "correctAnswer": "matrix([a11,a12,a13],[a21,a22,a23],[a31,a32,a33])", "tolerance": 0, "markPerCell": true, "variableReplacements": [], "allowFractions": false}, {"showFeedbackIcon": true, "scripts": {}, "numRows": "3", "correctAnswerFractions": false, "prompt": "

Write down the cofactor matrix of $A$. (Certain entries change signs according to pattern below.)

\n

\\[\\begin{array}[ccc]++&-&+\\\\-&+&-\\\\+&-&+\\end{array}\\]

\n

", "type": "matrix", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowResize": false, "numColumns": "3", "marks": "9", "correctAnswer": "matrix([a11,-a12,a13],[-a21,a22,-a23],[a31,-a32,a33])", "tolerance": 0, "markPerCell": true, "variableReplacements": [], "allowFractions": false}, {"showFeedbackIcon": true, "scripts": {}, "numRows": "3", "correctAnswerFractions": false, "prompt": "

Write down the adjoint of $A$. (Transpose of the cofactor matrix.)

", "type": "matrix", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowResize": false, "numColumns": "3", "marks": "9", "correctAnswer": "matrix([a11,-a21,a31],[-a12,a22,-a32],[a13,-a23,a33])", "tolerance": 0, "markPerCell": true, "variableReplacements": [], "allowFractions": false}, {"marks": 0, "showFeedbackIcon": true, "scripts": {}, "gaps": [{"showFeedbackIcon": true, "scripts": {}, "correctAnswerStyle": "plain", "minValue": "{det}", "marks": "1", "type": "numberentry", "showCorrectAnswer": true, "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "maxValue": "{det}", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "allowFractions": false}, {"showFeedbackIcon": true, "scripts": {}, "numRows": "3", "correctAnswerFractions": true, "type": "matrix", "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowResize": false, "numColumns": "3", "marks": "9", "correctAnswer": "matrix([a11,-a21,a31],[-a12,a22,-a32],[a13,-a23,a33])", "tolerance": 0, "markPerCell": true, "variableReplacements": [], "allowFractions": false}], "prompt": "

Hence write down the inverse of $A$.

\n\n\n\n\n\n\n\n\n\n\n
1[[1]]
[[0]]
", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true}], "variable_groups": [{"variables": ["m11", "m12", "m13", "m21", "m22", "m23", "m31", "m32", "m33"], "name": "Matrix entries"}, {"variables": ["a11", "a12", "a13", "a21", "a22", "a23", "a31", "a32", "a33"], "name": "Minors"}], "rulesets": {}, "preamble": {"js": "", "css": ""}, "statement": "

The matrix $A$ is:

\n

\\[A=\\var{M}\\]

", "advice": "", "ungrouped_variables": ["M", "det"], "metadata": {"licence": "None specified", "description": "

Determinant, minors, cofactors, adjoint and inverse.

"}, "variablesTest": {"maxRuns": 100, "condition": "det(M)<>0"}, "type": "question"}, {"name": "Simultaneous equations with 3 unknowns", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Martin Jones", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/145/"}], "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "

Use matrices to solve the following system of equations:

\n

\\[\\begin{eqnarray}\\simplify{{M[0][0]}*a+{M[0][1]}*b+{M[0][2]}*c={N[0][0]}}\\\\\\simplify{{M[1][0]}*a+{M[1][1]}*b+{M[1][2]}*c={N[1][0]}}\\\\\\simplify{{M[2][0]}*a+{M[2][1]}*b+{M[2][2]}*c={N[2][0]}}\\end{eqnarray}\\]

", "advice": "

The matrix $M$ is formed of the 9 coefficients of $a$, $b$ and $c$ in the equations:

\n

\\[M=\\var{M}\\]

\n

Start by calculating the determinant of $M$.

\n

\\[\\text{det}(M)=\\var{M[0][0]}\\times(\\var{M[1][1]}\\times\\var{M[2][2]}-\\var{M[1][2]}\\times\\var{M[2][1]})-\\var{M[0][1]}\\times(\\var{M[1][0]}\\times\\var{M[2][2]}-\\var{M[1][2]}\\times\\var{M[2][0]})+\\var{M[0][2]}\\times(\\var{M[1][0]}\\times\\var{M[2][1]}-\\var{M[1][1]}\\times\\var{M[2][0]})=\\var{det}\\]

\n

Next construct the cofactor matrix:

\n

\\[\\var{transpose(Madj)}\\]

\n

Transpose this to get the adjoint matrix:

\n

\\[\\var{Madj}\\]

\n

And divide this by the determinant $\\var{det}$ to get the inverse matrix $M^{-1}$:

\n

\\[\\var[fractionNumbers]{1/det}\\var{Madj}\\]

\n

To calculate $a$, $b$ and $c$:

\n

\\[\\left(\\begin{array}\\\\a\\\\b\\\\c\\end{array}\\right)=M^{-1}\\var{N}=\\var[fractionNumbers]{1/det}\\var{Madj}\\var{N}\\]

\n

Multiply the matrices together:

\n

\\[\\var{Madj}\\var{N}=\\var{abc*det}\\]

\n

Divide by $\\var{det}$:

\n

\\[\\left(\\begin{array}\\\\a\\\\b\\\\c\\end{array}\\right)=\\var[fractionNumbers]{1/det}\\var{abc*det}=\\var{abc}\\]

\n

Therefore $a=\\var{abc[0][0]}$, $b=\\var{abc[1][0]}$ and $c=\\var{abc[2][0]}$.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"M": {"name": "M", "group": "Ungrouped variables", "definition": "matrix(repeat(repeat(random(-3..5),3),3))", "description": "", "templateType": "anything", "can_override": false}, "det": {"name": "det", "group": "Ungrouped variables", "definition": "det(M)", "description": "", "templateType": "anything", "can_override": false}, "N": {"name": "N", "group": "Ungrouped variables", "definition": "M*abc", "description": "", "templateType": "anything", "can_override": false}, "abc": {"name": "abc", "group": "Ungrouped variables", "definition": "matrix([random(-5..10)],[random(-5..10)],[random(-5..10)])", "description": "", "templateType": "anything", "can_override": false}, "Madj": {"name": "Madj", "group": "Ungrouped variables", "definition": "matrix([M[1][1]*M[2][2]-M[2][1]*M[1][2],-M[0][1]*M[2][2]+M[0][2]*M[2][1],M[0][1]*M[1][2]-M[0][2]*M[1][1]],[-M[1][0]*M[2][2]+M[1][2]*M[2][0],M[0][0]*M[2][2]-M[2][0]*M[0][2],-M[0][0]*M[1][2]+M[0][2]*M[1][0]],[M[1][0]*M[2][1]-M[1][1]*M[2][0],-M[0][0]*M[2][1]+M[0][1]*M[2][0],M[0][0]*M[1][1]-M[0][1]*M[1][0]])", "description": "", "templateType": "anything", "can_override": false}, "abc2": {"name": "abc2", "group": "Ungrouped variables", "definition": "Madj/det*N", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "det<>0", "maxRuns": 100}, "ungrouped_variables": ["M", "det", "N", "abc", "Madj", "abc2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"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, "prompt": "

If $M\\left(\\begin{array}\\\\a\\\\b\\\\c\\end{array}\\right)=\\var{N}$ then write down the matrix $M$.

", "correctAnswer": "M", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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 determinant of the matrix $M$.

\n

$\\det(M)=$ [[0]]

\n

Calculate the inverse of the matrix $M$.

\n\n\n\n\n\n\n\n\n\n\n\n
$M^{-1}=$1[[1]]
[[0]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "det", "maxValue": "det", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "6", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "Madj", "correctAnswerFractions": false, "numRows": "3", "numColumns": "3", "allowResize": false, "tolerance": 0, "markPerCell": true, "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": "

Hence calculate the values of the unknowns:

\n", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "a", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "Madj", "part": "p1g1", "must_go_first": false}, {"variable": "det", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "abc2[0][0]", "maxValue": "abc2[0][0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "b", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "Madj", "part": "p1g1", "must_go_first": false}, {"variable": "det", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "abc2[1][0]", "maxValue": "abc2[1][0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "c", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "Madj", "part": "p1g1", "must_go_first": false}, {"variable": "det", "part": "p1g0", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "abc2[2][0]", "maxValue": "abc2[2][0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "menu", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": []}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Martin Jones", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/145/"}], "extensions": [], "custom_part_types": [], "resources": []}