Playing by the Rules

This post has been motivated by a discussion that’s surfaced on Twitter in recent days of which this is a taste:

Is it wrong to have a game that doesn’t abide by the standard order of operations? Is it likely to teach children misconceptions that will need to be unpicked in maths class?

Why we have rules and conventions…

Consider the game of chess. If two people decide to play a game of chess, they both know exactly where they stand: white begins, the possible moves are clearly defined, turns alternate, the objective is clear – there really is no room for disagreement. But there are alternatives that can be played: suicide chess where you try to lose your pieces as quickly as possible (I prefer that to chess as I have a short attention span); or any of the many variants such as those listed on Wikipedia.

To me mathematics is in many ways like a board game. We have the pieces (usually set up in terms of definitions) and we have moves (the logic of deduction, theorems and the use of operators and functions etc). We need to agree on a system that is consistent within itself (as far as possible – I don’t want to get into set-based paradoxes or Gödel’s theorems).

In A level Maths and Further Maths, we teach the dot and cross product for vectors. Why do we have two different ways to multiply vectors? Why are they calculated in the way they do? Why don’t we just multiply component-wise? My usual explanation is that it is down to mathematicians to define multiplication and to do so in a way that has longevity/purpose. There is an essence of natural selection in the history of maths: some ideas just don’t have enough in them to last more than a cursory exploration. I’m curious to look back into the history of matrices sometime and see how that multiplication process developed.

Order of Operations

You might disagree, but I believe the order of operations (BIDMAS, PEMDAS, PIMDAS, and many other variations) exists so that around the globe we all interpret expressions in a consistent manner. Parentheses (and brackets and braces) are a useful marker for prioritising the evaluation of different parts of an expression. But why didn’t we all agree to “left-to-right” evaluation instead? That could still be consistent around the world if we wanted it to be. Simple four-function calculators still work that way (and, in fact, we do use that when an expression is simply say a mix of addition and subtraction). Or why not reverse Polish notation which handles operations in a manner that programmers would call a stack?

Let’s compare them by finding the perimeter of this rectangle:

• Standard Order of Operations: $2\times(3+7)$
• Left-to-right evaluation: $3+7\times 2$
• Reverse Polish: $3\,\,7\,+\,2\,\times$

Survival of the Fittest

I think it’s clear why RPN didn’t survive in the mainstream: although it’s easiest for a computer program to evaluate, it places a huge demand on the user to enter the input correctly. (As a distraction, there’s a cute discussion on Stackexchange about how to handle the quadratic formula in RPN!)

I think the reason the ‘standard order’ generally wins out over left-to-right evaluation is the flexibility it allows, without introducing ambiguity. Following the standard order, commutativity of operations can be used fully:

$2\times(3+7) = 2\times(7+3) = (7+3)\times 2 = (3+7)\times 2$

whereas in left-to-right evaluation, only these two would evaluate the perimeter correctly:

$3+7\times 2 = 7+3\times 2$

and once parentheses are introduced to LTR evaluation, it just feels like a restricted version of the standard order.

Right or Wrong?

No, just different. Of course, however, young children could receive mixed messages. Are these best handled by only exposing them to the standard order of operations, or  is it better to open up the discussion a little and see why we have the standard order?

I’ll leave all the die-hard BIDMAS fans with this ‘brain training’ from the Daily Mail:

“Multiply by itself twice”… is that $x\times x \times x$ or $(x^2)^2$? 🙂