Wednesday, January 7, 2026

Understanding PEMDAS and Order of Operations in Math

 The number of posts I see about equations that could have multiple results depending on how you parse the equation is too high.  People making those posts are likely happy about annoying other people.  But there is a correct way to parse equations.  And it's usually remembered with the acronym PEMDAS, or one like it (I think there's a version like BOMDAS or something).

  • P = Parentheses: Anything INSIDE of parentheses is done first
  • E = Exponents: You have to handle exponents next
  • MD = Multiplication AND Division:  Note that these are the SAME priority level.  So, when there are several operations that are multiplication or division, you do them left to right regardless of whether it is multiplication or division.
  • AS = Addition AND Subtraction:  Like multiplication and division, addition and subtraction are the same priority as each other, and you apply the left to right rule when there are more than one of this level of priority.

So, the equation...

7 x (4 + 5 x 2) = 98

7 x (4 + 10)

7 x 14

98


There are two other things I want to mention.  It is legitimate to write an equation with multiplication like...

7(3 + 2) 

That notation is shorthand for...

7 x (3 + 2)

When the number is right up against the parenthesis like that, it just indicates multiplication, and so when you apply PEMDAS, the stuff inside the parentheses happens first, and the multiplication happens after that.

The second important thing to mention is fractions.  That bar drawn with the fraction is a final separator.  The numerator is one term, and the denominator is one term, each to be sorted out before the fractional division is done.  It's like putting parentheses around the numerator and parentheses around the denominator.

3 + 4 / 3 x 7 is not the same as (3 + 4) / (3 x 7)

The first works out to 12.33 repeating (twelve and one-third) while the second works out to 0.33 repeating (one-third).  Writing on these single lines doesn't lend itself well to fractions.

Hopefully that was helpful in understanding order of operations.  As a point of reference for you, I am a software engineer of nearly 30 years.  What I described above (aside from fractions which aren't directly represented in code normally) is how computers do the math and order of operations.