Analysis: when we do mathematical calculations, the order in which we add, subtract, multiply and divide makes a real difference

If you use social media, you may well have seen one of those viral maths puzzles. You're asked to figure out something like "8÷2(2+2)", and a fight breaks out in the comments about if the the answer is 1 or 16. We're used to mathematics being very certain, so why does this happen?

When we do calculations, the order that we do things like addition, subtraction, multiplication and division makes a difference. For example, if you take 1 and add it to 2 and then multiply by 3, you will get 9. However, if you add 1 to what you get when you multiply 2 by 3, you get 7. When we write this mathematically, we could write the first as (1+2)×3 and the second as 1+(2×3), and the rule is that things inside brackets must be figured out first.

From RTÉ Brainstorm, have Leaving Cert maths questions got harder or easier?

Whenever we have a sum to do, we could write out all the brackets to show the order that calculations are supposed to happen in. However, by convention, we have some rules that help save on ink. You may have learned in school that "multiplication happens before addition". This means that if someone writes 1+2×3, we assume that they learned the same rule in school, and we should do the 2×3 before adding 1 to get 7. Of course, if they learned maths somewhere else in the world, we might want to check what they meant, or get them to put in the brackets.

A more comprehensive version of the "multiplication before addition" rule is BOMDAS or BODMAS. These remind us that when doing a calculation, we have chosen to do things in the order: Brackets first, then of/multiplication/division and finally addition/subtraction. Here, "of" is another way to say multiply; three boxes of six eggs is 3×6 eggs. Sometimes this is extended to BIMDAS, where the "I" is for indices, like in 3² = 3×3 = 9. The 2 is called the index and, by convention, these happen before division or multiplication.

From RTÉ Radio 1's Today With Claire Byrne, is it socially acceptable to be bad at maths?

It turns out that the BIMDAS rules are very good for writing pieces of mathematics in shorthand and removes the ambiguity from many calculations without the need for brackets. However, it does not remove all the ambiguity. To take a simple example, have a look at 4 ÷ 2 × 2. If you do this using BOMDAS you will get 1, but if you do this using BODMAS you will get get 4. Really, in these rules, the multiplication and division are supposed to be grouped to be done at the same time, and brackets should be added to clarify the order if there is any potential uncertainty.

In fact, if you studied mathematics past primary school, you may have noticed that as you move on the division symbol, "÷", gets used less and less, while fractions get used more and more. This is partially because fractions have implied brackets - you must figure out the top and bottom separately, before dividing. The line in the fraction visually shows where the top and the bottom of the fraction begin and end, without needing an explicit bracket. Other mathematical symbols, like the square root symbol, do the same. If you keep going and study mathematics at university, abstract algebra partially considers when we need brackets for ideas that are more messy than normal numbers!

From RTÉ Archives, 1971 episode of Newsbeats poses quizzes people on the street with some maths puzzles

It is worth noting that this type of ambiguity appears in other parts of our daily life, but context often helps us understand what the intended meaning was. For example, consider a `man eating tiger'. If you go to the zoo and see a man eating tiger, then you have probably seen a tiger that would eat a man if it was given a chance. However, if you are at a dinner for eccentric billionaires who hunt and cook endangered animals, then you could ask the man eating tiger if his tiger fillet was tasty. This type of ambiguity often gives the opportunity for jokes in English, but we are not used to vagueness in mathematics. In the same way that we can add brackets to clarify mathematics, punctuation and rewording can help clarify English sentences that might be misunderstood.

When it is important that we do things in the right order, we usually give step-by-step instructions. We're familiar with this from cooking recipes or putting together flat-pack furniture. Computers have a similar problem - when computers are given arithmetic to do, it is important that they know what order to do it in. A programming language will usually have rules like BOMDAS to make sure there will only be one answer.