// Numbas version: finer_feedback_settings {"name": "Unit 9: Question 8", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "addortakeaway", "c", "b", "da", "a1", "sc", "ab", "sb1", "b1", "test", "sb", "sa", "sc1", "sa1", "c1", "inc"], "name": "Unit 9: Question 8", "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"], "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", "tolerance": 0, "allowFractions": false, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [a,b],\n [a1,b1]\n])", "correctAnswerFractions": false, "marks": "0.5", "allowResize": false}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "marks": "0.25", "answer": "x", "checkingtype": "absdiff", "checkvariablenames": false, "vsetrange": [0, 1]}, {"expectedvariablenames": [], "checkingaccuracy": 0.001, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "scripts": {}, "marks": "0.25", "answer": "y", "checkingtype": "absdiff", "checkvariablenames": false, "vsetrange": [0, 1]}, {"numColumns": 1, "type": "matrix", "tolerance": 0, "allowFractions": false, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [c],\n [c1]\n])", "correctAnswerFractions": false, "marks": "0.5", "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", "tolerance": 0, "allowFractions": true, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [b1,-b],\n [-a1,a1]\n])/dA", "correctAnswerFractions": true, "marks": "2", "allowResize": false}], "showCorrectAnswer": true, "scripts": {}, "type": "gapfill"}, {"prompt": "

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

", "marks": 0, "gaps": [{"numColumns": 1, "type": "matrix", "tolerance": 0, "allowFractions": true, "scripts": {}, "markPerCell": false, "numRows": "2", "showCorrectAnswer": true, "correctAnswer": "matrix([\n [(c*b1-c1*b)/(b1*a-a1*b)],\n [(-c*a1+c1*a)/(b1*a-a1*b)]\n])", "correctAnswerFractions": true, "marks": "2", "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, "type": "jme", "showpreview": true, "vsetrangepoints": 5, "showCorrectAnswer": true, "answersimplification": "std", "scripts": {}, "marks": "1", "answer": "{c*b1-c1*b}/{b1*a-a1*b}", "checkingtype": "absdiff", "checkvariablenames": false, "vsetrange": [0, 1]}, {"notallowed": {"message": "

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

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

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "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": "

20/06/2012:

\n

Added, edited tags.

\n

Edited advice so that it gave the correct solution for $y$ (as in the answer).

\n

 

\n

 

\n

4/07/2012:

\n

Column vectors v and b have the bracket in the incorrect place.

\n

 

\n

10/07/2012:

\n

Added tags.

\n

Question appears to be working correctly.

\n

Column vectors v and b still have brackets in incorrect places.

\n

\n

9/4/15 RLCS:

\n

Have altered the 2 parts v and b to be 1x2 matrices rather than rowvectors. Now works as expected.

", "description": "

Based on Chapter 8, quite loosley.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"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "rhaana starling", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/460/"}]}]}], "contributors": [{"name": "rhaana starling", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/460/"}]}