// Numbas version: exam_results_page_options {"name": "Inverse of 2x2 matrix", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "extensions": [], "statement": "

Consider the 2x2 matrix $\\mathbf{A} = \\var{ma}$.

\n

Input all numbers as fractions or integers and not as decimals.

", "ungrouped_variables": ["ma", "a00", "a01", "a10", "a11", "mb", "ma_inverse", "x", "y"], "variables": {"a01": {"description": "", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "templateType": "anything", "name": "a01"}, "a11": {"description": "", "group": "Ungrouped variables", "definition": "random(-9..9 except [0,a01,-a01])", "templateType": "anything", "name": "a11"}, "a10": {"description": "", "group": "Ungrouped variables", "definition": "random(-9..9 except [0,a00,-a00,a00*a11/a01])", "templateType": "anything", "name": "a10"}, "a00": {"description": "", "group": "Ungrouped variables", "definition": "random(-9..9 except 0)", "templateType": "anything", "name": "a00"}, "ma_inverse": {"description": "", "group": "Ungrouped variables", "definition": "matrix([\n [ma[1][1], -ma[0][1]],\n [-ma[1][0], ma[0][0]]\n])/det(ma)", "templateType": "anything", "name": "ma_inverse"}, "y": {"description": "", "group": "Ungrouped variables", "definition": "(ma_inverse*mb)[1][0]", "templateType": "anything", "name": "y"}, "mb": {"description": "", "group": "Ungrouped variables", "definition": "matrix([\n [random(-9..9 except 0)],\n [random(-9..9 except 0)]\n])", "templateType": "anything", "name": "mb"}, "x": {"description": "", "group": "Ungrouped variables", "definition": "(ma_inverse*mb)[0][0]", "templateType": "anything", "name": "x"}, "ma": {"description": "

Matrix A. a10 is picked so it's non-singular, and a11 is never $\\pm a01$.

\n

No entry is 0.

", "group": "Ungrouped variables", "definition": "matrix([\n [a00,a01],\n [a10,a11]\n])", "templateType": "anything", "name": "ma"}}, "variable_groups": [], "metadata": {"description": "

Putting a pair of linear equations into matrix notation and then solving by finding the inverse of the coefficient matrix. 

", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"condition": "", "maxRuns": 100}, "name": "Inverse of 2x2 matrix", "advice": "

The inverse of the 2x2 matrix $\\mathbf{A} = \\left ( \\begin{matrix}a&b\\\\c&d \\end{matrix} \\right ) $ is given by

\n

$\\mathbf{A}^{-1} = \\frac{1}{\\det(\\mathbf{A})} \\left ( \\begin{matrix}  d&-b\\\\-c&a \\end{matrix} \\right )$.

\n

Hence, as $\\mathrm{det}(\\mathbf{A}) = \\simplify[]{ {ma[0][0]}*{ma[1][1]} - {ma[0][1]}*{ma[1][0]}} = \\var{det(ma)} \\neq 0$, so $\\mathbf{A}$ is invertible. Therefore

\n

\\[ \\mathbf{A}^{-1} = \\simplify[fractionnumbers]{{ma_inverse}} \\]

", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "parts": [{"variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "unitTests": [], "showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "gaps": [{"correctAnswerFractions": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "numRows": "2", "extendBaseMarkingAlgorithm": true, "unitTests": [], "allowFractions": true, "correctAnswer": "ma_inverse", "showCorrectAnswer": true, "variableReplacements": [], "marks": "1", "numColumns": "2", "tolerance": 0, "scripts": {}, "type": "matrix", "markPerCell": true, "allowResize": false}], "prompt": "

Find the inverse of $\\mathbf{A}$.

\n

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

", "sortAnswers": false, "scripts": {}, "type": "gapfill"}], "tags": [], "functions": {}, "type": "question", "contributors": [{"name": "Blathnaid Sheridan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/447/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Peter Johnston", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/771/"}, {"name": "Morteza Shahpari", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2886/"}]}]}], "contributors": [{"name": "Blathnaid Sheridan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/447/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Peter Johnston", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/771/"}, {"name": "Morteza Shahpari", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2886/"}]}