// Numbas version: finer_feedback_settings {"name": "2x2 Matrix Problems", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "2x2 Matrix Problems", "tags": [], "metadata": {"description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

$2\\times2$ Matrix Problems

\n

Solve the set of simultaneous equations using matrices:

", "advice": "

a)

\n

By using the coefficients of the variables in the equations, we can write the equations as:

\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

Notice that carrying out the matrix multiplication will give you your system of equations.

\n

b)

\n

We first find the determinant of $\\boldsymbol{A}$:

\n

$$
\\det \\boldsymbol{A} = \\var{a} \\times \\var{b1} - \\var{b} \\times \\var{a1} = \\var{det}
$$

\n

Since $\\det \\boldsymbol{A} \\neq 0$, $A$ is invertible with:

\n

$$\\begin{aligned}
A^{-1} &= \\frac{1}{\\var{det}}\\begin{pmatrix}
{\\var{b1}}&{\\var{-b}} \\\\
{\\var{-a1}}&{\\var{a}}
\\end{pmatrix} \\\\
&= \\begin{pmatrix}
\\simplify[std]{{b1}/{det}}&\\simplify[std]{{-b}/{det}} \\\\
\\simplify[std]{{-a1}/{det}}&\\simplify[std]{{a}/{det}}
\\end{pmatrix}
\\end{aligned}
$$

\n

c)

\n

We have the equation:

\n

$$
A^{-1}b = \\begin{pmatrix}
\\simplify[std]{{b1}/{det}}&\\simplify[std]{{-b}/{det}} \\\\
\\simplify[std]{{-a1}/{det}}&\\simplify[std]{{a}/{det}}
\\end{pmatrix} \\begin{pmatrix}
\\var{c} \\\\
\\var{c1}
\\end{pmatrix}
$$

\n

Using standard matrix multiplication, we can compute:

\n

$$
A^{-1}b = \\begin{pmatrix}
\\simplify[std]{{b1}/{det}} \\times \\var{c} + \\simplify[std]{{-b}/{det}} \\times \\var{c1}\\\\
\\simplify[std]{{-a1}/{det}} \\times \\var{c} + \\simplify[std]{{a}/{det}} \\times \\var{c1}
\\end{pmatrix} = \\begin{pmatrix} \\simplify[std]{{c*b1-c1*b}/{det}}\\\\\\simplify[std]{{c1*a-c*a1}/{det}}\\end{pmatrix} 
$$

\n

d)

\n

Notice that

\n

$$
\\boldsymbol{A}v = b \\Rightarrow v = \\boldsymbol{A}^{-1}b
$$

\n

Hence, we can use our solution to part $c)$ to find:

\n

$$
\\begin{pmatrix} 
x \\\\
y
\\end{pmatrix} = \\boldsymbol{A}^{-1}b =  \\begin{pmatrix}
\\simplify[std]{{c*b1-c1*b}/{det}} \\\\
\\simplify[std]{{c1*a-c*a1}/{det}}
\\end{pmatrix}
$$

\n

And therefore, we have:

\n

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

", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-5..5 )", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "a1": {"name": "a1", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "b1": {"name": "b1", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "c1": {"name": "c1", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything", "can_override": false}, "det": {"name": "det", "group": "Ungrouped variables", "definition": "a*b1 - b*a1", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "det<>0", "maxRuns": 100}, "ungrouped_variables": ["a", "c", "b", "a1", "b1", "c1", "det"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write the following set of equations as a matrix equation:

$$
\\begin{eqnarray*} \\simplify[std]{{a}x+{b}y}&=&\\var{c}\\\\ \\simplify[std]{{a1}x+{b1}y}&=&\\var{c1} \\end{eqnarray*}
$$

\n

That is, in the form:

\n

$$
\\boldsymbol{A}v=b
$$

\n

for some matrix $\\boldsymbol{A}$ and column vectors $v$ and $b$.

\n


[[0]]$
\\begin{pmatrix}
x \\\\
y \\\\
\\end{pmatrix} = \\ $[[1]] 

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([\n [a,b],\n [a1,b1]\n])", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([\n [c],\n [c1]\n])", "correctAnswerFractions": true, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Find the inverse of $\\boldsymbol{A}$, the $2 \\times 2$ matrix you defined in the previous question

\n

Input all numbers as fractions or integers and not as decimals. Simplify your fractions as much as possible!

\n

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

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "3", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([\n [b1,-b],\n [-a1,a]\n])/det", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Using matrix multiplication and your answer to part $b)$, find $\\boldsymbol{A}^{-1}b$

\n

Give your answer as fractions or integers and not as decimals.

\n

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

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "1.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "matrix([{c*b1-c1*b}/{b1*a-a1*b}],[{-c*a1+c1*a}/{b1*a-a1*b}])", "correctAnswerFractions": true, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0, "prefilledCells": ""}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Using your answer to part $c)$, state the values of $x$ and $y$.

\n

Give your answer as fractions or integers and not as decimals.

\n

$x = $ [[0]]

\n

$y = $ [[1]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 0.5, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{c*b1-c1*b}/{b1*a-a1*b}", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

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

"}, "valuegenerators": []}, {"type": "jme", "useCustomName": false, "customName": "", "marks": 0.5, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{-c*a1+c1*a}/{b1*a-a1*b}", "answerSimplification": "std", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notallowed": {"strings": ["."], "showStrings": false, "partialCredit": 0, "message": "

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

"}, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}]}]}], "contributors": [{"name": "Marie Nicholson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1799/"}, {"name": "Tamsin Smith", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/14108/"}, {"name": "Fraser Buxton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/24224/"}]}