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

Two BODMAS questions. Part of HELM Book 1.1.

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

4 Arithmetical expressions

\n\n

A quantity made up of numbers and one or more of the operations \\(+, -, \\times\\) and \\(/\\) is called an arithmetical expression . Frequent use is also made of brackets, or parentheses , \\((\\quad)\\) , to separate different parts of an expression. When evaluating an expression it is conventional to evaluate quantities within brackets first. Often a division line implies bracketed quantities. For example in the expression \\(\\frac{3+4}{7+9}\\) there is implied bracketing of the numerator and denominator i.e. the expression is \\(\\frac{(3+4)}{(7+9)}\\) and the bracketed quantities would be evaluated first resulting in the number \\(\\frac{7}{16}\\) .

\n\n

4.1 The BODMAS rule

\n\n

When several arithmetical operations are combined in one expression we need to know in which order to perform the calculation. This order is found by applying rules known as precedence rules which specify which operation has priority. The convention is that bracketed expressions are evaluated first. Any multiplications and divisions are then performed, and finally any additions and subtractions. For short, this is called the BODMAS rule.

\n
\n
Key Point 4
\n

The BODMAS rule

\n
\n\n
\n
\n\n

If an expression contains only multiplication and division we evaluate by working from left to right. Similarly, if an expression contains only addition and subtraction we evaluate by working from left to right. In Section 1.2 we will meet another operation called exponentiation, or raising to a power. We shall see that, in the simplest case, this operation is repeated multiplication and it is usually carried out once any brackets have been evaluated.

\n\n
Example 4
\n\n

Evaluate \\(4-3+7\\times 2\\)

\n\n
Solution
\n\n

The BODMAS rule tells us to perform the multiplication before the addition and subtraction. Thus

\n\n

\\(4-3+7\\times 2=4-3+14\\)

\n\n

Finally, because the resulting expression contains just addition and subtraction we work from the left to the right, that is

\n\n

\\(4-3+14=1+14=15\\)

", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(3..12)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..a-1)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(2..12)", "description": "", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(1..20)", "description": "", "templateType": "anything", "can_override": false}, "g": {"name": "g", "group": "Ungrouped variables", "definition": "random(-15..15 except [0, f])", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "random(1..20)", "description": "", "templateType": "anything", "can_override": false}, "k": {"name": "k", "group": "Ungrouped variables", "definition": "random(-15..15 except [0,h])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "f", "g", "h", "k"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "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": "

Evaluate \\(\\var{a}-\\var{b}\\times\\var{c}\\)

\n

\\(\\var{a}-\\var{b}\\times\\var{c}=\\)[[0]]

\n

Evaluate \\((\\var{a}-\\var{b})\\times\\var{c}\\)

\n

\\((\\var{a}-\\var{b})\\times\\var{c}=\\)[[1]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "No brackets", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "a-b*c", "maxValue": "a-b*c", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Brackets", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "(a-b)*c", "maxValue": "(a-b)*c", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "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": "
Example 5
\n\n

Evaluate \\(8\\div 2-(4-5)\\)

\n\n
Solution
\n\n

The bracketed expression is evaluated first:

\n\n

\\(8\\div 2-(4-5)=8\\div 2-(-1)\\)

\n

\n\n

Division has higher priority than subtraction and so this is carried out next giving

\n\n

\\(8\\div 2-(-1)=4-(-1)\\)

\n\n

Subtracting a negative number is equivalent to adding a positive number. Thus

\n\n

\\(4-(-1)=4+1=5\\)

\n

Evaluate \\(\\displaystyle{\\frac{\\simplify[!collectNumbers]{{f}-{g}}}{\\simplify[!collectNumbers]{{h}-{k}}}}\\)

\n

(Remember that the dividing line implies that brackets are present around the numerator and around the denominator.)

\n

\\(\\displaystyle{\\frac{\\simplify[!collectNumbers]{{f}-{g}}}{\\simplify[!collectNumbers]{{h}-{k}}}}=\\)[[0]] (give your answer as a fraction)

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Answer", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "(f-g)/(h-k)", "maxValue": "(f-g)/(h-k)", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}