// Numbas version: exam_results_page_options {"name": "Distributive law: expanding brackets general", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Distributive law: expanding brackets general", "tags": [], "metadata": {"description": "

Basic Algebra question, expand one set of brackets, coefficients may be positive or negative, pronumerals randomised.

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

The number in front of the bracket is multiplying the bracketed term, that is, each term in the brackets.

\n

\n

$\\simplify{{pmult}({pxcoeff}{var1}+{pconstant}{var2})}$ means $\\var{pmult}\\times (\\simplify{{pxcoeff}{var1}+{pconstant}{var2}})$ which means $\\simplify[!collectNumbers]{{pmult}*{pxcoeff}{var1}+{pmult}}\\times \\var{pconstant}\\var{var2}$, and so expanding $\\simplify{{pmult}({pxcoeff}{var1}+{pconstant}{var2})}$ gives $\\simplify{{pmult}*{pxcoeff}{var1}+{pmult}*{pconstant}{var2}}$.

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"pmult": {"name": "pmult", "group": "part a", "definition": "random(2..11)*random(-1,1)", "description": "

Distributive law: expanding brackets general, may be positive or negative

", "templateType": "anything", "can_override": false}, "pxcoeff": {"name": "pxcoeff", "group": "part a", "definition": "random(1..10)", "description": "

Coefficient of first variable inside bracket, always positive

", "templateType": "anything", "can_override": false}, "pconstant": {"name": "pconstant", "group": "part a", "definition": "random(1..10)*random(-1,1)", "description": "

coefficient of second variable inside bracket, may be positive or negative

", "templateType": "anything", "can_override": false}, "pronumerals": {"name": "pronumerals", "group": "part a", "definition": "shuffle([\"a\",\"b\",\"t\",\"x\",\"y\",\"\"])[0..2]", "description": "

Selects two variable names at random from the list. Note that \"\" returns an empty variable ie a constant.

", "templateType": "anything", "can_override": false}, "var1": {"name": "var1", "group": "part a", "definition": "expression(pronumerals[0])", "description": "

Converts the list item 0 in pronumerals to an expression so that it will be correctly treated in LaTeX

", "templateType": "anything", "can_override": false}, "var2": {"name": "var2", "group": "part a", "definition": "expression(pronumerals[1])", "description": "

Converts the list item 1 in pronumerals to an expression so that it will be correctly treated in LaTeX

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "part a", "variables": ["pmult", "pxcoeff", "pconstant", "pronumerals", "var1", "var2"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": true, "customName": "Distributative Rule", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The expression $\\simplify{{pmult}({pxcoeff}{var1}+{pconstant}{var2})}$ is factorised (written as a product). We can expand the expression (so it is written as a sum) to get 

\n

", "stepsPenalty": "1", "steps": [{"type": "information", "useCustomName": true, "customName": "Hint", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The number in front of the bracket is multiplying the bracketed term, that is, each term in the brackets.

\n

$\\simplify{{pmult}({pxcoeff}{var1}+{pconstant}{var2})}$ means $\\var{pmult}\\times (\\simplify{{pxcoeff}{var1}+{pconstant}{var2}})$ which means $\\simplify[!collectNumbers]{{pmult}*{pxcoeff}{var1}+{pmult}}\\times \\var{pconstant}\\var{var2}$.

"}], "answer": "{pmult}*{pxcoeff}{var1}+{pmult}*{pconstant}{var2}", "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": "`! m_anywhere(?*(? + ?`+))", "partialCredit": 0, "message": "You have not expanded the brackets. See the Show Steps section for further information.", "nameToCompare": ""}, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Shatha Aziz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/12378/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Shatha Aziz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/12378/"}]}