// Numbas version: finer_feedback_settings {"name": "Simon's copy of 3x3 matrix: Cofactors, Determinant, Inverse, Equation solving", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "

If \\[  A=\\left( \\begin{array}{ccc}
a & b & c \\\\d & e&f\\\\ g&h&j \\end{array} \\right),\\]

\n

Cofactors are given by 

\n

Cof11 =\\[  +\\left| \\begin{array}{ccc}
e&f\\\\ h&j \\end{array} \\right|,\\]

\n

Cof12 =\\[  -\\left| \\begin{array}{ccc}
d & f\\\\ g&j \\end{array} \\right|,\\]

\n

Cof13 =\\[  +\\left| \\begin{array}{ccc}
d & e\\\\ g&h\\end{array} \\right|,\\]

\n

Cof21 =\\[ -\\left| \\begin{array}{ccc}
b & c \\\\h&j \\end{array} \\right|,\\]

\n

Cof22 =\\[  +\\left| \\begin{array}{ccc}
a  & c \\\\ g&j \\end{array} \\right|,\\]

\n

Cof23 =\\[  -\\left| \\begin{array}{ccc}
a & b \\\\g&h\\end{array} \\right|,\\]

\n

Cof31 =\\[  +\\left| \\begin{array}{ccc}
b & c \\\\e&f\\end{array} \\right|,\\]

\n

Cof32 =\\[ -\\left| \\begin{array}{ccc}
a  & c \\\\d & f\\end{array} \\right|,\\]

\n

Cof33 =\\[  +\\left| \\begin{array}{ccc}
a & b\\\\d & e \\end{array} \\right|,\\]

\n

(b) Then, the determinant, det(A) is given by the sum of the product of any row ( or column) elements by their cofactors

\n

e.g using row 1, we obtain the determinant = $a \\times cof_{11}+b \\times cof_{12}+c \\times cof_{13}$

\n

$= \\var{a11} \\times \\var{cof11} +\\var{a12} \\times \\var{cof12}+\\var{a13} \\times \\var{cof13} = \\var{det(matrixA)}$

\n

(c) The inverse of A, $\\ A^{-1}$ is given by dividing adj(A) by det(A)

\n

where the adjoint, adj(A) is given by taking the transpose of the cofactor matrix, i.e.

\n

adj(A) =\\[ \\left( \\begin{array}{ccc}
cof11 & cof21 & cof31 \\\\cof12 & cof22&cof32\\\\ cof13&cof23&cof33 \\end{array} \\right),\\]

\n

Then $\\ A^{-1}$=\\[  \\frac{1}{det(A)} \\times \\left( \\begin{array}{ccc}
cof11 & cof21 & cof31 \\\\cof12 & cof22&cof32\\\\ cof13&cof23&cof33 \\end{array} \\right),\\]

\n

$\\ A^{-1}$=\\[  \\frac{1}{\\var{det(matrixA)}} \\times \\left( \\begin{array}{ccc}
\\var{cof11} & \\var{cof21} & \\var{cof31} \\\\\\var{cof12} & \\var{cof22}&\\var{cof32}\\\\ \\var{cof13}&\\var{cof23}&\\var{cof33} \\end{array} \\right),\\]

\n

 $\\ A^{-1}=\\var{precround(inverseA,3)}$

\n

(d) The equation $ A \\mathbf{x}=\\mathbf{b} $ can be solved by premultiplying each side by $A^{-1}$ giving $\\mathbf{x} = A^{-1}\\mathbf{b}$

\n

i.e. $ \\left(\\matrix{x\\\\y\\\\z}\\right) = \\var{matrixA}^{-1} \\var{vectorb}$

\n

$ \\left(\\matrix{x\\\\y\\\\z}\\right) = \\var{precround(inverseA,3)} \\var{vectorb} = \\var{precround(inverseA*vectorb,3)}$

", "ungrouped_variables": ["matrixA", "a11", "a12", "a21", "a22", "a13", "a23", "a31", "a32", "a33", "inverseA"], "variables": {"cof31": {"description": "", "templateType": "anything", "name": "cof31", "group": "cofactors", "definition": "a12*a23-a22*a13"}, "a23": {"description": "", "templateType": "anything", "name": "a23", "group": "Ungrouped variables", "definition": "random(-4..4)"}, "cof33": {"description": "", "templateType": "anything", "name": "cof33", "group": "cofactors", "definition": "a11*a22-a12*a21"}, "cof22": {"description": "", "templateType": "anything", "name": "cof22", "group": "cofactors", "definition": "a11*a33-a31*a13"}, "cof21": {"description": "", "templateType": "anything", "name": "cof21", "group": "cofactors", "definition": "a32*a13-a12*a33"}, "matrixA": {"description": "", "templateType": "anything", "name": "matrixA", "group": "Ungrouped variables", "definition": "matrix([a11,a12,a13],[a21,a22,a23],[a31,a32,a33])"}, "a32": {"description": "", "templateType": "anything", "name": "a32", "group": "Ungrouped variables", "definition": "random(-4..2)"}, "inverseA": {"description": "", "templateType": "anything", "name": "inverseA", "group": "Ungrouped variables", "definition": "matrix([cof11,cof21,cof31],[cof12,cof22,cof32],[cof13,cof23,cof33])/det(matrixA)"}, "cof12": {"description": "", "templateType": "anything", "name": "cof12", "group": "cofactors", "definition": "a23*a31-a21*a33"}, "cof23": {"description": "

cof23

", "templateType": "anything", "name": "cof23", "group": "cofactors", "definition": "a12*a31-a11*a32"}, "a31": {"description": "", "templateType": "anything", "name": "a31", "group": "Ungrouped variables", "definition": "random(0..4)"}, "b1": {"description": "", "templateType": "anything", "name": "b1", "group": "Vector b", "definition": "random(-5..5)"}, "b3": {"description": "", "templateType": "anything", "name": "b3", "group": "Vector b", "definition": "random(0..9)"}, "a11": {"description": "", "templateType": "anything", "name": "a11", "group": "Ungrouped variables", "definition": "random(-3..3)"}, "cof13": {"description": "", "templateType": "anything", "name": "cof13", "group": "cofactors", "definition": "a21*a32-a31*a22"}, "a13": {"description": "", "templateType": "anything", "name": "a13", "group": "Ungrouped variables", "definition": "random(-5..5)"}, "vectorb": {"description": "", "templateType": "anything", "name": "vectorb", "group": "Vector b", "definition": "matrix([b1],[b2],[b3])"}, "a33": {"description": "", "templateType": "anything", "name": "a33", "group": "Ungrouped variables", "definition": "random(-4..4)"}, "a12": {"description": "", "templateType": "anything", "name": "a12", "group": "Ungrouped variables", "definition": "random(-2..4)"}, "a22": {"description": "", "templateType": "anything", "name": "a22", "group": "Ungrouped variables", "definition": "random(0..5 except(a21*a12/a11))"}, "a21": {"description": "", "templateType": "anything", "name": "a21", "group": "Ungrouped variables", "definition": "random(3..8)"}, "b2": {"description": "", "templateType": "anything", "name": "b2", "group": "Vector b", "definition": "random(-3..6 except 0)"}, "cof11": {"description": "", "templateType": "anything", "name": "cof11", "group": "cofactors", "definition": "a22*a33-a32*a23"}, "cof32": {"description": "", "templateType": "anything", "name": "cof32", "group": "cofactors", "definition": "a13*a21-a11*a23"}}, "tags": [], "extensions": [], "rulesets": {}, "name": "Simon's copy of 3x3 matrix: Cofactors, Determinant, Inverse, Equation solving", "functions": {}, "variablesTest": {"maxRuns": "5", "condition": "det(matrixA)<>0"}, "metadata": {"description": "

Cofactors Determinant and inverse of a 3x3 matrix.

", "licence": "Creative Commons Attribution 4.0 International"}, "variable_groups": [{"name": "cofactors", "variables": ["cof11", "cof12", "cof13", "cof21", "cof22", "cof23", "cof31", "cof32", "cof33"]}, {"name": "Unnamed group", "variables": []}, {"name": "Vector b", "variables": ["b1", "b2", "b3", "vectorb"]}], "preamble": {"js": "", "css": ""}, "parts": [{"marks": 0, "variableReplacements": [], "gaps": [{"allowFractions": true, "correctAnswerStyle": "plain", "marks": "1", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof11}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof11}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof12}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof12}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof13}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof13}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof21}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof21}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof22}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof22}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof23}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof23}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof31}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof31}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof32}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof32}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}, {"allowFractions": false, "correctAnswerStyle": "plain", "marks": "0.5", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "{cof33}", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "{cof33}", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "prompt": "

Calculate the nine cofactors of A=$\\var{matrixA}$

\n

(where $cof _{ij}$ represents the element in position $i,j$ of the cofactor matrix)

\n

$cof _{11}=$ [[0]]

\n

$cof_{12}=$ [[1]]

\n

$cof_{13}=$ [[2]]

\n

$cof_{21}=$ [[3]]

\n

$cof_{22}=$ [[4]]

\n

$cof_{23}=$ [[5]]

\n

$cof_{31}=$ [[6]]

\n

$cof_{32}=$ [[7]]

\n

$cof_{33}=$ [[8]]

", "sortAnswers": false, "showCorrectAnswer": true, "type": "gapfill", "unitTests": []}, {"marks": 0, "variableReplacements": [], "gaps": [{"allowFractions": false, "correctAnswerStyle": "plain", "marks": "4", "variableReplacements": [], "mustBeReduced": false, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "minValue": "det(matrixA)", "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst", "maxValue": "det(matrixA)", "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "notationStyles": ["plain", "en", "si-en"]}], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "prompt": "

What is the determinant of A=$\\var{matrixA}$?

\n

[[0]]

", "sortAnswers": false, "showCorrectAnswer": true, "type": "gapfill", "unitTests": []}, {"marks": 0, "variableReplacements": [], "gaps": [{"allowFractions": true, "allowResize": true, "customMarkingAlgorithm": "", "marks": "4", "variableReplacements": [], "numRows": "3", "showFeedbackIcon": true, "numColumns": "3", "correctAnswer": "precround(inverseA,3)", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "correctAnswerFractions": false, "showCorrectAnswer": true, "type": "matrix", "tolerance": "0.005", "unitTests": [], "markPerCell": false}], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "prompt": "

\n

What is the inverse of A=$\\var{matrixA}$? Elements will be accepted as fractions or correct to 2 decimal places.

\n

[[0]]

", "sortAnswers": false, "showCorrectAnswer": true, "type": "gapfill", "unitTests": []}, {"allowFractions": true, "allowResize": false, "correctAnswer": "precround(inverseA*vectorb,3)", "markPerCell": false, "marks": "3", "variableReplacements": [], "numRows": "3", "customMarkingAlgorithm": "", "numColumns": 1, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "prompt": "

Hence solve the equation

\n

$ \\var{matrixA} \\left(\\matrix{x\\\\y\\\\z}\\right) = \\var{vectorb}$

\n

\n

$ \\left(\\matrix{x\\\\y\\\\z}\\right) = $

", "correctAnswerFractions": false, "showCorrectAnswer": true, "type": "matrix", "tolerance": "0.01", "unitTests": []}], "statement": "", "type": "question", "contributors": [{"name": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Violeta CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1030/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}