// Numbas version: exam_results_page_options {"type": "exam", "timing": {"allowPause": true, "timeout": {"message": "", "action": "none"}, "timedwarning": {"message": "", "action": "none"}}, "percentPass": 0, "name": "Algebraic manipulation", "duration": 0, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 1, "name": "Group", "questions": [{"name": "Solve a linear equation $ax+b = cx+d$", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "metadata": {"description": "

Solve a simple linear equation algebraically. The unknown appears on both sides of the equation.

", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": ["d", "f", "g", "h", "x", "gcd_hfdg", "hf_coprime", "dg_coprime", "finalb"], "type": "question", "rulesets": {}, "variable_groups": [], "statement": "", "advice": "

We are asked to solve the equation

\n

\$\\var{d}x-\\var{f}=\\var{g}x+\\var{h} \$

\n

In this equation, there are $x$ terms and constant terms on both sides of the equals sign.

\n

To solve this equation, we must rearrange it to get $x$ on its own.

\n

\\begin{align}
\\var{d}x-\\var{f} &= \\var{g}x+\\var{h} \\\0.5em] \\var{d}x-\\var{g}x &= \\var{h}+\\var{f} & \\text{Move } x \\text{ terms to the left, and constant terms to the right.}\\\\[0.5em] \\simplify{{d-g}*x} &= {\\var{h+f}} & \\text{Collect like terms together.}\\\\[0.5em] x &=\\frac{\\var{h+f}}{\\var{d-g}} & \\text{Divide both sides by } \\var{d-g} \\text{.} \\\\[0.5em] x &= \\simplify{{h+f}/{d-g}} \\end{align} ", "parts": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "prompt": " \\var{d}x-\\var{f}=\\var{g}x+\\var{h} \n What is the value of x? \n x =  [[0]] ", "gaps": [{"correctAnswerFraction": false, "showCorrectAnswer": true, "mustBeReducedPC": 0, "showFeedbackIcon": true, "marks": "2", "minValue": "finalb", "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "finalb", "mustBeReduced": false, "allowFractions": false, "variableReplacements": [], "correctAnswerStyle": "plain"}], "showFeedbackIcon": true, "marks": 0}], "tags": ["taxonomy"], "preamble": {"js": "", "css": ""}, "functions": {}, "variables": {"dg_coprime": {"description": "", "group": "Ungrouped variables", "definition": "(d-g)/gcd_hfdg", "name": "dg_coprime", "templateType": "anything"}, "x": {"description": "", "group": "Ungrouped variables", "definition": "random(2..6)", "name": "x", "templateType": "anything"}, "gcd_hfdg": {"description": "", "group": "Ungrouped variables", "definition": "gcd((h+f),(d-g))", "name": "gcd_hfdg", "templateType": "anything"}, "hf_coprime": {"description": "", "group": "Ungrouped variables", "definition": "(h+f)/gcd_hfdg", "name": "hf_coprime", "templateType": "anything"}, "f": {"description": "", "group": "Ungrouped variables", "definition": "random(2..6)", "name": "f", "templateType": "anything"}, "h": {"description": "", "group": "Ungrouped variables", "definition": "(x*(d-g))-f", "name": "h", "templateType": "anything"}, "g": {"description": "", "group": "Ungrouped variables", "definition": "random(2..5)", "name": "g", "templateType": "anything"}, "finalb": {"description": "", "group": "Ungrouped variables", "definition": "hf_coprime/dg_coprime", "name": "finalb", "templateType": "anything"}, "d": {"description": "", "group": "Ungrouped variables", "definition": "random(g+2..8)", "name": "d", "templateType": "anything"}}, "variablesTest": {"maxRuns": 100, "condition": ""}}, {"name": "Solve a linear equation ax+b = c", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Lauren Richards", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1589/"}], "metadata": {"description": " Solve a linear equation of the form ax+b = c, where a, b and c are integers. \n The answer is always an integer. ", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": [], "type": "question", "rulesets": {}, "advice": " We need to solve the equation \n \\[ \\var{a}x+\\var{b}=\\var{c} \

\n

To solve this equation, we must rearrange the equation to put $x$ on its own.

\n

To do this, we should subtract $\\var{b}$ from both sides and then divide through by $\\var{a}$ to get the value for $x$.

\n

\\begin{align}

\n

#### b)

\n

\\\begin{align} \\simplify[terms]{{a[4]}({a[5]}x+{a[6]})}&= \\simplify[!collectNumbers]{{a[4]}{a[5]}x+{a[4]}{a[6]}}\\\\&= \\simplify{{a[4]}*{a[5]}x+{a[4]}{a[6]}}\\text{.} \\end{align} \

\n

#### c)

\n

\\\begin{align} \\simplify[terms]{{a[7]}({a[8]}x^2+{a[9]}y)}&= \\simplify[!collectNumbers]{{a[7]}{a[8]}x^2+{a[7]}{a[9]}y}\\\\&= \\simplify{{a[7]}*{a[8]}x^2+{a[7]}*{a[9]}y}\\text{.} \\end{align} \

\n

#### d)

\n

\\\begin{align} \\simplify[terms]{{a[10]}({a[11]}x^2+{a[12]}y)}&= \\simplify[!collectNumbers]{{a[10]}{a[11]}x^2+{a[10]}{a[12]}y}\\\\&= \\simplify{{a[10]}*{a[11]}x^2+{a[10]}*{a[12]}y}\\text{.} \\end{align} \

\n

#### e)

\n

\\\begin{align} \\simplify[terms]{{a[13]}x({a[14]}x^2+{a[15]}x+{a[16]})}&= \\simplify[!collectNumbers]{{a[13]}x{a[14]}x^2+{a[13]}x{a[15]}x+{a[13]}x{a[16]}}\\\\&= \\simplify{{a[13]}{a[14]}x^3+{a[13]}{a[15]}x^2+{a[13]}{a[16]}x}\\text{.} \\end{align} \

\n

#### f)

\n

\\\begin{align} \\simplify[terms]{{a[17]}x({a[18]}x^2+{a[19]}x+{a[20]})}&= \\simplify[!collectNumbers]{{a[17]}x{a[18]}x^2+{a[17]}x{a[19]}x+{a[17]}x{a[20]}}\\\\&= \\simplify{{a[17]}{a[18]}x^3+{a[17]}{a[19]}x^2+{a[17]}{a[20]}x}\\text{.} \\end{align} \

\n

#### g)

\n

\\\begin{align} \\simplify[terms]{{a[21]}x({a[22]}x^2+{a[23]}x)+{a[24]}x^2+{a[25]}x^3}&= \\simplify[!collectNumbers]{x^2({a[21]}{a[23]})+x^2{a[24]}+x^3({a[21]}{a[22]})+x^3{a[25]}}\\\\&= \\simplify[!collectNumbers]{x^2({a[21]}{a[23]}+{a[24]})+x^3({a[21]}{a[22]}+{a[25]})}\\\\&= \\simplify{x^2({a[21]}{a[23]}+{a[24]})+x^3({a[21]}{a[22]}+{a[25]})}\\text{.} \\end{align} \

\n

#### h)

\n

\\\begin{align} \\simplify[terms]{({a[26]}x^2+{a[27]}x^3)+{a[28]}x({a[29]}x^2+{a[30]}x)}&= \\simplify[!collectNumbers]{x^2({a[26]})+x^2({a[28]}{a[30]})+x^3({a[28]}{a[29]})+x^3({a[27]})}\\\\&= \\simplify[!collectNumbers]{x^2({a[26]}+{a[28]}{a[30]})+x^3({a[28]}{a[29]}+{a[27]})}\\\\&= \\simplify{x^2({a[26]}+{a[28]}{a[30]})+x^3({a[28]}{a[29]}+{a[27]})}\\text{.} \\end{align} \

\n

#### i)

\n

\\\begin{align} \\simplify[terms]{{a[31]}({a[32]}x+{a[33]}y)+{a[34]}x({a[42]}+{a[35]}y)}&= \\simplify[!collectNumbers]{({a[31]}{a[32]})x+({a[34]}{a[42]})x+{a[31]}{a[33]}y+{a[34]}{a[35]}x*y}\\\\&= \\simplify[!collectNumbers]{({a[31]}{a[32]}+{a[34]}{a[42]})x+{a[31]}{a[33]}y+{a[34]}{a[35]}x*y}\\\\&= \\simplify{({a[31]}{a[32]}+{a[34]}{a[42]})x+{a[31]}{a[33]}y+{a[34]}{a[35]}x*y}\\text{.} \\end{align} \

\n

#### j)

\n

\\\begin{align} \\simplify[terms]{{a[36]}a^2({a[37]}+{a[38]}b)+{a[39]}b^2({a[40]}a+{a[41]}b)}&= \\simplify[!collectNumbers]{{a[37]}{a[36]}a^2+{a[38]}{a[36]}a^2b+{a[40]}{a[39]}a*b^2+{a[39]}{a[41]}b^3}\\\\&= \\simplify{{a[37]}{a[36]}a^2+{a[38]}{a[36]}a^2b+{a[40]}{a[39]}a*b^2+{a[39]}{a[41]}b^3}\\text{.} \\end{align} \

", "rulesets": {"terms": ["all", "!collectNumbers", "!unitFactor", "!noLeadingMinus"]}, "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "repeat(random(-10..10 except [-1,0,1] ),50)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[1]}({a[2]}x+{a[3]})}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[1]*a[2]}x+{a[1]*a[3]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "x*(+-$n) + +-$n", "partialCredit": 0, "message": "

It doesn't look like you've expanded - make sure you don't use any brackets in your answer.

", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[4]}({a[5]}x+{a[6]})}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[4]*a[5]}x+{a[4]*a[6]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n*x + +-$n", "partialCredit": 0, "message": "

It doesn't look like you've expanded - make sure you don't use any brackets in your answer.

", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[7]}({a[8]}x^2+{a[9]}y)}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[7]*a[8]}x^2+{a[7]*a[9]}y", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n*x^2 + +-$n*y", "partialCredit": 0, "message": "

It doesn't look like you've expanded - make sure you don't use any brackets in your answer.

", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[10]}({a[11]}x^2+{a[12]}y)}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[10]*a[11]}x^2+{a[10]*a[12]}y", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n*x^2 + +-$n*y", "partialCredit": 0, "message": "

It doesn't look like you've expanded - make sure you don't use any brackets in your answer.

", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[13]}x({a[14]}x^2+{a[15]}x+{a[16]})}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[13]*a[14]}x^3+{a[13]*a[15]}x^2+{a[13]*a[16]}x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n*x^3 + +-$n*x^2 + +-$n*x", "partialCredit": 0, "message": " It doesn't look like you've expanded - make sure you don't use any brackets in your answer. ", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "$\\simplify{{a[17]}x({a[18]}x^2+{a[19]}x+{a[20]})}=$[[0]] ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[17]*a[18]}x^3+{a[17]*a[19]}x^2+{a[17]*a[20]}x", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n?*x^3 + +-$n?*x^2 + +-$n?*x", "partialCredit": 0, "message": "

It doesn't look like you've expanded - make sure you don't use any brackets in your answer.

", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[21]}x({a[22]}x^2+{a[23]}x)+{a[24]}x^2+{a[25]}x^3}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "x^2*{a[21]*a[23]+a[24]}+x^3*{a[21]*a[22]+a[25]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "x^2*+-$n? + x^3*+-$n?", "partialCredit": 0, "message": "It doesn't look like you've expanded - make sure you don't use any brackets in your answer.", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{({a[26]}x^2+{a[27]}x^3)+{a[28]}x({a[29]}x^2+{a[30]}x)}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "x^2*{a[26]+a[28]*a[30]} + x^3*{a[28]*a[29]+a[27]}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "x^2*+-$n? + x^3*+-$n?", "partialCredit": 0, "message": "It doesn't look like you've expanded - make sure you don't use any brackets in your answer.", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

$\\simplify{{a[31]}({a[32]}x+{a[33]}y)+{a[34]}x({a[42]}+{a[35]}y)}=$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[31]*a[32]+a[34]*a[42]}x+{a[31]*a[33]}y+{a[34]*a[35]}x*y", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "x*(+-$n) + y*(+-$n) + x*y*(+-$n)", "partialCredit": 0, "message": "", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}]}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "$\\simplify{{a[36]}a^2({a[37]}+{a[38]}b)+{a[39]}b^2({a[40]}a+{a[41]}b)}=$[[0]] ", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "answer": "{a[37]*a[36]}a^2+{a[38]*a[36]}a^2b+{a[40]*a[39]}a*b^2+{a[39]*a[41]}b^3", "answerSimplification": "basic", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "mustmatchpattern": {"pattern": "+-$n?*a^2 + +-$n?*a^2*b + +-$n?*a*b^2 + +-$n?*b^3", "partialCredit": 0, "message": " It doesn't look like you've expanded - make sure you don't use any brackets in your answer. ", "nameToCompare": ""}, "valuegenerators": [{"name": "a", "value": ""}, {"name": "b", "value": ""}]}], "sortAnswers": false}]}, {"name": "Extract common factors of polynomials", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}], "advice": " In order to factorise the expressions, the factors that make up each term in the expression need to be identified and, where these factors are the same for all terms in the expression, those factors can be taken outside the brackets. Stop when the remaining terms have no more common factors. \n #### a) \n Both terms have a common factor of$2. \n \\begin{align} \\simplify{2{a[0]}x+2{b[0]}}&= (\\simplify[]{2{a[0]}})x+2\\times\\var{b[0]}\\\\ &=\\simplify[]{2({a[0]}x+{b[0]})} \\end{align} \n #### b) \n Both terms have common factors of6$and$y. \n \\begin{align} \\simplify{6{a[1]}y+6{b[1]}y^2}&= 6 \\times \\var{a[1]} y + 6 \\times \\var{b[1]} y^2 \\\\ &= 6 \\times (\\simplify{{a[1]}y + {b[1]}y^2}) \\\\ &=6y(\\simplify[]{{a[1]}+{b[1]}y}) \\end{align} \n #### c) \n Both terms have common factors ofx$,$y$and$z. \n \\begin{align} \\simplify{{a[2]}x*y*z+{b[2]}x^2y^2z^2}&=\\var{a[2]} \\times xyz + \\var{b[2]} \\times xyz \\times xyz\\\\ &=xyz(\\var{a[2]} + \\var{b[2]} xyz) \\end{align} \n #### d) \n All three terms have a common factor of5. \n \\begin{align} \\simplify{5{a[3]}d+5{b[3]}r+5m}&= 5 \\times \\var{a[3]} d+5 \\times \\var{b[3]} r + 5 m \\\\ &=\\simplify[]{5({a[3]}d+{b[3]}r+m)} \\end{align} \n #### e) \n All the terms have common factors of6$,$c$and$d. \n \\begin{align} \\simplify{6{a[4]}cd^2+6{b[4]}c^2d+6{c[1]}c^2d^2} &= 6 \\times \\var{a[4]} c d^2 \\;+\\; 6 \\times \\var{b[4]} c^2 d \\;+\\; 6 \\times \\var{c[1]} c^2 d^2 \\\\ &= 6(\\var{a[4]} c d^2 + \\var{b[4]} c^2 d + \\var{c[1]} c^2 d^2) \\\\ &=6cd(\\var{a[4]}d+\\var{b[4]}c+\\var{c[1]}cd) \\end{align} \n", "statement": " An expression can be factorised by finding common factors of each term in the expression. \n Completely factorise the following expressions by finding their common factors. \n Make sure that you include a multiplication symbol * between each algebraic variable, and before brackets, e.g. a*b*(x+1) instead of ab(x+1). Otherwise, the system might not accept your answer. ", "preamble": {"js": "question.mark_factorised = function(part) {\n var match = Numbas.jme.display.matchExpression;\n var unwrap = Numbas.jme.unwrapValue;\n var getCommutingTerms = Numbas.jme.display.getCommutingTerms;\n var matchTree = Numbas.jme.display.matchTree;\n\n var expr = part.studentAnswer;\n\n // is the student's answer in the form factors*(terms)?\n var m = match('m_all(m_any(m_number,m_type(name),m_type(name)^m_number))*(m_all(??)+m_nothing);rest', expr, true);\n if(!m) {\n part.multCredit(0,\"You don't seem to have extracted a common factor.\");\n return;\n }\n \n var terms = getCommutingTerms(m.rest,'+').terms;\n \n var gcd; // greatest common divisor of the coefficients of each term\n var min_degrees = {}; // minimum degree of each variable across the terms - if greater than 0, that variable is a common factor\n \n // for each term, collect the scalar part and the degree of each of the variables\n terms.map(function(t,i) { \n var factors = getCommutingTerms(t,'*').terms;\n var degrees = {};\n var n = 1;\n factors.forEach(function(f) {\n var tok = f.tok;\n var scalar = 1;\n var name = null;\n var degree = 0;\n var m = Numbas.jme.display.matchTree(Numbas.jme.compile('m_any(m_number;n, m_type(name);name, m_number;n*m_type(name);name, m_type(name);name^(m_number;degree), m_number;n*m_type(name);name^m_number;degree )'),f,true)\n\n console.log(Numbas.jme.display.treeToJME(f));\n\n if(!m) {\n console.log(' no match');\n return;\n }\n console.log(' match',m.n,m.name,m.degree);\n if(m.n) {\n n *= unwrap(m.n.tok);\n }\n if(m.name) {\n name = m.name.tok.name;\n if(m.degree) {\n degree = unwrap(m.degree.tok);\n } else {\n degree = 1;\n }\n degrees[name] = (degrees[name] || 0) + degree;\n }\n });\n console.log(Numbas.jme.display.treeToJME(t), degrees, n);\n \n if(i==0) {\n gcd = n;\n } else {\n gcd = Numbas.math.gcd(gcd,n);\n }\n \n Object.keys(degrees).forEach(function(k) {\n if(i==0) {\n min_degrees[k] = degrees[k];\n } else {\n min_degrees[k] = Math.min(min_degrees[k] || 0, degrees[k]);\n }\n });\n Object.keys(min_degrees).forEach(function(k) {\n if(degrees[k]===undefined) {\n min_degrees[k] = 0;\n }\n });\n \n });\n \n var common_factors = [];\n if(gcd>1) {\n common_factors.push(gcd);\n }\n Object.keys(min_degrees).filter(function(k){return min_degrees[k]>0}).forEach(function(k) {\n common_factors.push(k+'^'+min_degrees[k])\n });\n \n if(common_factors.length==0) {\n return true;\n } else {\n part.multCredit(0,\"Your terms still have a common factor of\"+Numbas.jme.display.exprToLaTeX(common_factors.join('*'),'all',Numbas.jme.builtinScope)+\"$.\");\n }\n};", "css": ""}, "variables": {"x7": {"templateType": "anything", "name": "x7", "description": "", "group": "Ungrouped variables", "definition": "random(1..5)"}, "a": {"templateType": "anything", "name": "a", "description": " Vector of every other random prime number ", "group": "Ungrouped variables", "definition": "repeat(random([3, 11, 17, 29, 37, 43] except b),50)"}, "x2": {"templateType": "anything", "name": "x2", "description": "", "group": "Ungrouped variables", "definition": "random(1..5)"}, "x3": {"templateType": "anything", "name": "x3", "description": "", "group": "Ungrouped variables", "definition": "random(1..5 except [x2])"}, "b": {"templateType": "anything", "name": "b", "description": " Vector of the other every other random prime number ", "group": "Ungrouped variables", "definition": "repeat(random(2, 7, 13, 23, 31, 41, 53),50)"}, "c": {"templateType": "anything", "name": "c", "description": " extra primes for when you need a third constant ", "group": "Ungrouped variables", "definition": "repeat(random([ 5, 19, 47] ),50)"}, "x1": {"templateType": "anything", "name": "x1", "description": "", "group": "Ungrouped variables", "definition": "random(1..5)"}, "x4": {"templateType": "anything", "name": "x4", "description": "", "group": "Ungrouped variables", "definition": "random(-5..-1)\n\n"}, "x5": {"templateType": "anything", "name": "x5", "description": "", "group": "Ungrouped variables", "definition": "random(1..5)"}, "x6": {"templateType": "anything", "name": "x6", "description": "", "group": "Ungrouped variables", "definition": "random(1..5)"}}, "tags": ["common factors", "common factors of linear algebraic equations", "common factors of quadratic equations", "finding common factors", "Linear equations", "linear equations", "quadratic equations", "Quadratic Equations", "Quadratic equations", "taxonomy"], "ungrouped_variables": ["a", "b", "c", "x1", "x2", "x3", "x4", "x5", "x6", "x7"], "functions": {}, "metadata": {"description": " Factorise polynomials by identifying common factors. The first expression has a constant common factor; the rest have common factors involving variables. ", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "variable_groups": [], "parts": [{"sortAnswers": false, "variableReplacements": [], "gaps": [{"variableReplacements": [], "answer": "2({a[0]}x+{b[0]})", "showPreview": true, "expectedVariableNames": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "after", "script": "question.mark_factorised(this);"}}, "showCorrectAnswer": true, "failureRate": 1, "type": "jme", "checkVariableNames": false, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 1, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "$\\simplify{{2*a[0]}x+{2*b[0]}}=$[[0]] ", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"sortAnswers": false, "variableReplacements": [], "gaps": [{"variableReplacements": [], "answer": "6*y*({a[1]}+{b[1]}*y)", "showPreview": true, "expectedVariableNames": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "after", "script": "question.mark_factorised(this);"}}, "showCorrectAnswer": true, "failureRate": 1, "type": "jme", "checkVariableNames": false, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 1, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "$\\simplify{6{a[1]}y+6{b[1]}y^2}=$[[0]] ", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"sortAnswers": false, "variableReplacements": [], "gaps": [{"variableReplacements": [], "answer": "x*y*z*({a[2]}+{b[2]}x*y*z)", "showPreview": true, "expectedVariableNames": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "after", "script": "question.mark_factorised(this);"}}, "showCorrectAnswer": true, "failureRate": 1, "type": "jme", "checkVariableNames": false, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 1, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "$\\simplify{{a[2]}x*y*z+{b[2]}x^2y^2z^2}=$[[0]] ", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"sortAnswers": false, "variableReplacements": [], "gaps": [{"variableReplacements": [], "answer": "5({a[3]}d+{b[3]}r+m)", "showPreview": true, "expectedVariableNames": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "after", "script": "question.mark_factorised(this);"}}, "showCorrectAnswer": true, "failureRate": 1, "type": "jme", "checkVariableNames": false, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 1, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "$\\simplify{5{a[3]}d+5{b[3]}r+5m}=$[[0]] ", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst"}, {"sortAnswers": false, "variableReplacements": [], "gaps": [{"variableReplacements": [], "answer": "6c*d*({a[4]}d+{b[4]}c+{c[1]}c*d)", "showPreview": true, "expectedVariableNames": [], "unitTests": [], "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "after", "script": "question.mark_factorised(this);"}}, "showCorrectAnswer": true, "failureRate": 1, "type": "jme", "checkVariableNames": false, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 1, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "vsetRangePoints": 5}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill", "prompt": "$\\simplify{6{a[4]}c*d^2+6{b[4]}c^2d+6{c[1]}c^2d^2}=$[[0]] ", "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst"}], "variablesTest": {"condition": "", "maxRuns": "1000"}, "rulesets": {}}, {"name": "Create an algebraic expression from a word problem, simplify, and evaluate", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}], "type": "question", "tags": ["algebraic expressions", "collect terms", "create algebraic expressions", "simplify algebraic expressions", "simplifying algebraic expressions", "taxonomy"], "variablesTest": {"condition": "gcd(a1,b1+c1/2)=1", "maxRuns": 100}, "variables": {"b1": {"group": "Number of packets eaten", "description": " Number of packets of toffee eaten ", "templateType": "anything", "name": "b1", "definition": "random(2..10 except a1)"}, "c1": {"group": "Number of packets eaten", "description": " Number of packets of jelly sweets eaten. ", "templateType": "anything", "name": "c1", "definition": "random(2..5)*2"}, "name": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "name", "definition": "random('Jerry','Jessica')"}, "a1": {"group": "Number of packets eaten", "description": " Number of packets of lollipops eaten ", "templateType": "anything", "name": "a1", "definition": "random(5..10)"}, "total": {"group": "Ungrouped variables", "description": " The total spent. ", "templateType": "anything", "name": "total", "definition": "(a1+b1+c1/2)*2 + b1+c1/2"}}, "functions": {}, "statement": " {name} eats a lot of sweets. You are trying to work out the cost of the sweets that {name} ate last week. \n {name} ate$\\var{a1}$packets of lollipops,$\\var{b1}$packets of toffee and$\\simplify{{c1}}$packets of jelly sweets. \n You know that a packet of toffee costs$£1$more than a packet of lollipops, and a packet of jelly sweets costs half as much as a packet of toffees. ", "variable_groups": [{"name": "Number of packets eaten", "variables": ["a1", "b1", "c1"]}], "parts": [{"extendBaseMarkingAlgorithm": true, "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customMarkingAlgorithm": "", "gaps": [{"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "valuegenerators": [{"value": "", "name": "x"}], "scripts": {}, "showPreview": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": "", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "useCustomName": false, "variableReplacements": [], "marks": 1, "customName": "", "checkingAccuracy": 0.001, "answer": "x", "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": []}, {"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "valuegenerators": [{"value": "", "name": "x"}], "scripts": {}, "showPreview": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": "", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "useCustomName": false, "variableReplacements": [], "marks": 1, "customName": "", "checkingAccuracy": 0.001, "answer": "x+1", "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": []}, {"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "valuegenerators": [{"value": "", "name": "x"}], "scripts": {}, "showPreview": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "customMarkingAlgorithm": "", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "useCustomName": false, "variableReplacements": [], "marks": 1, "customName": "", "checkingAccuracy": 0.001, "answer": "1/2(x+1)", "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": []}], "showFeedbackIcon": true, "prompt": " Let the cost of a packet of lollipops be$£x$. \n Write an expression in terms of$x$for the cost of each kind of sweet: \n Lollipops: £[[0]] \n Toffees: £[[1]] \n Jelly sweets: £[[2]] ", "sortAnswers": false, "variableReplacements": [], "marks": 0, "customName": "", "showCorrectAnswer": true, "unitTests": []}, {"extendBaseMarkingAlgorithm": true, "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customMarkingAlgorithm": "", "gaps": [{"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "variableReplacements": [], "marks": 1, "checkingAccuracy": 0.001, "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": [], "valuegenerators": [{"value": "", "name": "x"}], "showPreview": true, "answerSimplification": "all", "checkVariableNames": true, "customMarkingAlgorithm": "", "useCustomName": false, "customName": "", "answer": "({a1}+{b1}+{c1}/2)x+({b1}+{c1}/2)"}], "showFeedbackIcon": true, "prompt": " Write an algebraic expression for the overall cost of the sweets {name} ate, in terms of$x$. \n £[[0]] ", "sortAnswers": false, "variableReplacements": [], "marks": 0, "customName": "", "showCorrectAnswer": true, "unitTests": []}, {"extendBaseMarkingAlgorithm": true, "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customMarkingAlgorithm": "", "gaps": [{"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "scripts": {}, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "variableReplacements": [], "marks": 1, "checkingAccuracy": 0.001, "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": [], "valuegenerators": [{"value": "", "name": "x"}], "showPreview": true, "answerSimplification": "all", "checkVariableNames": true, "mustmatchpattern": {"message": "Your answer is not fully simplified.", "pattern": "$n*x + $n", "partialCredit": 0, "nameToCompare": ""}, "customMarkingAlgorithm": "", "useCustomName": false, "customName": "", "answer": "({a1}+{b1}+{c1}/2)x+({b1}+{c1}/2)"}], "showFeedbackIcon": true, "prompt": " Now simplify your expression for the total cost. \n £[[0]] ", "sortAnswers": false, "variableReplacements": [], "marks": 0, "customName": "", "showCorrectAnswer": true, "unitTests": []}, {"extendBaseMarkingAlgorithm": true, "scripts": {}, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customMarkingAlgorithm": "", "gaps": [{"extendBaseMarkingAlgorithm": true, "vsetRange": [0, 1], "scripts": {}, "notallowed": {"message": " Don't use brackets ", "partialCredit": 0, "showStrings": true, "strings": ["(", ")"]}, "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "showFeedbackIcon": true, "failureRate": 1, "variableReplacements": [], "marks": 1, "checkingAccuracy": 0.001, "showCorrectAnswer": true, "vsetRangePoints": 5, "unitTests": [], "type": "jme", "valuegenerators": [], "showPreview": true, "answerSimplification": "all", "checkVariableNames": true, "customMarkingAlgorithm": "", "useCustomName": false, "customName": "", "answer": "({a1}+{b1}+{c1}/2)2+{b1}+{c1}/2"}], "showFeedbackIcon": true, "prompt": " You find out that a packet of lollipops costs$£2$. \n Calculate {name}'s total expenditure on sweets last week. \n £[[0]] ", "sortAnswers": false, "variableReplacements": [], "marks": 0, "customName": "", "showCorrectAnswer": true, "unitTests": []}], "ungrouped_variables": ["name", "total"], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": " Given a description in words of the costs of some items in terms of an unknown cost, write down an expression for the total cost of a selection of items. Then simplify the expression, and finally evaluate it at a given point. \n The word problem is about the costs of sweets in a sweet shop. "}, "preamble": {"css": "", "js": ""}, "advice": " #### a) \n We are told that the price of a packet of lollipops is represented by the letter$x$. \n A packet of toffee costs$£1$more than a packet of lollipops, i.e.$x+1$. \n A packet of jelly sweets costs half as much as a packet of toffee, so$\\frac{1}{2}(x+1). \n #### b) \n To find the total cost, multiply the expressions above for the cost of each kind of sweet by the number of packets eaten, and add them together. \n Without simplifying, we obtain: \n \\begin{align} \\text{Cost} &= \\simplify[]{{a1}x+{b1}(x+1) + {c1}*(1/2)*(x+1)} \\\\ &= \\simplify[]{{a1}x+{b1}(x+1) + {c1/2}*(x+1)} \\text{.} \\end{align} \n #### c) \n The first step in simplifying this expression is to expand both sets of brackets: \n \\begin{align} \\simplify[]{ {a1}x + {b1}(x+1) + {c1/2}*(x+1)} &= \\simplify[]{ {a1}x + {b1}x + {b1}*1 + {c1/2}x + {c1/2}*1} \\\\ &= \\simplify[] { {a1}x + {b1}x + {b1} + {c1/2}x + {c1/2} } \\text{.} \\end{align} \n Finally, collect like terms: \n \\begin{align} \\simplify[] { {a1}x + {b1}x + {b1} + {c1/2}x + {c1/2} } &= \\simplify[]{ {a1+b1+c1/2}x + {b1+c1/2} } \\text{.} \\end{align} \n \n #### d) \n Once we know that the price of a packet of lollipops is£2$, we can substitute this for$xin the equation above. \n \\begin{align} \\text{Cost}&=\\simplify{ {a1+b1+c1/2}x+{b1+c1/2} }\\\\ &=\\var{a1+b1+c1/2} \\times 2+\\var{b1+c1/2} \\\\ &=\\var{(a1+b1+c1/2)*2+b1+c1/2} \\text{.} \\end{align} \n So {name} spent£\\var{total}$on sweets last week. "}, {"name": "Write down and apply the formula for an arithmetic sequence.", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "variable_groups": [], "preamble": {"js": "", "css": ""}, "type": "question", "parts": [{"variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "showCorrectAnswer": true, "gaps": [{"checkingtype": "absdiff", "type": "jme", "showCorrectAnswer": true, "vsetrange": [0, 1], "showpreview": true, "answer": "{a1}+(n-1){d}", "showFeedbackIcon": true, "answersimplification": "basic", "checkvariablenames": false, "variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "checkingaccuracy": 0.001, "variableReplacements": [], "vsetrangepoints": 5, "expectedvariablenames": []}], "marks": 0, "showFeedbackIcon": true, "variableReplacements": [], "prompt": " Write out an expression for$a_n$, the$n^{\\text{th}}$term of the sequence, in terms of$n$. \n$a_n =$[[0]] \n "}, {"variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "showCorrectAnswer": true, "gaps": [{"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "allowFractions": false, "scripts": {}, "minValue": "a1+(small-1)*d", "maxValue": "a1+(small-1)*d", "marks": 1, "variableReplacements": []}], "marks": 0, "showFeedbackIcon": true, "variableReplacements": [], "prompt": " \n Find the$\\var{small}^{\\text{th}}$term \n$a_{\\var{small}} = $[[0]] \n "}, {"variableReplacementStrategy": "originalfirst", "type": "gapfill", "scripts": {}, "showCorrectAnswer": true, "gaps": [{"correctAnswerFraction": false, "mustBeReduced": false, "type": "numberentry", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "allowFractions": false, "scripts": {}, "minValue": "a1+(large-1)*d", "maxValue": "a1+(large-1)*d", "marks": 1, "variableReplacements": []}], "marks": 0, "showFeedbackIcon": true, "variableReplacements": [], "prompt": " Find the$\\var{large}^{\\text{th}}$term \n$a_{\\var{large}} = $[[0]] "}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": " Given the first few terms of an arithmetic sequence, write down its formula, then find a couple of particular terms. "}, "tags": ["arithmetic sequences", "nth term", "sequences", "taxonomy"], "variables": {"large": {"templateType": "anything", "description": " A large index to compute ", "definition": "random(10..50#5)*10", "name": "large", "group": "Ungrouped variables"}, "small": {"templateType": "anything", "description": " A small index to compute ", "definition": "random(6..10)", "name": "small", "group": "Ungrouped variables"}, "a1": {"templateType": "anything", "description": " The first term in the sequence ", "definition": "random(1..90)", "name": "a1", "group": "Ungrouped variables"}, "d": {"templateType": "anything", "description": "", "definition": "random(3..13 except 10)", "name": "d", "group": "Ungrouped variables"}}, "rulesets": {}, "functions": {}, "ungrouped_variables": ["a1", "d", "small", "large"], "statement": " In this question, consider the sequence \n \$a = \\var{a1}, \\; \\var{a1+d}, \\; \\var{a1+d*2}, \\; \\var{a1+d*3}, \\; \\ldots \$ \n A helpful person has drawn out a table of the terms so far. \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n $\\boldsymbol{n}\\boldsymbol{a_n}1234\\ldots\\var{a1}\\var{a1+d}\\var{a1+2d}\\var{a1+3d}\\ldots$", "advice": " The formula for the$n^\\text{th}$term,$a_n$, of an arithmetic sequence is \n \$a_n=a_1+(n-1)d \\text{.} \$ \n$a_1$is the first term, and$d$is the common difference between adjacent terms. \n #### a) \n In the given sequence, the common difference is$\\var{a1+d} - \\var{a1} = \\var{d}$, and the first term is$\\var{a1}$. \n So, the formula for this sequence is \n \$a_n = \\var{a1} + (n-1) \\times \\var{d} \\text{.} \$ \n #### b) \n \$a_\\var{small} = \\var{a1} + (\\var{small}-1) \\times \\var{d} = \\var{a1+(small-1)*d} \\text{.} \$ \n #### c) \n \$a_\\var{large} = \\var{a1} + (\\var{large}-1) \\times \\var{d} = \\var{a1+(large-1)*d} \\text{.} \$ \n\n", "variablesTest": {"condition": "", "maxRuns": 100}}, {"name": "Expand brackets and collect like terms", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}, {"name": "Aiden McCall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1592/"}], "variable_groups": [{"variables": ["a1", "b1", "c1"], "name": "B group"}, {"variables": ["a", "b", "c", "d", "f", "g", "h", "j"], "name": "Part a"}], "variables": {"c": {"templateType": "anything", "description": "", "definition": "repeat(random(2..10),5)", "name": "c", "group": "Part a"}, "c1": {"templateType": "anything", "description": "", "definition": "random(2..5)*2", "name": "c1", "group": "B group"}, "b1": {"templateType": "anything", "description": "", "definition": "random(2..10 except a1)", "name": "b1", "group": "B group"}, "d": {"templateType": "anything", "description": "", "definition": "repeat(random(2..33),6)", "name": "d", "group": "Part a"}, "f": {"templateType": "anything", "description": "", "definition": "repeat(random(2..20),7)", "name": "f", "group": "Part a"}, "j": {"templateType": "anything", "description": "", "definition": "repeat(random(2..20),9)", "name": "j", "group": "Part a"}, "h": {"templateType": "anything", "description": "", "definition": "repeat(random(2..20),7)", "name": "h", "group": "Part a"}, "a1": {"templateType": "anything", "description": "", "definition": "random(5..10)", "name": "a1", "group": "B group"}, "a": {"templateType": "anything", "description": " random variables for part 1 ", "definition": "repeat(random(5..15),5)", "name": "a", "group": "Part a"}, "b": {"templateType": "anything", "description": "", "definition": "repeat(random(2..10),5)", "name": "b", "group": "Part a"}, "g": {"templateType": "anything", "description": "", "definition": "repeat(random(2..15),7)", "name": "g", "group": "Part a"}}, "type": "question", "parts": [{"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": false, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": "

You must collect like terms to fully simplify.

", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "x"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({c[1]}+{c[0]}+{c[2]})x", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "

$\\var{c[0]}x+\\var{c[1]}x+\\var{c[2]}x=$ [[0]]

", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": false, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x^2 +$n*x + $n", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "vsetRange": [0, 1], "variableReplacements": [], "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "x"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({a[1]}+{a[2]})x^2+({a[3]}+{a[4]})x+{a[0]}", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "$\\var{a[1]}x^2+\\var{a[2]}x^2+\\var{a[3]}x+\\var{a[4]}x +\\var{a[0]}=$[[0]] ", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": false, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*y^5", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": "

", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "y"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({b[1]}+{b[2]}+{b[3]}+{b[4]}+{b[0]})y^5", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "

$\\var{b[0]}y^5+\\var{b[1]}y^5+\\var{b[2]}y^5+\\var{b[4]}y^5+\\var{b[3]}y^5=$ [[0]]

", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": true, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*a*b*c +$n*a*b + $n*a +$n*b + $n*c", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": " You must condense your answer to fully simplify. ", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "a"}, {"value": "", "name": "b"}, {"value": "", "name": "c"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "{d[0]}a*b+{d[1]+d[5]}*a*b*c+{d[2]}a+{d[3]}b+{d[4]}c", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "$\\var{d[0]}ab+\\var{d[1]}abc+\\var{d[2]}a+\\var{d[3]}b+\\var{d[4]}c+\\var{d[5]}abc=$[[0]] ", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": true, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*a^2*b + $n*a*b^2 +$n*a*b", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": "

", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "a"}, {"value": "", "name": "b"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({f[0]}+{f[3]})a^2b+({f[1]}+{f[4]})a*b^2+({f[2]})a*b", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "

$\\var{f[0]}a^2b+\\var{f[1]}ab^2+\\var{f[2]}ab+\\var{f[3]}a^2b+\\var{f[4]}ab^2=$ [[0]]

", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": false, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x+$n*y", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": "

You must condense your answer to fully simplify. *'s are not needed to indicate multiplication here.

", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "x"}, {"value": "", "name": "y"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({g[0]}{g[1]}+{g[4]})x+({g[0]}{g[2]}+{g[5]})y", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "

$\\var{g[0]}(\\var{g[1]}x+\\var{g[2]}y)+\\var{g[4]}x+\\var{g[5]}y=$ [[0]]

\n

", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": true, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x*z +$n*x^2 + $n*x +$n*z + $n*z^2", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "musthave": {"partialCredit": 0, "message": "", "strings": ["*"], "showStrings": false}, "variableReplacementStrategy": "originalfirst", "failureRate": 1, "notallowed": {"partialCredit": 0, "message": " 9You should not have brackets in your answer. ", "strings": ["(", ")"], "showStrings": true}, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": " You must condense your answer to fully simplify. ", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "x"}, {"value": "", "name": "z"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({h[0]}{h[1]}+{h[4]})x^2+({h[0]}{h[2]})z*x+{h[3]}x+{h[5]}z^2+{h[6]}z", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "$\\var{h[0]}x(\\var{h[1]}x+\\var{h[2]}z)+\\var{h[3]}x+\\var{h[6]}z+\\var{h[4]}x^2+\\var{h[5]}z^2=$[[0]] ", "unitTests": [], "customName": ""}, {"extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "useCustomName": false, "showFeedbackIcon": true, "gaps": [{"showCorrectAnswer": true, "checkVariableNames": true, "useCustomName": false, "mustmatchpattern": {"nameToCompare": "", "partialCredit": 0, "pattern": "$n*x + +-$n*y", "message": "You haven't simplified: you still have two or more like terms that should be collected together."}, "unitTests": [], "answerSimplification": "all", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "failureRate": 1, "variableReplacements": [], "vsetRange": [0, 1], "maxlength": {"partialCredit": 0, "message": " You must condense your answer to fully simplify. ", "length": "0"}, "customMarkingAlgorithm": "", "vsetRangePoints": 5, "valuegenerators": [{"value": "", "name": "x"}, {"value": "", "name": "y"}], "customName": "", "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "answer": "({j[0]}{j[1]}+{j[4]}{j[3]}+{j[6]}{j[7]})x-({j[0]}{j[2]}+{j[5]}{j[3]}+{j[6]}{j[8]})y", "checkingType": "absdiff", "scripts": {}, "showPreview": true, "marks": 1}], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "sortAnswers": false, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "variableReplacements": [], "prompt": "$\\var{j[0]}(\\var{j[1]}x-\\var{j[2]}y)+\\var{j[3]}(\\var{j[4]}x-\\var{j[5]}y)+\\var{j[6]}(\\var{j[7]}x-\\var{j[8]}y)=$[[0]] ", "unitTests": [], "customName": ""}], "advice": " When simplifying expressions, only terms of the same type or like terms can be added together. \n Algebraic symbols or letters can be added together provided that they are raised to the same power. For example, we can add$x^2+x^2=2x^2$, but we cannot collect both$x^2$and$xinto one term. \n #### a) \n \\\begin{align} \\var{c[0]}x+\\var{c[1]}x+\\var{c[2]}x&=(\\var{c[0]}+\\var{c[1]}+\\var{c[2]})x\\\\ &=\\simplify{({c[0]}+{c[1]}+{c[2]})}x \\end{align} \ \n #### b) \n \\\begin{align} \\var{a[1]}x^2+\\var{a[2]}x^2+\\var{a[3]}x+\\var{a[4]}x +\\var{a[0]}&=(\\var{a[1]}+\\var{a[2]})x^2+(\\var{a[3]}+\\var{a[4]})x +\\var{a[0]}\\\\ &=\\simplify{({a[1]}+{a[2]})}x^2+\\simplify{({a[3]}+{a[4]})}x+\\var{a[0]} \\end{align} \ \n #### c) \n \\\begin{align} \\var{b[0]}y^5+\\var{b[1]}y^5+\\var{b[2]}y^5+\\var{b[4]}y^5+\\var{b[3]}y^5&=(\\var{b[0]}+\\var{b[1]}+\\var{b[2]}+\\var{b[4]}+\\var{b[3]})y^5\\\\ &=\\simplify{({b[1]}+{b[2]}+{b[3]}+{b[4]}+{b[0]})}y^5 \\end{align} \ \n #### d) \n \\\begin{align} \\var{d[0]}ab+\\var{d[1]}abc+\\var{d[2]}a+\\var{d[3]}b+\\var{d[4]}c+\\var{d[5]}abc &=(\\var{d[1]}+\\var{d[5]})abc+\\var{d[0]}ab+\\var{d[2]}a+\\var{d[3]}b+\\var{d[4]}c\\\\ &=\\simplify{{d[1]}+{d[5]}}abc+\\var{d[0]}ab+\\var{d[2]}a+\\var{d[3]}b+\\var{d[4]}c \\end{align} \ \n #### e) \n \\\begin{align} \\var{f[0]}a^2b+\\var{f[1]}ab^2+\\var{f[2]}ab+\\var{f[3]}a^2b+\\var{f[4]}ab^2 &=(\\var{f[0]}+\\var{f[3]})a^2b+(\\var{f[1]}+\\var{f[4]})ab^2+\\var{f[2]}ab\\\\ &=\\simplify{{f[0]}+{f[3]}}a^2b+\\simplify{{f[1]}+{f[4]}}ab^2+\\var{f[2]}ab \\end{align} \ \n #### f) \n \\\begin{align} \\var{g[0]}(\\var{g[1]}x+\\var{g[2]}y)+\\var{g[4]}x+\\var{g[5]}y &=(\\var{g[0]}\\times \\var{g[1]}+\\var{g[4]})x+(\\var{g[0]} \\times\\var{g[2]}+\\var{g[5]})y\\\\ &=(\\simplify{{g[0]}*{g[1]}}+\\var{g[4]})x+(\\simplify{{g[0]}*{g[2]}}+\\var{g[5]})y\\\\ &=\\simplify{{g[0]}*{g[1]}+{g[4]}}x+\\simplify{{g[0]}*{g[2]}+{g[5]}}y \\end{align} \ \n #### g) \n \\\begin{align} \\var{h[0]}x(\\var{h[1]}x+\\var{h[2]}z)+\\var{h[3]}x+\\var{h[6]}z+\\var{h[4]}x^2+\\var{h[5]}z^2 &=(\\simplify[]{{h[0]}{h[1]}}+\\var{h[4]})x^2+(\\simplify[]{{h[0]}{h[2]}})zx+\\var{h[3]}x+\\var{h[5]}z^2+\\var{h[6]}z\\\\ &=(\\simplify{{h[0]}{h[1]}}+\\var{h[4]})x^2+(\\simplify[]{{h[0]}{h[2]}})zx+\\var{h[3]}x+\\var{h[5]}z^2+\\var{h[6]}z\\\\ &=\\simplify{{h[0]}*{h[1]}+{h[4]}}x^2+\\simplify{{h[0]}*{h[2]}}zx+\\simplify{{h[3]}x+{h[5]}}z^2+\\var{h[6]}z \\end{align} \ \n #### h) \n \\\begin{align} \\var{j[0]}(\\var{j[1]}x-\\var{j[2]}y)+\\var{j[3]}(\\var{j[4]}x-\\var{j[5]}y)+\\var{j[6]}(\\var{j[7]}x-\\var{j[8]}y) &= (\\simplify[]{{j[0]}{j[1]}}+\\simplify[]{{j[3]}{j[4]}}+\\simplify[]{{j[6]}{j[7]}})x-(\\simplify[]{{j[0]}{j[2]}}+\\simplify[]{{j[3]}{j[5]}}+\\simplify[]{{j[6]}{j[8]}})y\\\\ &= (\\simplify{{j[0]}{j[1]}}+\\simplify{{j[3]}{j[4]}}+\\simplify{{j[6]}{j[7]}})x-(\\simplify{{j[0]}{j[2]}}+\\simplify{{j[3]}{j[5]}}+\\simplify{{j[6]}{j[8]}})y\\\\ &= \\simplify{({j[0]}*{j[1]}+{j[4]*j[3]}+{j[6]}*{j[7]})x}-\\simplify{({j[0]}*{j[2]}+{j[5]}{j[3]}+{j[6]}*{j[8]})y} \\end{align} \ \n", "tags": ["collecting terms", "expanding brackets", "simplifying algebraic expressions", "simplifying expressions", "taxonomy"], "preamble": {"js": "", "css": ""}, "rulesets": {}, "functions": {}, "ungrouped_variables": [], "statement": " For each expression below, collect like terms and expand brackets. \n The * symbol is required between algebraic symbols, e.g.5ab^2$should be written 5*a*b^2`. ", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": " Eight expressions, of increasing complexity. The student must simplify them by expanding brackets and collecting like terms. "}, "variablesTest": {"condition": "", "maxRuns": 100}}, {"name": "Substitute values into formulas", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Aiden McCall", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1592/"}], "metadata": {"description": " Substitute given values into formulas. ", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": ["r", "x1", "n", "x2", "const", "sales"], "type": "question", "advice": " When inserting numbers into your calculator make sure you place brackets correctly. \n #### a) \n As$x = \\var{n+2}$, \n substitute$\\var{n+2}$into$\\var{x2}x^2 + \\var{x1}x + \\var{const}. \n \\begin{align} \\var{x2}x^2 + \\var{x1}x + \\var{const} &= \\var{x2} (\\var{n+2})^2 + \\var{x1}(\\var{n+2}) + \\var{const} \\\\ &= \\simplify{{x2} ({n+2})^2 + {x1}({n+2}) + {const}}\\,. \\end{align} \n b) \n Asy =  \\var{n}$, \n substitute$\\var{n}$into$\\var{n+1}y^2-\\var{x2}y. \n \\begin{align} \\var{n+1}y^2-\\var{x2}y &= \\var{n+1}(\\var{n})^2-\\var{x2}(\\var{n}) \\\\ &= \\simplify{{n+1}({n})^2-{x2}({n})}\\,. \\end{align} \n c) \n As we are given a temperature in degrees Celcius,T_C = \\var{T_C}°C.$\n Substituting$T_C$into$T_C = 1.8\\,T_C + 32. \n \\begin{align} T_F &=1.8\\, T_C+32 \\\\ &=1.8 (\\var{T_C}) + 32 \\\\ &= \\var{dpformat(1.8 {T_C} +32, 1)}\\,°F\\,. \\end{align} \n \n \n", "variable_groups": [{"name": "Name variables", "variables": ["name", "name2", "pronoun"]}, {"name": "Temperature conversion", "variables": ["T_F", "T_C"]}], "rulesets": {}, "statement": " Substitute the given values in the equations below. ", "parts": [{"scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "marks": 0, "gaps": [{"correctAnswerFraction": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "allowFractions": false, "minValue": "{x2}{n+2}^2+{x1}{n+2}+{const}", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "{x2}{n+2}^2+{x1}{n+2}+{const}", "mustBeReduced": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain", "showCorrectAnswer": true}], "showFeedbackIcon": true, "prompt": " A curve is defined by a functiony=\\simplify{{x2}x^2 + {x1}x + {const}}$. \n What is the$y$coordinate value of the point on the curve at$x=\\var{n+2}$? \n$y =$[[0]] "}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "marks": 0, "gaps": [{"correctAnswerFraction": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "allowFractions": false, "minValue": "{n+1}{n}^2-{x2}{n}", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "{n+1}{n}^2-{x2}{n}", "mustBeReduced": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain", "showCorrectAnswer": true}], "showFeedbackIcon": true, "prompt": " {name[n]} sells luxury yachts. \n The predicted sales of the luxury yachts are defined by \n \$S=\\simplify{{n+1}y^2-{x2}y},\$ \n where$S$is the number of sales predicted this year;$y$is the number of luxury yachts sold in the previous year. \n {pronoun} sold {n} yachts in the previous year. \n Calculate$S$, the number of sales predicted this year. \n$S =$[[0]] "}, {"scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showCorrectAnswer": true, "marks": 0, "gaps": [{"correctAnswerFraction": false, "mustBeReducedPC": 0, "notationStyles": ["plain", "en", "si-en"], "showFeedbackIcon": true, "allowFractions": false, "minValue": "T_F", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "maxValue": "T_F", "mustBeReduced": false, "marks": 1, "variableReplacements": [], "correctAnswerStyle": "plain", "showCorrectAnswer": true}], "showFeedbackIcon": true, "prompt": " You can convert temperatures from degrees celsius to degrees fahrenheit by using the formula \n \$T_F=1.8\\, T_C+32,\$ \n where$T_F$= Temperature in$°FT_C$= Temperature in$°C$. \n Convert$\\var{T_C}°C$into degrees fahrenheit. \n$T_F =$[[0]]$°F\$

"}], "tags": ["predicted value", "substitution", "Substitution", "taxonomy"], "preamble": {"css": "", "js": ""}, "functions": {}, "variables": {"pronoun": {"description": "

Defines the pronoun in the question.

", "definition": "if(mod(n,2)=0,\"He\",\"She\")", "group": "Name variables", "name": "pronoun", "templateType": "anything"}, "T_C": {"description": "

Creates a random integer value for the temperature in degrees celcius.

", "definition": "random(5..30#1)", "group": "Temperature conversion", "name": "T_C", "templateType": "anything"}, "name": {"description": "

List of names to randomise. Can change to any name inserted

", "definition": "[\"Andrew\",\"Susan\",\"Tom\",\"Geraldine\",\"Joshua\",\"Chantel\"]", "group": "Name variables", "name": "name", "templateType": "anything"}, "n": {"description": "

n is a random number between 0 and 4 that picks a name from {name} and then picks the next in the list for the other name such that there is always a male and a female in the question.

", "definition": "random(0..4#1)", "group": "Ungrouped variables", "name": "n", "templateType": "anything"}, "sales": {"description": "", "definition": "(n+1)n^2-x2*n", "group": "Ungrouped variables", "name": "sales", "templateType": "anything"}, "const": {"description": "

The constant coefficient

", "definition": "random(1..100#1)", "group": "Ungrouped variables", "name": "const", "templateType": "anything"}, "T_F": {"description": "

Creates a value for Temperature in fahrenheit.

", "definition": "T_C*1.8+32", "group": "Temperature conversion", "name": "T_F", "templateType": "anything"}, "r": {"description": "

A random variable which will be inputted by the student.

", "definition": "random(1..50#0.1)", "group": "Ungrouped variables", "name": "r", "templateType": "anything"}, "x2": {"description": "

The x^2 coefficient

", "definition": "random(1..(n+1)*n)", "group": "Ungrouped variables", "name": "x2", "templateType": "anything"}, "name2": {"description": "

List of names to randomise. Can change to any name inserted

", "definition": "[\"Andrew\",\"Susan\",\"Tom\",\"Geraldine\",\"Joshua\",\"Chantel\"]", "group": "Name variables", "name": "name2", "templateType": "anything"}, "x1": {"description": "

The x coefficient

", "definition": "random(1..50)", "group": "Ungrouped variables", "name": "x1", "templateType": "anything"}}, "variablesTest": {"maxRuns": 100, "condition": ""}}]}], "feedback": {"showactualmark": true, "intro": "", "allowrevealanswer": true, "advicethreshold": 0, "showtotalmark": true, "feedbackmessages": [], "showanswerstate": true}, "navigation": {"showfrontpage": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "reverse": true, "allowregen": true, "onleave": {"message": "", "action": "none"}}, "metadata": {"description": "

Questions on rearranging expressions, expanding brackets and collecting like terms.

", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "showstudentname": true, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": ["geogebra", "stats"], "custom_part_types": [], "resources": []}