// Numbas version: finer_feedback_settings {"name": "1.3.4.3 Identify factors and factorise an expression", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "1.3.4.3 Identify factors and factorise an expression", "tags": [], "metadata": {"description": "

Explain why one variable is a factor but the other is not. Factorise the expression, whose factor is alphanumeric. Part of HELM Book 1.3

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

Practise these questions repeatedly until you can quickly, confidently and correctly factorise the expressions.

", "advice": "

$\\var{v1e}$ is a factor of every term of $\\var{q3expr}$ but $\\var{v2e}$ does not appear in every term.

\n

Hence $\\var{v1e}$ is a factor of $\\var{q3expr}$ but $\\var{v2e}$ is not.

\n

The greatest divisor appearing in every term is $\\var{fullgcd}$.

\n

So $\\var{q3expr}=\\var{q3ans}$

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"alphabet": {"name": "alphabet", "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}, "q3expr": {"name": "q3expr", "group": "question 3", "definition": "simplify(expression([\n string(simplify(expression(q3c1+\"*\"+q3v1+\"+\"+q3c2+\"*\"+q3v1+\"*\"+q3v2),\"all\")),\n string(simplify(expression(q3c1+\"*\"+q3v1+\"^2+\"+q3c2+\"*\"+q3v2+\"*\"+q3v1+\n \"^3+\"+q3c3+\"*\"+q3v2+\"*\"+q3v1+\"^4\"),\"all\"))\n ][q3idx]),\"basic\")", "description": "", "templateType": "anything", "can_override": false}, "q3v1,q3v2": {"name": "q3v1,q3v2", "group": "Ungrouped variables", "definition": "alphabet[14..16]", "description": "", "templateType": "anything", "can_override": false}, "q3ans": {"name": "q3ans", "group": "question 3", "definition": "simplify(expression([\n q3gcd1+\"*\"+q3v1+\"*(\"+q3c1/q3gcd1+\"+\"+q3c2/q3gcd1+\"*\"+q3v2+\")\" ,\n q3gcd2+\"*\"+q3v1+\"^2*(\"+q3c1/q3gcd2+\"+\"+\n q3c2/q3gcd2+\"*\"+q3v2+\"*\"+q3v1+\"+\"+\n q3c3/q3gcd2+\"*\"+q3v2+\"*\"+q3v1+\"^2)\"\n ][q3idx]),\"all\")", "description": "", "templateType": "anything", "can_override": false}, "q3idx": {"name": "q3idx", "group": "question 3", "definition": "random(0..1)", "description": "

0 is a linear factor

\n

1 is a square factor

", "templateType": "anything", "can_override": false}, "q3c1,q3c2,q3c3": {"name": "q3c1,q3c2,q3c3", "group": "Ungrouped variables", "definition": "repeat(random(-9..9 except 0),3)", "description": "", "templateType": "anything", "can_override": false}, "q3gcd1": {"name": "q3gcd1", "group": "question 3", "definition": "gcd(q3c1,q3c2)", "description": "", "templateType": "anything", "can_override": false}, "q3gcd2": {"name": "q3gcd2", "group": "question 3", "definition": "gcd(q3gcd1,q3c3)", "description": "", "templateType": "anything", "can_override": false}, "tempgcd": {"name": "tempgcd", "group": "question 3", "definition": "split(string(q3ans),\"(\")[0]", "description": "

used to get the full alphanumeric gcd out of q3ans

", "templateType": "anything", "can_override": false}, "fullgcd": {"name": "fullgcd", "group": "question 3", "definition": "expression(\n if( tempgcd[length(tempgcd)-1]=\"*\", \n tempgcd[0..length(tempgcd)-1],\n tempgcd\n )\n)", "description": "

used in the advice

", "templateType": "anything", "can_override": false}, "v1e": {"name": "v1e", "group": "Ungrouped variables", "definition": "expression(q3v1)", "description": "

used for display in the advice

", "templateType": "anything", "can_override": false}, "v2e": {"name": "v2e", "group": "Ungrouped variables", "definition": "expression(q3v2)", "description": "

used for display in the advice

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["q3v1,q3v2", "q3c1,q3c2,q3c3", "alphabet", "v1e", "v2e"], "variable_groups": [{"name": "question 3", "variables": ["q3idx", "q3gcd1", "q3gcd2", "q3expr", "q3ans", "tempgcd", "fullgcd"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": true, "customName": "Exercise 3", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Explain why $\\var{v1e}$ is a factor of $\\var{q3expr}$ but $\\var{v2e}$ is not.

\n

Factorise $\\var{q3expr}$.

", "answer": "{q3ans}", "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": "//gcd and common variable,v, outside brackets\n(`+-$n`?*$v^2`? `| -$v^2 )*(\n// terms inside must be either n+v or n+nvw+nxv^2, \n// where n is a number that may be implicit.\n (`+-$n;a + `+- $n;b;c:-1*$v`* `|\n `+-$n;a + `+- $v;b:1;c:-1 `|\n `+-$n;a + `+- $n;b*$v;v1*$v;v2 + `+- $n;c*$v*$v^2 `|\n `+-$n;a + `+- $v;v1;b:1*$v;v2 + `+- $n;c*$v*$v^2 `|\n `+-$n;a + `+- $n;b*$v;v1*$v;v2 + `+- $v;v1*$v;v2;c:1^2 `|\n `+-$n;a + `+- $v;v1;b:1*$v;v2 + `+- $v;v1*$v;v2;c:1^2\n )\n )\n// numbers within brackets must be coprime.\n`where (if(c=-1,gcd(a,b)=1,gcd(gcd(a,b),c)=1))", "partialCredit": 0, "message": "", "nameToCompare": ""}, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "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/"}]}