// Numbas version: exam_results_page_options {"name": "1.3.4. Task: Factorise 2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "1.3.4. Task: Factorise 2", "tags": [], "metadata": {"description": "

Factorise two algebraic terms that have a numerical gcd > 1. Part of HELM book 1.3

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

Factorise $\\var{q1expr}$

", "advice": "

The terms share a f=common factor of $\\var{q1gcd}$ which can be factored out.

\n

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

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"q1expr": {"name": "q1expr", "group": "question part b", "definition": "simplify(expression(q1c[2]*q1c[0] + q1v[0] + \"+\" + q1c[2]*q1c[1] + q1v[1]),[\"basic\"])", "description": "", "templateType": "anything", "can_override": false}, "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}, "q1c": {"name": "q1c", "group": "question part b", "definition": "[random(-9..9 except 0), random(-9..9 except 0), random(2..5)]", "description": "", "templateType": "anything", "can_override": false}, "q1v": {"name": "q1v", "group": "question part b", "definition": "alphabet[0..2]", "description": "", "templateType": "anything", "can_override": false}, "q1ans": {"name": "q1ans", "group": "question part b", "definition": "simplify(expression(\n q1gcd + \"*\" + \"(\" + q1c[0]*q1c[2]/q1gcd + q1v[0] + \"+\" + q1c[1]*q1c[2]/q1gcd + q1v[1] + \")\" ),[\"basic\",\"unitFactor\"])", "description": "", "templateType": "anything", "can_override": false}, "q1gcd": {"name": "q1gcd", "group": "question part b", "definition": "if( (q1c[0] < 0 & q1c[1] < 0),\n-1*gcd(q1c[0],q1c[1])*q1c[2],\ngcd(q1c[0],q1c[1])*q1c[2]\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["alphabet"], "variable_groups": [{"name": "question part b", "variables": ["q1c", "q1v", "q1gcd", "q1expr", "q1ans"]}], "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, "stepsPenalty": 0, "steps": [{"type": "numberentry", "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": "

Find the factor common to $\\var{q1c[2]*q1c[0]}$ and $\\var{q1c[1]*q1c[2]}$

", "minValue": "q1c[2]", "maxValue": "q1c[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Now factorise $\\var{q1expr}$

\n

Check your answer by removing the brackets again.

"}], "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, "musthave": {"strings": ["(", ")"], "showStrings": false, "partialCredit": 0, "message": ""}, "mustmatchpattern": {"pattern": "// a number times...\n(`+-$n)`? * \n(\n // either a number 'a' times x,\n // or x on its own, and 'a' is implicitly 1\n `+-($n;a * $v `| $v;a:1) \n \n + `+-\n \n // either a number 'b' times x,\n // or x on its own, and 'b' is implicitly 1\n ($n;b * $v `| $v;b:1)\n)\n\n// a and b must be coprime\n`where\n\n(gcd(a,b)=1)", "partialCredit": 0, "message": "You have not fully factorised the expression.", "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/"}]}