Monday, 8 September 2025

Why * and / parts of a sum must be done before + and - AKA: Not all calculators follow the rules and you can't just go left to right

An easy explanation why * and / come before + and -


Here is a story  :

I went to the doctor and he says 

“That’s a bad case of mathology I want you to take three blue pills, four red pills and one yellow pill.”

"Wow that’s a lot of pills" I replied. "Must be a serious condition." 

“Let me add that up  3 * Blue + 4 * red + 1 * yellow = eight pills to take.”

Next week I go to the doctor and he says :

“Things are looking better and I want you to take the same but zero yellow pills.”


Try this on your calculator .......


    3 * Blue + 4 * red + yellow * 0  is the sum ....... 


    3 * 1       + 4 * 1   +  1 * 0  =  ?


 Some older calculators says I don’t have to take any pills now ...... but is that what the what the doctor ment ?


Math rules say that all the multiplications must be done before you start doing any of the additions when you have a mixed sum.


    3 * 1   + 4 * 1  + 1 * 0 

after the multiplication parts are done this becomes :

   3 + 4 + 0 = 7 pills.

Which is what the doctor intended. In a longer multi part sum the order in which the sub-sums are done is vitally important.  * and / parts of a sum must be done before + and -   Other rules are available Google BODMAS  or see image below.


An easy to follow proof of why  * and / must be done before + and -

Q : How many soccer players are there on the pitch ?

A: 11 and let's break that down .... Here is a picture of a typical team but there is also a referee and team mascot that are on the pitch but don't count as team members.


Adding up the people on the pitch goes as :
    1 Keeper - grey
    4 Backs - blue
    2 Half Backs - yellow
    2 Wingers - red
    2 Forwards - also red
    1 Referee
    1 Banana based team mascot.

We said that the Referee and the mascot don't count so lets set those to 0 giving 
    1 Keeper
    4 Backs
    2 Half Backs
    2 Wingers
    2 Forwards
    0 Referee
    0 Banana based team mascot.

Turning that into a long multi-line sum as each person counts as 1 * the number we have of them.

 1 * 1 {Keeper} + 
 1 * 4 {Backs } + 
 1 * 2 {Half Backs} + 
 1 * 2 {Wingers} + 
 1 * 2 {Forwards} +
 1 * 0 {Referees}  + 
 1 * 0 {Mascots}        =   total number of players.

taking out the {words} gives us this sum ...

    1 * 1 + 1 * 4 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 0 + 1 * 0   = 11 because we already know the answer,

One of a thing is the thing, so we can work out the 1 * parts of the sum to get ....

           1 +      4  +      2 +       2  +     2  +        0 +      0    = 11  that must equal 11 and it does.

If the sum is done on an old style calculator that accumulates a partial result as it goes along, when the last bit of  + 1 * 0 is entered, the running total becomes 0 which ruins the whole calculation. If the sum is worked out strictly left to right it also fails on {total so far } + 1 * 0 

The second line of the calculation above gives the correct total 11 because all the * have been done first before and + sub-sums.

To prove this method is correct if the team came out in reverse order there would be the same number of folks on the pitch and the sums would be .....

{Referees} * 0  + {Mascots} * 0 + {Forwards} * 2  + {Wingers} * 2 + { Half Backs} * 2  + { Backs } * 4 + {Keeper} * 1 

that's
    1 * 0 + 1 * 0 + 1 * 2 + 1 * 2 + 1 * 2 + 1 * 4 + 1 * 1   = 11   which must equal 11 and it does ...
          0 +       0 +       2 +       2 +       2 +       4 +       1   = 11

Both these lines also happen to give the correct answer on an old style calculator because the 1 * 0 parts are at the start. The old school calculator and "work out left to right" folks must be wrong in method because the same information (players)  gives a different answer when presented in a different order.

A modern calculator app, that shows the sum before calculation, gives the correct answer all ways round. 

  



In general terms, given a long sum the calculation must be performed according to the rules of what parts to do first. 
    Brackets. <<<< some times used to change the order of the parts.
    "of" <<<<<< not used much
    multiplications and divisions <<<<<   after all these parts are done go onto
    additions and subtractions.


Old style calculators

Try these "half plus one" on your calculator : 

1 + 1 / 2
                  and then 
1 / 2 + 1

If you get the answer 1 for the first line then your calculator is breaking the math rules and you will need to adjust the calculation order to get the right answer. This is why folks using a calculator sometimes get the wrong answer. "I used a calculator." does not make the answer correct unless you load the calculations according to what parts have to be done first.

We used to write calculation differently that made this more obvious:

     1
1 +   -
       2  

must give the same answer as  : 

1    
 -   + 1
  2

being 1.5 because 0.5 + 1 is the same as 1 + 0.5. The correct result is only found by doing the / before the + what ever order they appear in the sum.

The answer the "incorrect" calculator is giving is for this sum where the divider line extends across both parts.

1  + 1 
______
  2

which is not the answer we are after.





No comments: