// Numbas version: finer_feedback_settings {"name": "Solving Simultaneous Equations", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Solving Simultaneous Equations", "tags": [], "metadata": {"description": "
Semi-worked example of solving simultaneous equations using matrices. Equation values are randomly generated. The student is walked through the steps needed to solve the equations.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Simultaneous equations consist of two equations with two unknown values and both equations must be solved at the same time. This can be done using matrices.
\n\nConsider the following set of simultaneous equations:
\n\\begin{align}
\\simplify{{mA[0][0]}x + {mA[0][1]}y} &= \\var{mC[0][0]} \\\\
\\simplify{{mA[1][0]}x + {mA[1][1]}y} &= \\var{mC[1][0]}
\\end{align}
We can solve these equations using the following steps:
\n(Input all numbers as fractions or integers and not as decimals.)
", "advice": "", "rulesets": {}, "extensions": [], "variables": {"x": {"name": "x", "group": "Ungrouped variables", "definition": "random(1..9)*random(1,1,1,-1)", "description": "value for x
", "templateType": "anything"}, "y": {"name": "y", "group": "Ungrouped variables", "definition": "random(1..9)*random(1,1,1,-1)", "description": "value for y
", "templateType": "anything"}, "mA": {"name": "mA", "group": "Ungrouped variables", "definition": "matrixRandomNInvertable(matrix(repeat(repeat(random(1..9)*random(1,1,1,-1),2),2)))", "description": "", "templateType": "anything"}, "mC": {"name": "mC", "group": "Ungrouped variables", "definition": "matrix([ma[0][0]*x+ma[0][1]*y],[ma[1][0]*x+ma[1][1]*y])", "description": "", "templateType": "anything"}, "mAI": {"name": "mAI", "group": "Ungrouped variables", "definition": "matrix([mA[1][1],-mA[0][1]],[-mA[1][0],ma[0][0]])/det(mA)", "description": "", "templateType": "anything"}, "det_mA": {"name": "det_mA", "group": "Ungrouped variables", "definition": "det(mA)", "description": "", "templateType": "anything"}, "sx": {"name": "sx", "group": "Ungrouped variables", "definition": "'x'", "description": "", "templateType": "anything"}, "sy": {"name": "sy", "group": "Ungrouped variables", "definition": "'y'", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "det_mA<>0", "maxRuns": 100}, "ungrouped_variables": ["x", "y", "mA", "mC", "mAI", "det_mA", "sx", "sy"], "variable_groups": [], "functions": {"matrixRandomNInvertable": {"parameters": [["ma", "matrix"]], "type": "matrix", "language": "jme", "definition": "if(det(ma)<>0,ma,\n matrixRandomNInvertable(\n matrix(repeat(repeat(random(1..9)*(random(1,1,1,-1)),numcolumns(ma)),numrows(ma)))\n )\n)"}}, "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": "First, rewrite the equations in matrix form of $Ab = C$, where the matrix $A$ will contain the coefficients of the equation, $b$ will contain the unknown values and $C$ will contain the constants.
\n[[1]] | \n
[[2]] | \n
The coefficients are the values $x$ and $y$ are multiplied by. Take the number of $x$s in the first equation and place it in the first element of matrix $A$, $a_{11}$. Take the number of $y$s in the first equation and place it in the second element of matrix $A$, $a_{12}$ (first row, second column).
\nRepeat for the second equation, but place coefficients into the second row elements of matrix $A$.
", "correctAnswer": "mA", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": "0.003", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "information", "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": "The unknown values $x$ and $y$ go into matrix $b$, $x$ into $b_{11}$ and $y$ into $b_{21}$. We don't know these values yet, so we use $x$ and $y$ for now.
"}, {"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, "prompt": "The constants are the answers to the equations (the number to the right of the $=$ sign). The answer to the first equation goes into the first element of matrix $C$, $c_{11}$. The answer to the second equation goes into the second element of matrix $C$, $c_{21}$.
", "correctAnswer": "mC", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": "0.003", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "correctAnswer": "mA", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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": "x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "x", "value": ""}]}, {"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": "y", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "valuegenerators": [{"name": "y", "value": ""}]}, {"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": "mC", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": 0, "markPerCell": true, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "sortAnswers": false}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Second, we find the inverse of the coefficient matrix $A$
", "stepsPenalty": 0, "steps": [{"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, "prompt": "Switch the elements on the leading/main diagonal.
\nChange the sign of the elelments on the secondary diagonal.
\ni.e. $\\begin{pmatrix} d & -b\\\\ -c & a \\end{pmatrix}$
", "correctAnswer": "matrix([mA[1][1],-mA[0][1]],[-mA[1][0],ma[0][0]])", "correctAnswerFractions": false, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Calculate the determinant of $A$
\ni.e. $ad-bc$
", "minValue": "det(mA)", "maxValue": "det(mA)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Divide every element in $A'$ by the determinant. (Enter answer as fractions.)
", "correctAnswer": "mAI", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": "0.003", "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "correctAnswer": "mAI", "correctAnswerFractions": true, "numRows": "2", "numColumns": "2", "allowResize": false, "tolerance": "0.003", "markPerCell": true, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "4", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Finally, find $A^{-1}C$. i.e multiply the inverse of $A$, $A^{-1}$, by $C$
", "stepsPenalty": 0, "steps": [{"type": "information", "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": "We have matrix $A^{-1} = \\begin{pmatrix} a_{11} & a_{12}\\\\ a_{21} & a_{22} \\end{pmatrix}$ multiplied by matrix $C = \\begin{pmatrix} c_{11}\\\\ c_{21} \\end{pmatrix}$.
\nWe know we can multiply these as the number of columns in $A^{-1}$, 2, is equal to the number of rows in $C$, 2.
\n[2 x 2] x [2 x 1]
\nWe can also determine the order of the answer matrix:-
\nTo work out the values for the answer matrix we multiply:-
\n$a'c_{11} = (a'_{11}\\times c_{11}) + (a'_{12}\\times c_{21}) =$ ?
", "minValue": "x", "maxValue": "x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "$a'c_{21} = (a'_{21}\\times c_{11}) + (a'_{22}\\times c_{21}) =$ ?
", "minValue": "y", "maxValue": "y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "matrix", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "Therefore $A^{-1}C = \\begin{pmatrix} a'c_{11}\\\\ a'c_{21} \\end{pmatrix}$ is?
", "correctAnswer": "matrix([x],[y])", "correctAnswerFractions": false, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": "0.003", "markPerCell": false, "allowFractions": false, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}], "correctAnswer": "matrix([x],[y])", "correctAnswerFractions": true, "numRows": "2", "numColumns": 1, "allowResize": false, "tolerance": "0.003", "markPerCell": false, "allowFractions": true, "minColumns": 1, "maxColumns": 0, "minRows": 1, "maxRows": 0}, {"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": "We started with the matrices $Ab=C$, and we have rearranged this formula to $A^{-1}C=b$ in order to find $b$. Therefore, $x$ and $y$ are?
\n$x = $ [[0]]
\n$y = $ [[1]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "x", "maxValue": "x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "y", "maxValue": "y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Mark Patterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5064/"}]}]}], "contributors": [{"name": "Mark Patterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5064/"}]}