// Numbas version: exam_results_page_options {"name": "1.3.3.4 Expand (x+a)(x+b)(x+c)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "1.3.3.4 Expand (x+a)(x+b)(x+c)", "tags": [], "metadata": {"description": "
Expand (x+a)(x+b)(x+c), where x is a randomised variable, and a,b,c are randomised integers.
\nNote that the pattern restriction in the marking checks that there are no brackets and that the expression is simplified to at most a single x^3, x^2, x and constant term; but it will let you get away with an additional -x^2 and/or -x term. (e.g., you could write 3x as 4x -x and the marking would accept this. This was to stop the pattern matching getting too complicated.
\nPart of HELM Book 1.3
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "Practise these questions repeatedly until you are very confident at removing brackets.
", "advice": "\\[\\begin{align*} \\var{expression(q3expr)} &= \\left[( \\var{t[0]} )(\\var{t[1]})\\right]\\times(\\var{t[2]})\\\\ &=(\\var{te[0]})\\times(\\var{t[2]})\\\\ &= \\var{te[1]}\\\\ &=(\\var{te[2]})+(\\var{te[3]})\\\\&=\\var{q3ans} \\end{align*}\\]
", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"q3expr": {"name": "q3expr", "group": "question 3", "definition": "\"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")(\" \n + q3v + q3signs[2] + q3c[2] + \")\"", "description": "", "templateType": "anything", "can_override": false}, "q3ans": {"name": "q3ans", "group": "question 3", "definition": "simplify(expression(q3expr),[\"all\",\"expandBrackets\"])", "description": "", "templateType": "anything", "can_override": false}, "alphabet": {"name": "alphabet", "group": "Ungrouped variables", "definition": "['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}, "q3v": {"name": "q3v", "group": "question 3", "definition": "random(alphabet)", "description": "", "templateType": "anything", "can_override": false}, "q3c": {"name": "q3c", "group": "question 3", "definition": "repeat(random(1..9),3)", "description": "", "templateType": "anything", "can_override": false}, "q3signs": {"name": "q3signs", "group": "question 3", "definition": "repeat(random(\"+\",\"-\"),3)", "description": "", "templateType": "anything", "can_override": false}, "ve": {"name": "ve", "group": "question 3", "definition": "expression(q3v)", "description": "for display in the advice
", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "question 3", "definition": "[expression(q3v + q3signs[0] + q3c[0]),\n expression(q3v + q3signs[1] + q3c[1]),\n expression(q3v + q3signs[2] + q3c[2]),\n]", "description": "The terms, for display in the advice.
", "templateType": "anything", "can_override": false}, "te": {"name": "te", "group": "question 3", "definition": "[\nsimplify(expression(\"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")\"),\"expandBrackets,all\"),\nexpression( \n \"(\"+string(simplify(expression(\n \"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")\"\n ),\"expandBrackets,all\"))+\n \")*\"+q3v+\"+(\"+ string(simplify(expression(\n \"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")\"\n ),\"expandBrackets,all\"))+\n \")*\"+string(simplify(expression(\"(\"+q3signs[2] + q3c[2]+\")\"),\"all\"))\n ),\nsimplify(expression( \n \"(\"+string(simplify(expression(\n \"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")\"\n ),\"expandBrackets,all\"))+\n \")*\"+q3v\n ),[\"expandBrackets\",\"basic\",\"unitFactor\",\"unitPower\",\"zeroFactor\",\n \"zeroTerm\",\"zeroPower\",\"collectNumbers\",\"constantsFirst\",\n \"cancelFactors\"]),\nsimplify(expression(\n \"(\"+ string(simplify(expression(\n \"(\" + q3v + q3signs[0] + q3c[0] + \")(\" \n + q3v + q3signs[1] + q3c[1] + \")\"\n ),\"expandBrackets,all\"))+\n \")*\"+string(simplify(expression(\"(\"+q3signs[2] + q3c[2]+\")\"),\"all\")) \n ),[\"expandBrackets\",\"basic\",\"unitFactor\",\"unitPower\",\"zeroFactor\",\n \"zeroTerm\",\"zeroPower\",\"collectNumbers\",\"constantsFirst\",\n \"cancelFactors\"]) \n]", "description": "The terms, getting expanded, for display in the advice.
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["alphabet"], "variable_groups": [{"name": "question 3", "variables": ["q3v", "q3c", "q3expr", "q3ans", "q3signs", "ve", "t", "te"]}], "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": "Remove the brackets from $\\var{q3expr}$ and simplify.
", "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": "`! m_anywhere(?*(? + ?`+))\n`& (\n$v^3+(`+-$n`?*$v^2)`?+\n(`+-$n`?*$v)`?+(`+-$n)`?\n -($v^2)`?-($v)`?\n)", "partialCredit": 0, "message": "You need to fully factorise 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/"}]}