// Numbas version: exam_results_page_options {"timing": {"timedwarning": {"action": "none", "message": ""}, "allowPause": true, "timeout": {"action": "none", "message": ""}}, "question_groups": [{"name": "", "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": "2x2 Inverses", "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 determinants:
\\[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": "$A^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "tolerance": 0, "allowFractions": true, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [a22,-a12],\n [-a21,a11]\n])/dA", "correctAnswerFractions": true, "marks": 1, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$B^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "tolerance": 0, "allowFractions": true, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [b22,-b12],\n [-b21,b11]\n])/dB", "correctAnswerFractions": true, "marks": 1, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "$C^{-1} = $ [[0]]
", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "tolerance": 0, "allowFractions": true, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [c22,-c12],\n [-c21,c11]\n])/dB", "correctAnswerFractions": true, "marks": 1, "allowResize": 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}\\]
Find the following matrix inverses. Input all matrix entries as fractions or integers and not as decimals.
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a21": {"definition": "s2*random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "a21", "description": ""}, "a22": {"definition": "if(tr1*a11=a21*a12,tr1+1,tr1)", "templateType": "anything", "group": "Ungrouped variables", "name": "a22", "description": ""}, "b22": {"definition": "if(tr3*b11=b21*b12,tr3+1,tr3)", "templateType": "anything", "group": "Ungrouped variables", "name": "b22", "description": ""}, "b21": {"definition": "s*random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "b21", "description": ""}, "b1": {"definition": "t*random(1..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "b1", "description": ""}, "s2": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s2", "description": ""}, "s1": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s1", "description": ""}, "b12": {"definition": "random(-5..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "b12", "description": ""}, "b11": {"definition": "if(a11=tr2,tr2+1,tr2)", "templateType": "anything", "group": "Ungrouped variables", "name": "b11", "description": ""}, "tr1": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "tr1", "description": ""}, "c12": {"definition": "a12+b12", "templateType": "anything", "group": "Ungrouped variables", "name": "c12", "description": ""}, "c11": {"definition": "random(1,2,4)", "templateType": "anything", "group": "Ungrouped variables", "name": "c11", "description": ""}, "tr2": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "tr2", "description": ""}, "tr4": {"definition": "random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "tr4", "description": ""}, "c22": {"definition": "if(tr4*c11=c21*c12,tr4+1,tr4)", "templateType": "anything", "group": "Ungrouped variables", "name": "c22", "description": ""}, "a11": {"definition": "s1*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "a11", "description": ""}, "a12": {"definition": "random(-5..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "a12", "description": ""}, "db": {"definition": "b11*b22-b21*b12", "templateType": "anything", "group": "Ungrouped variables", "name": "db", "description": ""}, "dc": {"definition": "c11*c22-c21*c12", "templateType": "anything", "group": "Ungrouped variables", "name": "dc", "description": ""}, "da": {"definition": "a11*a22-a21*a12", "templateType": "anything", "group": "Ungrouped variables", "name": "da", "description": ""}, "a1": {"definition": "random(2..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "a1", "description": ""}, "c21": {"definition": "random(2..5)", "templateType": "anything", "group": "Ungrouped variables", "name": "c21", "description": ""}, "c1": {"definition": "u*random(1..6)", "templateType": "anything", "group": "Ungrouped variables", "name": "c1", "description": ""}, "tr3": {"definition": "s1*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "tr3", "description": ""}, "a": {"definition": "random(1..3)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "b": {"definition": "s*random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "s": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s", "description": ""}, "u": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "u", "description": ""}, "t": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "t", "description": ""}}, "metadata": {"notes": "\n \t\t \t\t \t\t10/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 inverse 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": []}]}, {"name": "Singular Matrix", "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/"}], "functions": {}, "tags": ["determinant", "formative", "hidden gaps", "linear combination", "matrices", "matrix", "preamble", "satisfy", "singular matrix", "zero gaps"], "type": "question", "advice": "There are several possible matrices with the given entries and which are singular i.e. determinant $0$.
\nOne such is \\[A=\\var{a}\\]
\nAnother method for finding some appropriate values is to note that if one row of a matrix is a combination of the other rows then the matrix is singular.
\nIn this case let
\n\\[A=\\begin{pmatrix} \\var{a11}&\\var{a12}&a\\\\b&c&\\var{a23}\\\\\\var{a31}&\\var{a32}&\\var{a33}\\end{pmatrix}\\]
\n
In this case we will find $a,\\;b$ and $c$ such that the second row is the sum of the first and third rows.
This gives three equations:
\n\\[\\begin{eqnarray}b&=&\\simplify[]{{a11}+{a31}}\\Rightarrow b=\\var{a11+a31}\\\\c&=&\\simplify[]{{a12}+{a32}}\\Rightarrow c=\\var{a12+a32}\\\\\\var{a23}&=&\\simplify[]{a+{a33}}\\Rightarrow a=\\var{a23-a33}\\end{eqnarray}\\]
\nHence another singular matrix with the original given entries is:
\n\\[A=\\begin{pmatrix} \\var{a11}&\\var{a12}&\\var{a23-a33}\\\\\\var{a11+a31}&\\var{a12+a32}&\\var{a23}\\\\\\var{a31}&\\var{a32}&\\var{a33}\\end{pmatrix}\\]
\nYou can check that the determinant of this matrix is $0$ and is therefore singular.
\n", "rulesets": {}, "parts": [{"stepsPenalty": 0, "prompt": "\\[A=\\left( \\begin{matrix} \\phantom{.}\\\\ \\phantom{.}\\\\ \\phantom{.}\\\\ \\phantom{.}\\\\ \\end{matrix} \\right.\\] | \n$\\var{a11}$ | \n$\\var{a12}$ | \n[[0]] | \n\\[\\left) \\begin{matrix} \\phantom{.} \\\\ \\phantom{.}\\\\ \\phantom{.}\\\\ \\phantom{.}\\\\ \\end{matrix} \\right.\\] | \n
[[1]] | \n[[2]] | \n$\\var{a23}$ | \n||
$\\var{a31}$ | \n$\\var{a32}$ | \n$\\var{a33}$ | \n
Enter values in the matrix so that the matrix is singular.
\nClick on Show steps if you want more information on singular matrices.
\n", "marks": 0, "gaps": [{"marks": "0", "maxValue": "1", "minValue": "1", "showCorrectAnswer": false, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"marks": "0", "maxValue": "1", "minValue": "1", "showCorrectAnswer": false, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"marks": "0", "maxValue": "1", "minValue": "1", "showCorrectAnswer": false, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}, {"marks": "1", "maxValue": "d", "minValue": "d", "showCorrectAnswer": false, "scripts": {}, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "steps": [{"type": "information", "showCorrectAnswer": true, "scripts": {}, "prompt": "Note that a matrix is singular if and only if it has determinant $0$.
\nAlso if a row is a linear combination of other rows then it is singular, similarly if a column is a linear combination of other columns.
", "marks": 0}], "type": "gapfill"}], "statement": "\n", "variable_groups": [], "progress": "in-progress", "preamble": {"css": "", "js": "question.signals.on('HTMLAttached',function() {\n var scope = question.scope;\n var a11 = Numbas.jme.unwrapValue(scope.variables.a11);\n var a23 = Numbas.jme.unwrapValue(scope.variables.a23);\n var a32 = Numbas.jme.unwrapValue(scope.variables.a32);\n var a12 = Numbas.jme.unwrapValue(scope.variables.a12);\n var a33 = Numbas.jme.unwrapValue(scope.variables.a33);\n var a31 = Numbas.jme.unwrapValue(scope.variables.a31);\n ko.computed(function() {\n var a13 = parseInt(question.parts[0].gaps[0].display.studentAnswer());\n var a21 = parseInt(question.parts[0].gaps[1].display.studentAnswer());\n var a22 = parseInt(question.parts[0].gaps[2].display.studentAnswer());\n var fin= isNaN(a13)||isNaN(a21)||isNaN(a22);\n\n var dt =a11*(a22*a33-a32*a23)-a12*(a21*a33-a31*a23)+a13*(a21*a32-a31*a22);\n var message1='';\n if(!fin) {\n if(dt !=0){\n message1='The determinant of your matrix is '+ dt+ ' and is therefore not a singular matrix.';\n }\n else message1='The determinant of your matrix is '+ dt+ ' and is therefore a singular matrix.'\n \n }\n var html = $(question.display.html);\n //This is displayed in the question as an aid to the user.\n html.find('#mess1').text(message1);\n\n\n\nquestion.parts[0].gaps[3].display.studentAnswer(dt);\n });\n})"}, "variables": {"a": {"definition": "rmatrix[0]", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "a32": {"definition": "a[2][1]", "templateType": "anything", "group": "Ungrouped variables", "name": "a32", "description": ""}, "a31": {"definition": "a[2][0]", "templateType": "anything", "group": "Ungrouped variables", "name": "a31", "description": ""}, "a23": {"definition": "a[1][2]", "templateType": "anything", "group": "Ungrouped variables", "name": "a23", "description": ""}, "a11": {"definition": "a[0][0]", "templateType": "anything", "group": "Ungrouped variables", "name": "a11", "description": ""}, "d": {"definition": "det(a)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "rmatrix": {"definition": "satisfy(\n [a],\n [\n matrix(repeat(repeat(random(-3..3),3),3))\n ],\n [\n a[1][2]<>0,\n a[0][0]*a[2][1]-a[0][1]*a[2][0]<>0,\n det(a)=0\n ]\n )", "templateType": "anything", "group": "Ungrouped variables", "name": "rmatrix", "description": "Using the satisfy function, the 3 x 3 matrix produced here has $a_{23}\\neq 0$ along with its cofactor $A_{23} \\neq 0$. This prevents the user putting $a_{21}=a_{22}=0$ as then we make sure that the matrix has non zero determinant.
"}, "a12": {"definition": "a[0][1]", "templateType": "anything", "group": "Ungrouped variables", "name": "a12", "description": ""}, "a33": {"definition": "a[2][2]", "templateType": "anything", "group": "Ungrouped variables", "name": "a33", "description": ""}}, "metadata": {"notes": "Had to use a script in the preamble rather than scripting the individual gap fills.
\nUsed the satisfy function to make sure we have non-trivial examples.
", "description": "A 3 x 3 matrix is given with 6 values already entered. The remaining 3 have to be entered by the user so that the matrix is singular i.e. determinant=0. This question is in formative mode, with the determinant of the matrix given when all entries are filled.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}], "pickQuestions": 1, "pickingStrategy": "all-ordered"}], "percentPass": 0, "pickQuestions": "1", "name": "Blathnaid's copy of Solving Equations with Matrices", "feedback": {"showanswerstate": true, "advicethreshold": 0, "allowrevealanswer": true, "showtotalmark": true, "showactualmark": true}, "metadata": {"description": "Matrix addition, multiplication. Finding inverse. Determinants. Systems of equations.
\nrebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "allQuestions": true, "questions": [], "shuffleQuestions": false, "navigation": {"showfrontpage": true, "showresultspage": "oncompletion", "preventleave": true, "reverse": true, "allowregen": true, "onleave": {"action": "none", "message": ""}, "browse": true}, "duration": 0, "type": "exam", "contributors": [{"name": "Blathnaid Sheridan", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/447/"}, {"name": "Andy Welch", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1565/"}], "extensions": ["stats"], "custom_part_types": [], "resources": []}