Mathematician: Now that the Physicist and I have answered questions like these ones at least 9 times via email, I figure we should get this horrible topic out of the way once and for all with a short post.
The “order of operations” tells us the sequence in which we should carry out mathematical operations. It is merely a matter of convention (not a matter of right or wrong), giving us a standardized way to decide whether 6/2*3 is (6/2)*3 or 6/(2*3). The convention has been accepted just so that when different people see an equation they can agree on its meaning, even if they hate each other’s guts. You could come up with a different convention, but why bother? Let other people waste their time coming up with arbitrary conventions so that you can merely waste time reading posts about them.
The rules to follow are:
1. Things in parenthesis get computed before things not in parenthesis (this is because of the (little known fact) that parentheses kick ass).
2. Then, exponents get dealt with (including roots). Hence a^b*c = (a^b)*c.
3. Next, multiplication and division get carried out from left to right. So a*b/c*d is ((a*b)/c)*d. Note that division can be thought of as still carrying out a multiplication since a/b = a*(1/b), so it makes a certain sense that neither division nor multiplication takes precedence over one another.
4. Finally, additions and subtractions get carried out from left to right. Subtraction can be thought of as being like addition since a – b = a + (-b) so it makes sense that subtraction is treated on an equal footing with addition.
People sometimes use the expressions PEMDAS, “Please Excuse My Dear Aunt Sally” or “Puke Exhaust Mud Dolls Autumn Sasquatch” to remember these rules. These all stand for “Parenthesis, Exponents, Multiplication and Division, Addition and Subtraction”. It is easy to get confused by these mnemonics though because they don’t capture the fact that multiplication is treated the same way
as division (carried out left to right), and addition is treated the same way as subtraction (carried out left to right). That’s why I prefer: “Puke Exhaust Mud And Dolls Autumn And Sasquatch”
One interesting thing to note about the order of operations is that there is nothing interesting about them whatsoever. But that implies there is something interesting about them. This is a contradiction, and hence the order of operations form a paradox. They are also about as fun as getting to watch a fish crawl up the stairs as a reward for answering math questions.
But, that won’t stop me from giving an example. Consider:
Without a convention, it has many possible interpretations, such as
which could be horribly confusing for people trying to communicate with each other. But, the correct interpretation according to the rules mentioned above, is:
When in doubt about what the orders of operation are for an expression, there is a simple solution which works even better than tattooing PEMDAS to your face. Just paste the expression into the google search bar and hit “search”. For instance, if I paste in:
Not only is this the correct answer, but it shows you explicitely the order of operations that were used, so it’s useful for learning.
Google even gets this one right:
4^2*3/6 + 1 – 5/14*3 + 6/10 – 4*2/14*6^3/18 + 14
which is the kind of question little sisters give you when they are old enough to finally sort of get what a mathematician is.
It’s important to note that not all calculators handle the order of operations in the standard way. Why? Because people who make calculators hate children. The preceding sentence was not intended to be a factual statement .
Also, a lot of programming languages use the standard order of operation rules, but then you have exceptions like Smalltalk.
Oh, and in case you were wondering: