// Numbas version: exam_results_page_options {"name": "Simultaneous equations", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": [], "name": "Simultaneous equations", "tags": ["algebra", "equations", "Linear equations", "linear equations", "Simultaneous equations", "simultaneous equations", "solving equations", "Solving equations", "system of equations"], "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "parts": [{"stepsPenalty": 0, "prompt": "

Find the $x$ and $y$ values that satisfy both of the following equations.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify{{a}x+{b}}$               $(1)$
$y$$=$$\\simplify{{c}x+{d}}$               $(2)$
\n

$x=$ [[0]],   $y=$ [[1]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "xans", "minValue": "xans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "yans", "minValue": "yans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

There are many ways to solve these equations simultaneously. Here is one method.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify{{a}x+{b}}$               $(1)$
$y$$=$$\\simplify{{c}x+{d}}$               $(2)$
\n

Substitute the expression for $y$ given in $(1)$ into $(2)$:
\\[\\simplify{{a}x+{b} ={c}x+{d}}\\]

\n

Collect like terms:
\\[\\simplify{{a-c}x={d-b}}\\]

\n

Solve for $x$:
\\[x=\\var{xans}\\]

Now we know the $x$ value we can determine the corresponding $y$ value by substituting $x=\\var{xans}$ into either equation $(1)$ or $(2)$, below we substitute into $(1)$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\simplify[!collectnumbers]{{a}({xans})+{b}}$
$=$$\\var{yans}$
\n

Therefore the values that satisfy equations $(1)$ and $(2)$ are $x=\\var{xans}$ and $y=\\var{yans}$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}, {"stepsPenalty": 0, "prompt": "

Solve the following simultaneous equations.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{f}x+{g}y}$$=$$\\var{-h}$               $(3)$
$\\simplify{{j}x+{k}y}$$=$$\\var{-l}$               $(4)$
\n

$x=$ [[0]],   $y=$ [[1]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": true, "variableReplacements": [], "maxValue": "xbans", "minValue": "xbans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "ybans", "minValue": "ybans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

There are many ways to solve these equations simultaneously. Here is one method.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{f}x+{g}y}$$=$$\\var{-h}$               $(3)$
$\\simplify{{j}x+{k}y}$$=$$\\var{-l}$               $(4)$
\n

Solve one of the equations for one of the variables. Here we solve equation $(1)$ for $y$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{g}y$$=$$\\simplify{{-h}-{f}x}$
 
$y$$=$$\\displaystyle{\\simplify{({-h}-{f}x)/({g})}}$               $(5)$
\n

Substitute this expression for $y$ given in $(5)$ into $(4)$:

\n

\\[\\simplify[all,!collectnumbers]{{j}x+{k}(({-h}-{f}x)/({g})) = {-l}}\\]

\n

Collect like terms:
\\[\\simplify[fractionnumbers]{{j-f*k/g}x={-l+h*k/g}}\\]

\n

Solve for $x$:
\\[x=\\var{xbans}\\]

Now we know the $x$ value we can determine the corresponding $y$ value by substituting $x=\\var{xbans}$ into equation $(5)$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$y$$=$$\\displaystyle{\\simplify[unitdenominator,!collectnumbers]{({-h}-{f}({xbans}))/({g})}}$
 
$=$$\\var{ybans}$
\n

Therefore the values that satisfy equations $(3)$ and $(4)$ are $x=\\var{xbans}$ and $y=\\var{ybans}$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}, {"stepsPenalty": 0, "prompt": "

Solve the following system of equations.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{m}a+{n}b+{p}}$$=$$0$               $(5)$
$\\simplify{{q}a+{r}b+{s}}$$=$$0$               $(6)$
\n

$a=$ [[0]],   $b=$ [[1]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": true, "variableReplacements": [], "maxValue": "xcans", "minValue": "xcans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": true, "variableReplacements": [], "maxValue": "ycans", "minValue": "ycans", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": true, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

There are many ways to solve these equations simultaneously. Here is one method.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\simplify{{m}a+{n}b+{p}}$$=$$0$               $(5)$
$\\simplify{{q}a+{r}b+{s}}$$=$$0$               $(6)$
\n

Solve one of the equations for one of the variables. Here we solve equation $(5)$ for $b$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{n}b$$=$$\\simplify{{-m}a+{-p}}$
 
$b$$=$$\\displaystyle{\\simplify{({-m}a+{-p})/({n})}}$               $(7)$
\n

Substitute this expression for $b$ given in $(7)$ into $(6)$:

\n

\\[\\simplify[all,!collectnumbers]{{q}a+{r}*(({-m}a+{-p})/{n}) + {s}=0}\\]

\n

Collect like terms:
\\[\\simplify[fractionnumbers]{{q-r*m/n}a={-s+r*p/n}}\\]

\n

Solve for $a$:
\\[a=\\simplify[fractionnumbers]{{xcans}}\\]

Now we know the $a$ value we can determine the corresponding $b$ value by substituting $a=\\simplify[fractionnumbers]{{xcans}}$ into equation $(7)$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$b$$=$$\\displaystyle{\\simplify[unitdenominator,!collectnumbers,fractionnumbers]{({-m}*({xcans})+{-p})/({n})}}$
 
$=$$\\simplify[fractionnumbers]{{ycans}}$
\n

Therefore the values that satisfy equations $(5)$ and $(6)$ are $a=\\simplify[fractionnumbers]{{xcans}}$ and $b=\\simplify[fractionnumbers]{{ycans}}$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}], "statement": "", "variable_groups": [{"variables": ["xans", "a", "c", "dmb", "b", "d", "yans"], "name": "part a"}, {"variables": ["primes", "kfmgj", "ktf", "gtj", "xbans", "htk", "gtl", "g", "j", "l", "k", "f", "h", "ybans"], "name": "part b"}, {"variables": ["m", "n", "p", "q", "r", "s", "xcans", "ycans"], "name": "part c"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"htk": {"definition": "random(1..abs(xbans*kfmgj-1))", "templateType": "anything", "group": "part b", "name": "htk", "description": ""}, "primes": {"definition": "[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]", "templateType": "anything", "group": "part b", "name": "primes", "description": ""}, "kfmgj": {"definition": "random(-12..12 except [-1,0,1])", "templateType": "anything", "group": "part b", "name": "kfmgj", "description": "

m signifies 'minus'

"}, "xans": {"definition": "random(-10..10)", "templateType": "anything", "group": "part a", "name": "xans", "description": ""}, "gtj": {"definition": "-kfmgj+ktf", "templateType": "anything", "group": "part b", "name": "gtj", "description": ""}, "gtl": {"definition": "xbans*kfmgj+htk", "templateType": "anything", "group": "part b", "name": "gtl", "description": ""}, "ycans": {"definition": "(q*p-s*m)/(r*m-n*q)", "templateType": "anything", "group": "part c", "name": "ycans", "description": ""}, "xcans": {"definition": "(n*s-p*r)/(r*m-n*q)", "templateType": "anything", "group": "part c", "name": "xcans", "description": ""}, "f": {"definition": "ktf/k", "templateType": "anything", "group": "part b", "name": "f", "description": ""}, "dmb": {"definition": "xans*(a-c)", "templateType": "anything", "group": "part a", "name": "dmb", "description": ""}, "xbans": {"definition": "random(-21..12 except 0)", "templateType": "anything", "group": "part b", "name": "xbans", "description": ""}, "a": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part a", "name": "a", "description": ""}, "c": {"definition": "random(-12..12 except [a,0])", "templateType": "anything", "group": "part a", "name": "c", "description": ""}, "b": {"definition": "d-dmb", "templateType": "anything", "group": "part a", "name": "b", "description": ""}, "d": {"definition": "random(1..dmb)", "templateType": "anything", "group": "part a", "name": "d", "description": ""}, "g": {"definition": "gcd(gtl,gtj)", "templateType": "anything", "group": "part b", "name": "g", "description": "

gcd(gtl,gtj)

"}, "yans": {"definition": "a*(d-b)/(a-c)+b", "templateType": "anything", "group": "part a", "name": "yans", "description": ""}, "h": {"definition": "htk/k", "templateType": "anything", "group": "part b", "name": "h", "description": ""}, "k": {"definition": "gcd(htk,ktf)", "templateType": "anything", "group": "part b", "name": "k", "description": "

old version if(factorise(abs(ktf))[len(factorise(abs(ktf)))-1]=0,1,primes[len(factorise(abs(ktf)))-1])

"}, "j": {"definition": "gtj/g", "templateType": "anything", "group": "part b", "name": "j", "description": ""}, "m": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part c", "name": "m", "description": ""}, "l": {"definition": "gtl/g", "templateType": "anything", "group": "part b", "name": "l", "description": ""}, "n": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part c", "name": "n", "description": ""}, "q": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part c", "name": "q", "description": ""}, "p": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part c", "name": "p", "description": ""}, "s": {"definition": "random(-12..12 except 0)", "templateType": "anything", "group": "part c", "name": "s", "description": ""}, "r": {"definition": "random(-12..12 except [0,ceil(n*q/m),floor(n*q/m)])", "templateType": "anything", "group": "part c", "name": "r", "description": ""}, "ybans": {"definition": "(j*h-l*f)/(kfmgj)", "templateType": "anything", "group": "part b", "name": "ybans", "description": ""}, "ktf": {"definition": "random(1..abs(kfmgj-1))", "templateType": "anything", "group": "part b", "name": "ktf", "description": "

t signifies 'times'

"}}, "metadata": {"notes": "

Not sure if there is a way to force brackets around certain large fractions when there is a number multiplying it.

", "description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}