// Numbas version: exam_results_page_options {"name": "1.3.1.1 Collect like terms", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "1.3.1.1 Collect like terms", "tags": [], "metadata": {"description": "

Given an expression in one or two variables, with two or three terms, collect like terms, if possible. Part of HELM Book 1.3

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Simplify, if possible: $\\var{q1expr}$.

\n

If the expression cannot be simplified, just type in the expression without changing it.

", "advice": "

$\\var{q1expr}$ $=\\var{q1ans}$

\n

This expression cannot be simplified as the variables are different.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"vars": {"name": "vars", "group": "Ungrouped variables", "definition": "shuffle(['a','b','c','d','f','g','h','k','m','n','p','q','r','s','t','u','v','w','x','y','z'])", "description": "", "templateType": "anything", "can_override": false}, "q1coeffs": {"name": "q1coeffs", "group": "question 1", "definition": "repeat(random(-20..20 except 0),3)", "description": "

coefficients to go in front of the variables.

", "templateType": "anything", "can_override": false}, "q1exprs": {"name": "q1exprs", "group": "question 1", "definition": "[expression(q1coeffs[0] + \"*\" + vars[0] + \"+\" + \n q1coeffs[1] + \"*\" + vars[0] + \"+\" + q1coeffs[2] + \"*\" + vars[0]),\nexpression(q1coeffs[0]+\"*\" + vars[0] + \"^2+\" + q1coeffs[1]+\"*\"+vars[0]+\"^2\"),\nexpression(q1coeffs[0]+\"*\" + vars[0] + \"^2+\" + q1coeffs[1]+\"*\"+vars[1]+\"^2\"),\nexpression(q1coeffs[0] + \"*\" + vars[0] + \"+\" + q1coeffs[1] + \"*\" + vars[1] ) \n]", "description": "", "templateType": "anything", "can_override": false}, "q1idx": {"name": "q1idx", "group": "question 1", "definition": "random(0..3)", "description": "", "templateType": "anything", "can_override": false}, "q1expr": {"name": "q1expr", "group": "question 1", "definition": "simplify(q1exprs[q1idx],[\"basic\"])", "description": "", "templateType": "anything", "can_override": false}, "q1ans": {"name": "q1ans", "group": "question 1", "definition": "simplify(q1expr,[\"all\"])", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "question 1", "definition": "[expression(\"x\"),expression(\"y\")]", "description": "", "templateType": "anything", "can_override": false}, "test": {"name": "test", "group": "question 1", "definition": "distinct(t)=t", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["vars"], "variable_groups": [{"name": "question 1", "variables": ["q1coeffs", "q1exprs", "q1idx", "q1expr", "q1ans", "t", "test"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{q1ans}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": true, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "mustmatchpattern": {"pattern": "m_commutative(m_associative(\n$v;v1;v2:0 ^2`? * $n`? // v\n`| - $v;v1;v2:0 ^2`? // -v\n`| -$n * $v;v1;v2:0 ^2`? // -nv\n\n`| $v;v1 ^2`? * $n`? + $v;v2 ^2`? * $n`? // (n)v + (n)v\n\n`| $v;v1 ^2`? * $n`? - $v;v2 ^2`? // (n)v - v\n`| $v;v1 ^2`? * $n`? - $n * $v;v2 ^2`? // (n)v - nv\n\n`| -$v;v1 ^2`? - $v;v2 ^2`? // -v -v\n`| -$v;v1 ^2`? - $n * $v;v2 ^2`? // -v -nv\n`| -$n * $v;v1 ^2`? - $v;v2 ^2`? // -nv -v\n`| -$n * $v;v1 ^2`? - $n * $v;v2 ^2`? // -nv -nv\n\n `| -$v;v1 ^2`? + $v;v2 ^2`? * $n`? // -v + (n)v\n `| -$n * $v;v1 ^2`? + $v;v2 ^2`? * $n`? // -nv + (n)v\n\n`| 0;v1:1;v2:2\n\n `where string(v1)<>string(v2)\n))\n\n//this checks that the answer is in the correct form \n//and that there are not two terms with the same variable.\n// All the cases are so that the variables turn up in the\n// correct form for comparison: If I use a `+- in front of the\n// $v, the variable name is captured as -x (say) and this \n// crashes the where check for some reason I don't understand.\n// Also, although it works in Christian's pattern-matching test page,\n// here 4*(-n)<>-4n; hence there are two cases for each negative case,\n// one with, and one without the number.", "partialCredit": 0, "message": "Your answer is not in the expected form. You must collect all the like terms and put the numbers before the letters.", "nameToCompare": ""}, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}