// Numbas version: finer_feedback_settings {"name": "Matrices", "metadata": {"description": "
Matrix addition, multiplication. Finding inverse. Determinants. Systems of equations.
\nrebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questions": [{"name": "Linear combinations of 2 x 2 matrices", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "functions": {}, "ungrouped_variables": ["a", "q1", "c", "b", "r1", "q", "p", "p1", "apb", "lcab", "lcabc"], "tags": ["addition of matrices", "linear algebra", "linear combination of matrices", "matrices", "matrix"], "preamble": {"css": "", "js": ""}, "advice": "\\[ \\begin{eqnarray*} \\simplify[std]{A+B} &=&\\simplify[std]{{a}+{b}}\\\\ &=& \\begin{pmatrix} \\simplify[std]{{a[0][0]}+{b[0][0]}}& \\simplify[std]{{a[0][1]}+{b[0][1]}}\\\\ \\simplify[std]{{a[1][0]}+{b[1][0]}}&\\simplify[std]{{a[1][1]}+{b[1][1]}} \\end{pmatrix}\\\\ &=&\\simplify{{apb}}\\\\ \\end{eqnarray*} \\]
\n\\[ \\begin{eqnarray*} \\simplify[std]{{p}A+{q}B} &=&\\simplify[std]{{p}{a}+{q}{b}}\\\\ &=& \\begin{pmatrix} \\simplify[std]{{p}*{a[0][0]}+{q}*{b[0][0]}}& \\simplify[std]{{p}*{a[0][1]}+{q}*{b[0][1]}}\\\\ \\simplify[std]{{p}*{a[1][0]}+{q}*{b[1][0]}}&\\simplify[std]{{p}*{a[1][1]}+{q}*{b[1][1]}} \\end{pmatrix}\\\\ &=&\\simplify{{lcab}}\\\\ \\end{eqnarray*} \\]
\n\\[ \\begin{eqnarray*} \\simplify[std]{{p1}A+{q1}B+{r1}C} &=&\\simplify[std]{{p1}{a}+{q1}{b}+{r1}{c}}\\\\ &=& \\begin{pmatrix} \\simplify[std]{{p1}*{a[0][0]}+{q1}*{b[0][0]}+{r1}*{c[0][0]}}& \\simplify[std]{{p1}*{a[0][1]}+{q1}*{b[0][1]}+{r1}*{c[0][1]}}\\\\ \\simplify[std]{{p1}*{a[1][0]}+{q1}*{b[1][0]}+{r1}*{c[1][0]}}&\\simplify[std]{{p1}*{a[1][1]}+{q1}*{b[1][1]}+{r1}*{c[1][1]}} \\end{pmatrix}\\\\ &=&\\simplify{{lcabc}}\\\\ \\end{eqnarray*} \\]
\n", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noleadingminus"]}, "parts": [{"prompt": "
$\\mathrm{A}+\\mathrm{B} = \\simplify[std]{{a}+{b}} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "apb", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$\\simplify{{p}A+{q}B = {p}{a}+{q}{b}}=$ [[0]]", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "lcab", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$\\simplify{{p1}A+{q1}B+{r1}C = {p1}{a}+{q1}{b}+{r1}{c}}=$ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "lcabc", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "Let
\\[A=\\simplify{{a}},\\;\\; B=\\simplify{{b}},\\;\\; C=\\simplify{{c}}\\]
Calculate the following $2 \\times 2$ matrices:
", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "matrix(repeat(repeat(random(-5..5 except 0),2),2))", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "q1": {"definition": "random(-6..6 except [0,1,-1,p1,q])", "templateType": "anything", "group": "Ungrouped variables", "name": "q1", "description": ""}, "c": {"definition": "matrix(repeat(repeat(random(-5..5 except [0,a[0][0],b[0][0]]),2),2))", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "matrix(repeat(repeat(random(-5..5 except [0,a[0][0]]),2),2))", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "r1": {"definition": "random(-6..6 except [0,1,-1,p1,q1])", "templateType": "anything", "group": "Ungrouped variables", "name": "r1", "description": ""}, "q": {"definition": "random(-6..6 except [0,1,-1,p])", "templateType": "anything", "group": "Ungrouped variables", "name": "q", "description": ""}, "p": {"definition": "random(2..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "p1": {"definition": "random(2..6 except p)", "templateType": "anything", "group": "Ungrouped variables", "name": "p1", "description": ""}, "apb": {"definition": "a+b", "templateType": "anything", "group": "Ungrouped variables", "name": "apb", "description": ""}, "lcab": {"definition": "p*a+q*b", "templateType": "anything", "group": "Ungrouped variables", "name": "lcab", "description": ""}, "lcabc": {"definition": "p1*a+q1*b+r1*c", "templateType": "anything", "group": "Ungrouped variables", "name": "lcabc", "description": ""}}, "metadata": {"notes": "\n \t\t
8/02/2013:
\n \t\t
Finished first draft.
Linear combinations of $2 \\times 2$ matrices. Three examples.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Matrix Multiplication 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "functions": {}, "ungrouped_variables": ["ba21", "a21", "a22", "ba22", "cb21", "b22", "b21", "cb22", "ac22", "ac21", "ab22", "ab21", "b12", "b11", "c12", "c11", "c22", "a11", "cb11", "cb12", "a12", "c21", "ba11", "ba12", "ab12", "ab11", "ac12", "ac11"], "tags": ["matrices", "matrix", "matrix multiplication", "matrix product", "multiplication of matrices", "multiplying matrices", "product of matrices"], "preamble": {"css": "", "js": ""}, "advice": "\\[ \\begin{eqnarray*} AB &=& \\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\simplify[]{{a11}{b11}+{a12}{b21}}&\\simplify[]{{a11}{b12}+{a12}{b22}}\\\\ \\simplify[]{{a21}{b11}+{a22}{b21}}&\\simplify[]{{a21}{b12}+{a22}{b22}}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\var{ab11}&\\var{ab12}\\\\ \\var{ab21}&\\var{ab22}\\\\ \\end{pmatrix} \\end{eqnarray*} \\]
\n\\[ \\begin{eqnarray*} BA &=& \\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\simplify[]{{b11}{a11}+{b12}{a21}}&\\simplify[]{{b11}{a12}+{b12}{a22}}\\\\ \\simplify[]{{b21}{a11}+{b22}{a21}}&\\simplify[]{{b21}{a12}+{b22}{a22}}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\var{ba11}&\\var{ba12}\\\\ \\var{ba21}&\\var{ba22}\\\\ \\end{pmatrix} \\end{eqnarray*} \\]
\n\\[ \\begin{eqnarray*} CB &=& \\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\simplify[]{{c11}{b11}+{c12}{b21}}&\\simplify[]{{c11}{b12}+{c12}{b22}}\\\\ \\simplify[]{{c21}{b11}+{c22}{b21}}&\\simplify[]{{c21}{b12}+{a22}{b22}}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\var{cb11}&\\var{cb12}\\\\ \\var{cb21}&\\var{cb22}\\\\ \\end{pmatrix} \\end{eqnarray*} \\]
\n\\[ \\begin{eqnarray*} AC &=& \\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\simplify[]{{a11}{c11}+{a12}{c21}}&\\simplify[]{{a11}{c12}+{a12}{c22}}\\\\ \\simplify[]{{a21}{c11}+{a22}{c21}}&\\simplify[]{{a21}{c12}+{a22}{c22}}\\\\ \\end{pmatrix}\\\\ &=& \\begin{pmatrix} \\var{ac11}&\\var{ac12}\\\\ \\var{ac21}&\\var{ac22}\\\\ \\end{pmatrix} \\end{eqnarray*} \\]
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "parts": [{"prompt": "$AB = \\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [ab11,ab12],\n [ab21,ab22]\n])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$BA = \\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}=$ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [ba11,ba12],\n [ba21,ba22]\n])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$CB = \\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix} \\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix}=$ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [cb11,cb12],\n [cb21,cb22]\n])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$AC = \\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix}\\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix}=$ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [ac11,ac12],\n [ac21,ac22]\n])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "\n \n \nDo the following matrix problems
Let
\\[A=\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix},\\;\\;\n \n B=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix},\\;\\;\n \n C=\\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix}\\]
Calculate the following products of these matrices:
10/07/2012:
\n \t\t \t\tAdded tags.
\n \t\t \t\tDisplay of matrices looks untidy when individual components include negative numbers.
\n \t\t \t\tIs it worthwhile restricting all components of matrices to be non zero?
\n \t\t \t\tQuestion appears to be working correctly.
\n \t\t \n \t\t", "description": "Multiplication of $2 \\times 2$ matrices.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Determinants ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Hayley Bishop", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/93/"}], "functions": {}, "ungrouped_variables": ["a21", "a22", "b22", "b21", "b1", "s2", "s1", "b12", "b11", "tr1", "c12", "c11", "tr2", "tr4", "c22", "a11", "a12", "db", "dc", "da", "a1", "c21", "c1", "tr3", "a", "b", "s", "u", "t"], "tags": ["determinant of a matrix", "inverse", "inverse matrix", "matrix", "matrix inverse", "matrix multiplication", "multiply matrix"], "advice": "Here is the formula for the determinant of a $2 \\times 2$ matrix:
\\[M = \\begin{pmatrix} a & b \\\\ c&d \\end{pmatrix} \\Rightarrow \\mathrm{det}\\left(M\\right) = ad-bc \\]
$\\mathrm{det}\\left(A\\right) = \\simplify[]{{a11}*{a22}-{a12}*{a21} = {dA}}$
$\\mathrm{det}\\left(B\\right) = \\simplify[]{{b11}*{b22}-{b12}*{b21} = {dB}}$
$\\mathrm{det}\\left(C\\right) = \\simplify[]{{c11}*{c22}-{c12}*{c21} = {dC}}$
If we have two $n \\times n$ matrices $M$ and $N$ then:
\\[\\mathrm{det}\\left(MN\\right) = \\mathrm{det}\\left(M\\right)\\mathrm{det}\\left(N\\right)\\]
And it follows that if we have a third matrix $P$ that:
\\[\\mathrm{det}\\left(MNP\\right) = \\mathrm{det}\\left(M\\right)\\mathrm{det}\\left(N\\right)\\mathrm{det}\\left(P\\right)\\]
Thus for our example we have:
\n\\[\\begin{eqnarray*}\\mathrm{det}\\left(ABC\\right) &=& \\mathrm{det}\\left(A\\right)\\times\\mathrm{det}\\left(B\\right)\\times\\mathrm{det}\\left(C\\right)\\\\ &=& \\var{dA}\\times \\var{dB} \\times \\var{dC}\\\\ &=& \\var{dA*dB*dC} \\end{eqnarray*} \\]
\nSuppose $M$ is a $2 \\times 2$ matrix and $\\mathrm{det}\\left(M\\right) = \\Delta \\neq 0$.
\nThen $M$ is invertible and:
\\[M = \\begin{pmatrix} a & b \\\\ c&d \\end{pmatrix} \\Rightarrow M^{-1} = \\frac{1}{\\Delta} \\begin{pmatrix} d & -b\\\\ -c& a \\end{pmatrix}=\\begin{pmatrix} \\frac{d}{\\Delta} & -\\frac{b}{\\Delta}\\\\ -\\frac{c}{\\Delta}& \\frac{a}{\\Delta} \\end{pmatrix}\\]
Applying this to these examples we obtain:
\n\\[A^{-1} = \\begin{pmatrix} \\simplify[std]{{a22}/{dA}} &\\simplify[std]{{-a12}/{dA}}\\\\\\simplify[std]{{-a21}/{dA}}&\\simplify[std]{{a11}/{dA}}\\end{pmatrix}\\]
\n\\[B^{-1} = \\begin{pmatrix} \\simplify[std]{{b22}/{dB}} &\\simplify[std]{{-b12}/{dB}}\\\\\\simplify[std]{{-b21}/{dB}}&\\simplify[std]{{b11}/{dB}}\\end{pmatrix}\\]
\n\\[C^{-1} = \\begin{pmatrix} \\simplify[std]{{c22}/{dC}} &\\simplify[std]{{-c12}/{dC}}\\\\\\simplify[std]{{-c21}/{dC}}&\\simplify[std]{{c11}/{dC}}\\end{pmatrix}\\]
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "parts": [{"prompt": "Calculate the determinants of these matrices:
\n$\\mathrm{det}\\left(A\\right) = \\;\\;$[[0]]$,\\;\\;\\;\\mathrm{det}\\left(B\\right) = \\;\\;$[[1]]$,\\;\\;\\;\\mathrm{det}\\left(C\\right) = \\;\\;$[[2]]$,\\;\\;\\;\\mathrm{det}\\left(ABC\\right) = \\;\\;$[[3]]
", "marks": 0, "gaps": [{"allowFractions": false, "scripts": {}, "maxValue": "dA", "minValue": "dA", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "scripts": {}, "maxValue": "dB", "minValue": "dB", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "scripts": {}, "maxValue": "dC", "minValue": "dC", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "scripts": {}, "maxValue": "dA*dB*dC", "minValue": "dA*dB*dC", "correctAnswerFraction": false, "showCorrectAnswer": true, "marks": 0.5, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "Let
\\[A=\\begin{pmatrix} \\var{a11}&\\var{a12}\\\\ \\var{a21}&\\var{a22}\\\\ \\end{pmatrix},\\;\\; B=\\begin{pmatrix} \\var{b11}&\\var{b12}\\\\ \\var{b21}&\\var{b22}\\\\ \\end{pmatrix},\\;\\; C=\\begin{pmatrix} \\var{c11}&\\var{c12}\\\\ \\var{c21}&\\var{c22}\\\\ \\end{pmatrix}\\]
10/07/2012:
\n \t\t \t\t \t\tAdded tags.
Question appears to be working correctly.
\n \t\t \t\t \t\tCorrected a typo in the Advice section.
Find the determinant of three $2 \\times 2$ invertible matrices.
", "licence": "None specified"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Determinant and inverse of 2x2 matrices", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "functions": {"inverse": {"definition": "matrix([\n [m[1][1],-m[0][1]],\n [-m[1][0],m[0][0]]\n])/det(m)", "type": "matrix", "language": "jme", "parameters": [["m", "matrix"]]}}, "ungrouped_variables": [], "tags": ["determinant of a matrix", "inverse", "inverse matrix", "matrices", "matrix", "matrix inverse", "matrix multiplication", "multiplication of matrices", "tested1"], "preamble": {"css": "", "js": ""}, "advice": "The determinant of a matrix $\\mathrm{M} = \\begin{pmatrix} a&b \\\\ c&d \\end{pmatrix}$ is given by
\n\\[ \\det\\left(\\mathrm{M}\\right) = ad-bc \\]
\nIf we have two $n \\times n$ matrices $M$ and $N$, then
\n\\[ \\det\\left(\\mathrm{MN}\\right) = \\det\\left(\\mathrm{M}\\right)\\det\\left(\\mathrm{N}\\right) \\]
\nAnd it follows that if we have a third matrix $P$,
\n\\[ \\det\\left(\\mathrm{MNP}\\right) = \\det\\left(\\mathrm{M}\\right)\\det\\left(\\mathrm{N}\\right)\\det\\left(\\mathrm{P}\\right) \\]
\nThus for our example we have:
\n\\begin{align}
\\det\\left(\\mathrm{A}\\right) &= \\simplify[]{{a11}*{a22}-{a12}*{a21} = {det(a)}} \\\\
\\det\\left(\\mathrm{B}\\right) &= \\simplify[]{{b11}*{b22}-{b12}*{b21} = {det(b)}} \\\\
\\det\\left(\\mathrm{C}\\right) &= \\simplify[]{{c11}*{c22}-{c12}*{c21} = {det(c)}}
\\end{align}
\\begin{align}
\\det\\left( \\mathrm{ABC} \\right) &= \\det(\\mathrm{A}) \\det(\\mathrm{B}) \\det(\\mathrm{C}) \\\\
&= \\simplify[]{{det(a)}*{det(b)}*{det(c)}} \\\\
&= \\var{det(a*b*c)}
\\end{align}
Suppose $\\mathrm{M} = \\begin{pmatrix} a&b \\\\ c&d \\end{pmatrix}$ is a $2 \\times 2$ matrix and $\\det\\left(\\mathrm{M}\\right) = \\Delta \\neq 0$.
\nThen $\\mathrm{M}$ is invertible and
\n\\[ \\mathrm{M}^{-1} = \\frac{1}{\\Delta} \\begin{pmatrix} d & -b\\\\ -c& a \\end{pmatrix}=\\begin{pmatrix} \\frac{d}{\\Delta} & -\\frac{b}{\\Delta}\\\\ -\\frac{c}{\\Delta}& \\frac{a}{\\Delta} \\end{pmatrix}\\]
\nApplying this to these examples we obtain:
\n\\[ \\simplify[fractionnumbers]{matrix:A^(-1)={inverse(a)}} \\]
\n\\[ \\simplify[fractionnumbers]{matrix:B^(-1)={inverse(b)}} \\]
\n\\[ \\simplify[fractionnumbers]{matrix:C^(-1)={inverse(c)}} \\]
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers"]}, "parts": [{"prompt": "Let
\n\\[\\mathrm{A} = \\var{a},\\;\\; \\mathrm{B} = \\var{b},\\;\\; \\mathrm{C} = \\var{c}\\]
\nCalculate the determinants of these matrices:
\n$\\det\\left(\\mathrm{A}\\right) = $ [[0]]
\n$\\det\\left(\\mathrm{B}\\right) = $ [[1]]
\n$\\det\\left(\\mathrm{C}\\right) = $ [[2]]
\n$\\det\\left(\\mathrm{ABC}\\right) = $ [[3]]
", "marks": 0, "gaps": [{"allowFractions": false, "marks": 0.5, "maxValue": "det(a)", "minValue": "det(a)", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "det(b)", "minValue": "det(b)", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "det(c)", "minValue": "det(c)", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "marks": 0.5, "maxValue": "det(a*b*c)", "minValue": "det(a*b*c)", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "Find the inverses of the matrices given above. Input all matrix entries as fractions or integers and not as decimals.
\n$\\mathrm{A}^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": true, "correctAnswerFractions": true, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "inverse(a)", "scripts": {}, "marks": 1, "tolerance": "0.01", "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$\\mathrm{B}^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": true, "correctAnswerFractions": true, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "inverse(b)", "scripts": {}, "marks": 1, "tolerance": "0.01", "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$\\mathrm{C}^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": true, "correctAnswerFractions": true, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "inverse(c)", "scripts": {}, "marks": 1, "tolerance": "0.01", "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "statement": "Do the following matrix problems.
", "variable_groups": [{"variables": ["a11", "a12", "a21", "a22", "a"], "name": "Matrix A"}, {"variables": ["b11", "b12", "b21", "b22", "b"], "name": "Matrix B"}, {"variables": ["c11", "c12", "c21", "c22", "c"], "name": "Matrix C"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "variables": {"c22": {"definition": "random(1..9 except c21*c12/c11)", "templateType": "anything", "group": "Matrix C", "name": "c22", "description": ""}, "a21": {"definition": "random(-6..6 except 0) ", "templateType": "anything", "group": "Matrix A", "name": "a21", "description": ""}, "a22": {"definition": "random(1..9 except a21*a12/a11)", "templateType": "anything", "group": "Matrix A", "name": "a22", "description": ""}, "c21": {"definition": "random(2..5)", "templateType": "anything", "group": "Matrix C", "name": "c21", "description": ""}, "a11": {"definition": "random(-9..9 except 0)", "templateType": "anything", "group": "Matrix A", "name": "a11", "description": ""}, "a12": {"definition": "random(-5..5)", "templateType": "anything", "group": "Matrix A", "name": "a12", "description": ""}, "c": {"definition": "matrix([\n [c11,c12],\n [c21,c22]\n])", "templateType": "anything", "group": "Matrix C", "name": "c", "description": ""}, "b21": {"definition": "random(-6..6 except 0)", "templateType": "anything", "group": "Matrix B", "name": "b21", "description": ""}, "b22": {"definition": "random(-9..9 except [0,b21*b12/b11])", "templateType": "anything", "group": "Matrix B", "name": "b22", "description": ""}, "b": {"definition": "matrix([\n [b11,b12],\n [b21,b22]\n])", "templateType": "anything", "group": "Matrix B", "name": "b", "description": ""}, "b12": {"definition": "random(-5..5)", "templateType": "anything", "group": "Matrix B", "name": "b12", "description": ""}, "a": {"definition": "matrix([\n [a11,a12],\n [a21,a22]\n])", "templateType": "anything", "group": "Matrix A", "name": "a", "description": ""}, "b11": {"definition": "random(1..9 except a11)\n//if(a11=tr2,tr2+1,tr2)", "templateType": "anything", "group": "Matrix B", "name": "b11", "description": ""}, "c12": {"definition": "a12+b12", "templateType": "anything", "group": "Matrix C", "name": "c12", "description": ""}, "c11": {"definition": "random(1,2,4)", "templateType": "anything", "group": "Matrix C", "name": "c11", "description": ""}}, "metadata": {"notes": "10/07/2012:
\nAdded tags.
Question appears to be working correctly.
\nCorrected a typo in the Advice section.
24/12/2012:
\nChecked calculations, OK. Added tested1 tag.
", "description": "Find the determinant and inverse of three $2 \\times 2$ invertible matrices.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "cormac's copy of Matrix question", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "cormac breen", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/306/"}], "functions": {}, "tags": ["inverse of a matrix", "linear equations", "linear equations in matrix form", "matrices", "matrix", "matrix equations", "matrix form", "matrix multiplication", "multiply matrices", "multiply matrix", "solving linear equations", "system of linear equations"], "advice": "\na)
The equations can be written in the matrix form:
\\[\\begin{pmatrix} \\var{a} & \\var{b}\\\\ \\var{a1}&\\var{b1} \\end{pmatrix} \\begin{pmatrix} x \\\\ y \\end{pmatrix} = \\begin{pmatrix} \\var{c} \\\\ \\var{c1} \\end{pmatrix}\\]
b)
\nSince $\\mathrm{det}(A) = \\simplify[]{{a}*{b1}-{b}*{a1}={dA}} \\neq 0$, $A$ is invertible and
\n\\[A^{-1} = \\begin{pmatrix} \\simplify[std]{{b1}/{dA}}&\\simplify[std]{{-b}/{dA}}\\\\\\simplify[std]{{-a1}/{dA}}&\\simplify[std]{{a}/{dA}} \\end{pmatrix}\\]
\nc)
\nWe have:
\\[ \\begin{eqnarray*} A^{-1}b &=& \\begin{pmatrix} \\simplify[std]{{b1}/{dA}}&\\simplify[std]{{-b}/{dA}}\\\\\\simplify[std]{{-a1}/{dA}}&\\simplify[std]{{a}/{dA}} \\end{pmatrix}\\begin{pmatrix} \\var{c}\\\\\\var{c1}\\end{pmatrix} \\\\ &=& \\begin{pmatrix} \\simplify[std]{{c*b1-c1*b}/{dA}}\\\\\\simplify[std]{{c1*a-c*a1}/{dA}}\\end{pmatrix} \\end{eqnarray*} \\]
d) Note that $Av = b \\Rightarrow v = A^{-1}b$ hence we can read the solution from the last part as this gives:
\n\\[\\begin{pmatrix} x\\\\y \\end{pmatrix} = \\begin{pmatrix} \\simplify[std]{{c*b1-c1*b}/{dA}}\\\\ \\simplify[std]{{c1*a-c*a1}/{dA}}\\end{pmatrix}\\]
Hence \\[\\begin{eqnarray*} x&=& \\simplify[std]{{c*b1-c1*b}/{dA}}\\\\ y&=& \\simplify[std]{{c1*a-c*a1}/{dA}} \\end{eqnarray*} \\]
| $A = \\Bigg($ | \n[[0]] | \n[[1]] | \n$\\Bigg)$ | \n
| [[2]] | \n[[3]] | \n||
| $v = \\;\\;\\Bigg($ | \n[[4]] | \n$\\Bigg)$ | \n|
| [[5]] | \n|||
| $b = \\;\\;\\Bigg($ | \n[[6]] | \n$\\Bigg)$ | \n|
| [[7]] | \n
Find the inverse of $A$, input all numbers as fractions or integers and not as decimals:
\n| $A^{-1} = \\Bigg($ | \n[[0]] | \n[[1]] | \n$\\Bigg)$ | \n
| [[2]] | \n[[3]] | \n
Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{b1}/{dA}", "type": "jme"}, {"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{-b}/{dA}", "type": "jme"}, {"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{-a1}/{dA}", "type": "jme"}, {"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{a}/{dA}", "type": "jme"}], "type": "gapfill", "marks": 0.0}, {"prompt": "\nNow find, inputting all numbers as fractions or integers and not as decimals.
\n| $A^{-1}b = \\;\\;\\Bigg($ | \n[[0]] | \n$\\Bigg)$ | \n
| [[1]] | \n
Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{c*b1-c1*b}/{b1*a-a1*b}", "type": "jme"}, {"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{-c*a1+c1*a}/{b1*a-a1*b}", "type": "jme"}], "type": "gapfill", "marks": 0.0}, {"prompt": "\n \n \nNow solve the equations, inputting all numbers as fractions or integers and not as decimals.
$x = \\;\\;$[[0]]
$y = \\;\\;$[[1]]
\n \n \n \n ", "gaps": [{"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{c*b1-c1*b}/{b1*a-a1*b}", "type": "jme"}, {"notallowed": {"message": "Input as a fraction or an integer, not as a decimal
", "showstrings": false, "strings": ["."], "partialcredit": 0.0}, "checkingaccuracy": 0.001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "answersimplification": "std", "marks": 0.5, "answer": "{-c*a1+c1*a}/{b1*a-a1*b}", "type": "jme"}], "type": "gapfill", "marks": 0.0}], "statement": "Write the following equations as a matrix equation
\\[Av=b\\]for a matrix $A$ and column vectors $v$ and $b$
\\[ \\begin{eqnarray*} \\simplify[std]{{a}x+{b}y}&=&\\var{c}\\\\ \\simplify[std]{{a1}x+{b1}y}&=&\\var{c1} \\end{eqnarray*} \\]
20/06/2012:
\n \t\t \t\tAdded, edited tags.
\n \t\t \t\tEdited advice so that it gave the correct solution for $y$ (as in the answer).
\n \t\t \t\t\n \t\t \t\t
\n \t\t \t\t
4/07/2012:
Column vectors v and b have the bracket in the incorrect place.
\n \t\t \t\t\n \t\t \t\t
10/07/2012:
Added tags.
Question appears to be working correctly.
\n \t\t \t\tColumn vectors v and b still have brackets in incorrect places.
\n \t\t \n \t\t", "description": "Putting a pair of linear equations into matrix notation and then solving by finding the inverse of the coefficient matrix.
"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "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": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "type": "exam", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}