// Numbas version: exam_results_page_options {"name": "Control how expressions are simplified", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Control how expressions are simplified", "tags": [], "metadata": {"description": "The statement of this question demonstrates how you can control the \\simplify command's behaviour by specifying the rules to use.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

We want to show the addition of two numbers, $a = \\var{a}$ and $b = \\var{b}$.

\n

By default, the collectNumbers rule is applied, so both sides of this equation end up the same.

\n

$\\simplify{{a} + {b} = {a+b}}$

\n

By only using the basic rules, the two numbers on the left-hand side aren't collected together:

\n

$\\simplify[basic]{{a} + {b} = {a+b}}$

\n

\n

In this more complicated example, we want to show a coefficient of zero, which would normally be removed, by turning off the zeroFactor rule, but still applying the other rules.

\n

On the left-hand side of the equation, only the basic rules are applied.

\n

$\\simplify[basic]{ y + 1y -x + 3x - 2x } = \\simplify[all,!zeroFactor]{ y + 1y -x + 3x - 2x }$

", "advice": "", "rulesets": {}, "extensions": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5 .. 5#1)", "description": "", "templateType": "randrange"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5 .. 5#1)", "description": "", "templateType": "randrange"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [], "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/"}]}