// Numbas version: exam_results_page_options {"name": "Heather's copy of Expand brackets and collect like terms[L4 Randomised]", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": ["l4", "L4"], "name": "Heather's copy of Expand brackets and collect like terms[L4 Randomised]", "preamble": {"js": "", "css": ""}, "metadata": {"description": "

Eight expressions, of increasing complexity. The student must simplify them by expanding brackets and collecting like terms.

", "licence": "Creative Commons Attribution 4.0 International"}, "parts": [{"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "prompt": "

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

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must collect like terms to fully simplify.

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": false, "showPreview": true, "answer": "({c[1]}+{c[0]}+{c[2]})x", "marks": 1, "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": [], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \nvar rule = Numbas.jme.compile('m_number*x');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "prompt": "


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

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "expectedVariableNames": [], "failureRate": 1, "answerSimplification": "all", "vsetRangePoints": 5, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "answer": "({a[1]}+{a[2]})x^2+({a[3]}+{a[4]})x+{a[0]}", "customMarkingAlgorithm": "", "checkVariableNames": false, "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \nvar rule = Numbas.jme.compile('m_number*x^2+m_number*x+m_number');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "vsetRange": [0, 1], "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "showPreview": true, "type": "jme", "unitTests": [], "checkingAccuracy": 0.001}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "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]]

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must condense your answer to fully simplify.

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": false, "showPreview": true, "answer": "({b[1]}+{b[2]}+{b[3]}+{b[4]}+{b[0]})y^5", "marks": 1, "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": [], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \nvar rule = Numbas.jme.compile('m_number*y^5');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "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]]

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "expectedVariableNames": ["a", "b", "c"], "failureRate": 1, "checkingAccuracy": 0.001, "vsetRangePoints": 5, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must condense your answer to fully simplify. 

"}, "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "marks": 1, "answer": "{d[0]}a*b+({d[1]}+{d[5]})a*b*c+{d[2]}a+{d[3]}b+{d[4]}c", "customMarkingAlgorithm": "", "checkVariableNames": true, "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \n// we just want two sets of brackets, each containing two terms\n// or one of the brackets might not have a constant term\n// or for repeated roots, you might write (x+a)^2\nvar rule = Numbas.jme.compile('m_number*a*b*c+m_number*a*b+m_number*a+m_number*b+m_number*c');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "vsetRange": [0, 1], "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "showPreview": true, "type": "jme", "unitTests": []}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "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]]

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must condense your answer to fully simplify. 

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": true, "showPreview": true, "answer": "({f[0]}+{f[3]})a^2b+({f[1]}+{f[4]})a*b^2+({f[2]})a*b", "marks": 1, "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

\n

$ab^2$ should be written $ba^2$ and $b^2a$ should be written $ab^2$.

\n

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": ["a", "b"], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \n// we just want two sets of brackets, each containing two terms\n// or one of the brackets might not have a constant term\n// or for repeated roots, you might write (x+a)^2\nvar rule = Numbas.jme.compile('m_any(m_number*a^2*b+m_number*a*b^2+m_number*a*b)');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "prompt": "

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

\n

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

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

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": false, "showPreview": true, "answer": "({g[0]}{g[1]}+{g[4]})x+({g[0]}{g[2]}+{g[5]})y", "marks": 1, "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": [], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \n// we just want two sets of brackets, each containing two terms\n// or one of the brackets might not have a constant term\n// or for repeated roots, you might write (x+a)^2\nvar rule = Numbas.jme.compile('m_number*x+m_number*y');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "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]]

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must condense your answer to fully simplify. 

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": true, "showPreview": true, "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", "marks": 1, "musthave": {"showStrings": false, "message": "", "partialCredit": 0, "strings": ["*"]}, "notallowed": {"showStrings": true, "message": "

9You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": ["x", "z"], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \n// we just want two sets of brackets, each containing two terms\n// or one of the brackets might not have a constant term\n// or for repeated roots, you might write (x+a)^2\nvar rule = Numbas.jme.compile('m_any(m_number*x*z+m_number*x^2+m_number*x+m_number*z+m_number*z^2)');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}, {"variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "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]]

", "customMarkingAlgorithm": "", "sortAnswers": false, "scripts": {}, "marks": 0, "type": "gapfill", "unitTests": [], "gaps": [{"variableReplacements": [], "failureRate": 1, "checkingAccuracy": 0.001, "maxlength": {"partialCredit": 0, "length": "0", "message": "

You must condense your answer to fully simplify. 

"}, "checkingType": "absdiff", "unitTests": [], "showCorrectAnswer": true, "checkVariableNames": true, "showPreview": true, "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", "marks": 1, "notallowed": {"showStrings": true, "message": "

You should not have brackets in your answer.

", "partialCredit": 0, "strings": ["(", ")"]}, "type": "jme", "answerSimplification": "all", "vsetRange": [0, 1], "vsetRangePoints": 5, "expectedVariableNames": ["x", "y"], "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {"mark": {"script": "if(this.credit==0) {\n return;\n}\ndebugger;\n// Parse the student's answer as a syntax tree\nvar studentTree = Numbas.jme.compile(this.studentAnswer,Numbas.jme.builtinScope);\n\n// Create the pattern to match against \n// we just want two sets of brackets, each containing two terms\n// or one of the brackets might not have a constant term\n// or for repeated roots, you might write (x+a)^2\nvar rule = Numbas.jme.compile('m_any(m_number*x+m_pm(m_number*y))');\n\n// Check the student's answer matches the pattern. \nvar m = Numbas.jme.display.matchTree(rule,studentTree,true);\n// If not, take away marks\nif(!m) {\n //this.setCredit(0,'You haven\\'t simplified: your answer is not in the simplified form ');\n this.setCredit(0);\n this.markingComment('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n this.giveWarning('You haven\\'t simplified: you still have two or more like terms that should be collected together.');\n}", "order": "after"}}, "variableReplacementStrategy": "originalfirst"}]}], "ungrouped_variables": [], "functions": {}, "extensions": ["stats"], "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.

", "rulesets": {}, "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 $x$ into 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

", "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [{"variables": ["a1", "b1", "c1"], "name": "B group"}, {"variables": ["a", "b", "c", "d", "f", "g", "h", "j"], "name": "Part a"}], "variables": {"h": {"name": "h", "description": "", "templateType": "anything", "definition": "repeat(random(2..20),7)", "group": "Part a"}, "f": {"name": "f", "description": "", "templateType": "anything", "definition": "repeat(random(2..20),7)", "group": "Part a"}, "a": {"name": "a", "description": "

random variables for part 1

", "templateType": "anything", "definition": "repeat(random(5..15),5)", "group": "Part a"}, "a1": {"name": "a1", "description": "", "templateType": "anything", "definition": "random(5..10)", "group": "B group"}, "c1": {"name": "c1", "description": "", "templateType": "anything", "definition": "random(2..5)*2", "group": "B group"}, "c": {"name": "c", "description": "", "templateType": "anything", "definition": "repeat(random(2..10),5)", "group": "Part a"}, "g": {"name": "g", "description": "", "templateType": "anything", "definition": "repeat(random(2..15),7)", "group": "Part a"}, "b1": {"name": "b1", "description": "", "templateType": "anything", "definition": "random(2..10 except a1)", "group": "B group"}, "b": {"name": "b", "description": "", "templateType": "anything", "definition": "repeat(random(2..10),5)", "group": "Part a"}, "d": {"name": "d", "description": "", "templateType": "anything", "definition": "repeat(random(2..33),6)", "group": "Part a"}, "j": {"name": "j", "description": "", "templateType": "anything", "definition": "repeat(random(2..20),9)", "group": "Part a"}}, "type": "question", "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/"}, {"name": "Heather Driscoll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1703/"}, {"name": "Abbi Mullins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2466/"}, {"name": "Matthew James Sykes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2582/"}]}]}], "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/"}, {"name": "Heather Driscoll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1703/"}, {"name": "Abbi Mullins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2466/"}, {"name": "Matthew James Sykes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2582/"}]}