// Numbas version: exam_results_page_options {"name": "Maths Support: Solving simultaneous equations using matrices", "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "preventleave": false, "browse": true, "showfrontpage": false, "showresultspage": "never"}, "duration": 0.0, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "timing": {"timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "shufflequestions": false, "questions": [], "percentpass": 0.0, "allQuestions": true, "pickQuestions": 0, "type": "exam", "feedback": {"showtotalmark": true, "advicethreshold": 0.0, "showanswerstate": true, "showactualmark": true, "allowrevealanswer": true}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Solve a pair of linear equations using a 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/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "functions": {}, "ungrouped_variables": ["a", "addortakeaway", "c", "b", "da", "a1", "sc", "ab", "sb1", "b1", "test", "sb", "sa", "sc1", "sa1", "c1", "inc"], "tags": ["Linear equations", "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"], "preamble": {"css": "", "js": ""}, "advice": "

a)

\n

The equations can be written in the matrix form:

\n

\\[\\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}\\]

\n

b)

\n

Since $\\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}\\]

\n

c)

\n

We have:

\n

\\[ \\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*} \\]

\n

d)

\n

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}\\]

\n

Hence \\[\\begin{eqnarray*} x&=& \\simplify[std]{{c*b1-c1*b}/{dA}}\\\\ y&=& \\simplify[std]{{c1*a-c*a1}/{dA}} \\end{eqnarray*} \\]

", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "

$A = $ [[0]]

\n\n\n\n\n\n\n\n\n\n\n\n
$v = \\;\\;\\Bigg($[[1]]$\\Bigg)$
[[2]]
\n

$b = $ [[3]]

", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [a,b],\n [a1,b1]\n])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "answer": "x", "marks": "0.25", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "answer": "y", "marks": "0.25", "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"numColumns": 1, "type": "matrix", "allowFractions": false, "correctAnswerFractions": false, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "rowvector([c,c1])", "scripts": {}, "marks": "0.5", "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

Find the inverse of $A$. Input all numbers as fractions or integers and not as decimals.

\n

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

", "marks": 0, "gaps": [{"numColumns": "2", "type": "matrix", "allowFractions": true, "correctAnswerFractions": true, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [b1,-b],\n [-a1,a1]\n])/dA", "scripts": {}, "marks": "2", "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

$A^{-1}b = $ [[0]]

", "marks": 0, "gaps": [{"numColumns": 1, "type": "matrix", "allowFractions": true, "correctAnswerFractions": true, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "rowvector([{c*b1-c1*b}/{b1*a-a1*b},{-c*a1+c1*a}/{b1*a-a1*b}])", "scripts": {}, "marks": 1, "tolerance": 0, "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "\n \n \n

Now solve the equations, inputting all numbers as fractions or integers and not as decimals.
$x = \\;\\;$[[0]]

\n \n \n \n

$y = \\;\\;$[[1]]

\n \n \n \n ", "marks": 0, "gaps": [{"notallowed": {"message": "

Input as a fraction or an integer, not as a decimal

", "showStrings": false, "strings": ["."], "partialCredit": 0}, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "{c*b1-c1*b}/{b1*a-a1*b}", "marks": 0.5, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}, {"notallowed": {"message": "

Input as a fraction or an integer, not as a decimal

", "showStrings": false, "strings": ["."], "partialCredit": 0}, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "answer": "{-c*a1+c1*a}/{b1*a-a1*b}", "marks": 0.5, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}], "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*} \\]

", "type": "question", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "sa*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "addortakeaway": {"definition": "if(b*b1<0,'add the equation','take away the equation')", "templateType": "anything", "group": "Ungrouped variables", "name": "addortakeaway", "description": ""}, "c": {"definition": "sc*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "sb*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "da": {"definition": "a*b1-a1*b", "templateType": "anything", "group": "Ungrouped variables", "name": "da", "description": ""}, "a1": {"definition": "if(test+inc=0,test+inc+1,test+inc)", "templateType": "anything", "group": "Ungrouped variables", "name": "a1", "description": ""}, "test": {"definition": "round(a*b1/b)", "templateType": "anything", "group": "Ungrouped variables", "name": "test", "description": ""}, "ab": {"definition": "abs(b)", "templateType": "anything", "group": "Ungrouped variables", "name": "ab", "description": ""}, "sb1": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sb1", "description": ""}, "b1": {"definition": "if(ab=1,sb1*random(2..9),if(ab=2 or ab=4 or ab=8,sb1*random(1,3,5,7,9), if(ab=3 or ab=6 or ab=9,sb1*random(1,2,4,5,6,8),if(ab=5,sb1*random(1,2,3,4,6,7,8,9),sb1*random(1,2,3,4,5,6,8,9)))))", "templateType": "anything", "group": "Ungrouped variables", "name": "b1", "description": ""}, "sc": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sc", "description": ""}, "sb": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sb", "description": ""}, "sa": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sa", "description": ""}, "sc1": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sc1", "description": ""}, "sa1": {"definition": "random(1,-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "sa1", "description": ""}, "c1": {"definition": "sc1*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "c1", "description": ""}, "inc": {"definition": "sa*random(1..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "inc", "description": ""}}, "metadata": {"notes": "\n \t\t \t\t

20/06/2012:

\n \t\t \t\t

Added, edited tags.

\n \t\t \t\t

Edited 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:

\n \t\t \t\t

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:

\n \t\t \t\t

Added tags.

\n \t\t \t\t

Question appears to be working correctly.

\n \t\t \t\t

Column 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. 

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": [], "custom_part_types": [], "resources": []}