// Numbas version: exam_results_page_options {"name": "Pattern match: pull common factors out", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Pattern match: pull common factors out", "tags": [], "metadata": {"description": "

A mathematical expression part with a pattern restriction to ensure that the student has extracted the highest common factor of two terms.

\n

The answer must be of the form $a(b+cx)$, where $b$ and $c$ are coprime.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "

The greatest common factor of $\\var{a}$ and $\\var{b}$ is $\\var{g}$.

\n

So

\n

\\[ \\simplify{ {a} + {b}x } = \\simplify{ {g}*({a/g} + {b/g}x) } \\]

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a,b": {"name": "a,b", "group": "Ungrouped variables", "definition": "repeat(random(1..10)*n,2)", "description": "

Two numbers to use as the coefficients of the terms. They're both multiples of n.

", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random(2..6)", "description": "

A common factor for a and b. This might not be the greatest common factor, but it ensures that a and b aren't coprime.

", "templateType": "anything", "can_override": false}, "g": {"name": "g", "group": "Ungrouped variables", "definition": "gcd(a,b)", "description": "

the greatest common factor of a and b

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a,b", "n", "g"], "variable_groups": [], "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, "prompt": "

Extract the greatest common factor of $\\simplify{ {a} + {b}x }$ to obtain an expression of the form $a(b+cx)$, where $b$ and $c$ have no common factors.

", "answer": "{g}*({a/g}+{b/g}*x)", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "mustmatchpattern": {"pattern": "// a number times...\n$n`? * \n(\n // the constant term: \n // either a number 'a', \n // or 'a' is implicitly zero if no constant term is given\n ($n;a `| $z;a:0) \n \n + `+-\n \n // the x term:\n // either a number 'b' times x,\n // or x on its own, and 'b' is implicitly 1\n ($n;b * x `| x;b:1)\n)\n\n// a and b must be coprime\n`where\n\n(gcd(a,b)=1)", "partialCredit": 0, "message": "It doesn't seem that you've completely factorised the expression.", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}