// Numbas version: finer_feedback_settings {"name": "Mark's copy of Inverse of a 2x2 Matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "extensions": [], "preamble": {"css": "", "js": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "variables": {"b21": {"description": "", "definition": "-{a21}/det", "group": "Ungrouped variables", "templateType": "anything", "name": "b21"}, "s": {"description": "", "definition": "a21*r1+a22*s1", "group": "Ungrouped variables", "templateType": "anything", "name": "s"}, "r1": {"description": "", "definition": "random(2..7#1)", "group": "Ungrouped variables", "templateType": "randrange", "name": "r1"}, "b12": {"description": "", "definition": "-{a12}/det", "group": "Ungrouped variables", "templateType": "anything", "name": "b12"}, "b11": {"description": "", "definition": "{a22}/det", "group": "Ungrouped variables", "templateType": "anything", "name": "b11"}, "a11": {"description": "", "definition": "random(1..10#1)", "group": "Ungrouped variables", "templateType": "randrange", "name": "a11"}, "b22": {"description": "", "definition": "{a11}/det", "group": "Ungrouped variables", "templateType": "anything", "name": "b22"}, "r": {"description": "", "definition": "a11*r1+a12*s1", "group": "Ungrouped variables", "templateType": "anything", "name": "r"}, "det": {"description": "", "definition": "{a11}*{a22}-{a12}*{a21}", "group": "Ungrouped variables", "templateType": "anything", "name": "det"}, "a22": {"description": "", "definition": "{k}*{a12}+1", "group": "Ungrouped variables", "templateType": "anything", "name": "a22"}, "c": {"description": "", "definition": "random(1,2,4,5,10)", "group": "Ungrouped variables", "templateType": "anything", "name": "c"}, "a21": {"description": "", "definition": "{k}*{a11}+1", "group": "Ungrouped variables", "templateType": "anything", "name": "a21"}, "a12": {"description": "", "definition": "{a11}-{c}", "group": "Ungrouped variables", "templateType": "anything", "name": "a12"}, "s1": {"description": "", "definition": "random(6..14#1)", "group": "Ungrouped variables", "templateType": "randrange", "name": "s1"}, "k": {"description": "", "definition": "random(2..11#1)", "group": "Ungrouped variables", "templateType": "randrange", "name": "k"}}, "variable_groups": [], "statement": "

Given the matrix:

\n

\\(\\mathbf{A}=\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\)

\n

", "metadata": {"description": "

This question tests learner's knowledge of the inverse matrix method for a 2x2 matrix.

", "licence": "Creative Commons Attribution 4.0 International"}, "name": "Mark's copy of Inverse of a 2x2 Matrix", "advice": "

Given a matrix \\(\\mathbf{A}=\\begin{pmatrix} a & b\\\\ c & d\\\\ \\end{pmatrix}\\)

\n

The determinant of the matrix is given by:  \\(|\\mathbf{A}|=ad-bc\\)

\n

\\(\\mathbf{A}=\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\)

\n

 \\(|\\mathbf{A}|=(\\var{a11})*(\\var{a22})-(\\var{a12})*(\\var{a21})=\\simplify{{a11}*{a22}-{a12}*{a21}}\\)

\n

The adjoint of the matrix is given by:  \\(\\mathbf{A^*}=\\begin{pmatrix} d & -b\\\\ -c & a\\\\ \\end{pmatrix}\\)

\n

\\(\\mathbf{A^*}=\\begin{pmatrix} \\var{a22} & \\simplify{-{a12}}\\\\ \\simplify{-{a21}} & \\var{a11}\\\\ \\end{pmatrix}\\)

\n

We combine these results to get the inverse matrix:  \\(\\mathbf{A^{-1}}=\\frac{1}{|\\mathbf{A}|}\\begin{pmatrix} d & -b\\\\ -c & a\\\\ \\end{pmatrix}\\)

\n

\\(A^{-1}=\\begin{pmatrix} \\var{b11} & \\var{b12}\\\\ \\var{b21} & \\var{b22} \\end{pmatrix}\\)

\n

To solve the problem:

\n

\\(\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} x\\\\y\\end{pmatrix}=\\begin{pmatrix} \\var{r}\\\\\\var{s}\\end{pmatrix}\\)

\n

\\(\\begin{pmatrix} x\\\\y\\end{pmatrix}=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{r}\\\\\\var{s}\\end{pmatrix}\\)

\n

\\(\\begin{pmatrix} x\\\\y\\end{pmatrix}=\\begin{pmatrix}(\\var{b11})*(\\var{r})+(\\var{b12})*(\\var{s})\\\\(\\var{b21})*(\\var{r})+(\\var{b22})*(\\var{s})\\end{pmatrix}\\)

\n

\\(\\begin{pmatrix} x\\\\y\\end{pmatrix}=\\begin{pmatrix}\\simplify{{b11}*{r}+{b12}*{s}}\\\\\\simplify{{b21}*{r}+{b22}*{s}}\\end{pmatrix}\\)

", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "ungrouped_variables": ["a11", "a12", "a21", "a22", "k", "det", "b11", "b12", "b21", "b22", "c", "r", "s", "r1", "s1"], "parts": [{"type": "gapfill", "marks": 0, "gaps": [{"type": "matrix", "variableReplacements": [], "correctAnswerFractions": false, "allowResize": true, "markPerCell": true, "correctAnswer": "matrix([\n [b11,b12],\n [b21,b22]\n])", "marks": "2", "allowFractions": false, "numRows": "2", "showCorrectAnswer": true, "numColumns": "2", "tolerance": 0, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}}], "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

Determine the inverse matrix $\\mathbf{A^{-1}}$

\n

Input the exact values of the entries in to the matrix.

\n

$\\mathbf{A^{-1}}$ =   [[0]]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}}, {"type": "gapfill", "marks": 0, "gaps": [{"type": "numberentry", "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "maxValue": "{b11}*{r}+{b12}*{s}", "minValue": "{b11}*{r}+{b12}*{s}", "correctAnswerFraction": false, "marks": 1, "precisionPartialCredit": 0, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "allowFractions": false, "precision": "2", "showFeedbackIcon": true, "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "scripts": {}, "strictPrecision": false}, {"type": "numberentry", "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "variableReplacements": [], "maxValue": "{b21}*{r}+{b22}*{s}", "minValue": "{b21}*{r}+{b22}*{s}", "correctAnswerFraction": false, "marks": 1, "precisionPartialCredit": 0, "correctAnswerStyle": "plain", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "allowFractions": false, "precision": "2", "showFeedbackIcon": true, "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "scripts": {}, "strictPrecision": false}], "variableReplacements": [], "showCorrectAnswer": true, "prompt": "

Hence or otherwise solve the following system of linear equations:

\n

\\(\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} x\\\\y\\end{pmatrix}=\\begin{pmatrix} \\var{r}\\\\\\var{s}\\end{pmatrix}\\)

\n

Give your answers correct to two decimal places.

\n

\\(x=\\) [[0]]

\n

\\(y=\\) [[1]]

", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "scripts": {}}], "type": "question", "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}]}], "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}]}