Order of Operations

What Is the “Order of Operations”?

The order of operations is a set of rules that tells us in which order to perform the different operations in a math expression.

One acronym often used to capture this order of operations is PEMDAS.

  • Parentheses – ()\hspace{0.2em} () \hspace{0.2em} or other grouping symbols,
  • Exponents – powers and roots,
  • Multiplication and Division (from left to right), and
  • Addition and Subtraction (from left to right).

Note – As you can see, multiplication and division occupy the same level of hierarchy (#3). One does NOT have precedence over the other. So between them, we solve from left to right, whichever comes first.

The same is true for the pair – addition and subtraction (#4).

As a quick example, here's how we would simplify the expression, 11+(97)×3\hspace{0.2em} 11 + (9 - 7) \times 3 \hspace{0.2em}, using the order of operations.

Steps Comments
11+(97)×3\hspace{1.25em} 11 + {\color{Red} (9 - 7)} \times 3 \hspace{0.25em}

Parentheses before all else

=11+2×3= \hspace{0.2em} 11 + {\color{Red} 2} \hspace{0.2em} {\color{Teal} \times \hspace{0.2em} 3} \hspace{0.25em}

Multiplication before addition

=11+6= \hspace{0.2em} 11 + {\color{Teal} 6} \hspace{0.25em}

Last remaining operation

=17= \hspace{0.2em} 17 \hspace{0.25em}

Answer

We have a number of examples following sections to help you understand everything. So if something doesn't make sense, bear with me please.

PEMDAS / BODMAS / GEMDAS...?

Depending on where you live and what curriculum you follow, you might be taught BODMAS, GEMDAS, or something else instead of PEMDAS.

The important thing to remember is that they are all different ways to say the same thing. The order in which you perform operations remains the same, no matter what acronym you have.

Here’s an illustration to help explain my point.

Why We Need the Order of Operations

A single math expression can include several different operations – addition, subtraction, multiplication, division, and exponentiation. And depending on the sequence or order in which you solve these operations you may get very different values for the same expression.

As an example consider this. Here are two ways in we can solve the following expression if we didn't have any "order of operations" to guide us.

Division before subtraction

108÷2=104=6\begin{align*} & 10 - {\color{Red} 8 \div 2} \\[1em] = \, \, & 10 - {\color{Red} 4} \\[1em] = \, \, & 6 \end{align*}

Subtraction before division

108÷2=2÷2=1\begin{align*} & {\color{Red} 10 - 8} \div 2 \\[1em] = \, \, & {\color{Red} 2} \div 2 \\[1em] = \, \, & 1 \end{align*}

See how we get different values for the exact same expression? And that's with only two operations. As the number of operations increase, things would get way worse.

We do not want such unnecessary ambiguity in math or science. And order of operations helps us avoid this mess and gives a unique value to each expression by fixing the sequence that must be followed when simplifying it.

Order of Operations – Examples

Example

Simplify : 16÷(73)\hspace{0.2em} 16 \div (7 - 3) \hspace{0.2em}

Solution

To simplify an expression with more than one operation, go over PEMDAS (or BODMAS, or whatever acronym you use) in your head, look for operations in that order and solve them – one by one.

So what is the first thing on the list? Parentheses, right?

Do we have parentheses in our expression here? Yes. So, let’s work on that first.

16÷(73)=16÷416 \div {\color{Red} (7 - 3)} \hspace{0.2em} = \hspace{0.2em} 16 \div {\color{Red} 4}

Alright, now we have only division left to do. So we do that.

16÷4=416 \div 4 \hspace{0.2em} = \hspace{0.2em} 4

And that’s our answer.

Example

Simplify : 2×32+2\hspace{0.2em} 2 \times 3^2 + 2 \hspace{0.2em}

Solution

Again, we start with the operation with the highest priority and work our way down.

So, P – do we have parentheses? No.

The next on the list is E – exponents? We do have exponents. So that’s what we’ll start with.

2×32+2=2×9+22 \times {\color{Red} 3^2} + 2 \hspace{0.2em} = \hspace{0.2em} 2 \times {\color{Red} 9} + 2

After E, we have MD – multiplication and division (same priority). We don’t have division but we have multiplication. So –

2×9+2=18+2 {\color{Red} 2 \times 9} + 2 \hspace{0.2em} = \hspace{0.2em} {\color{Red} 18} + 2

And now we can do the addition and get the answer.

18+2=2018 + 2 \hspace{0.2em} = \hspace{0.2em} 20

Done.

Example

Simplify : 512÷2×5\hspace{0.2em} 5 - 12 \div 2 \times 5 \hspace{0.2em}

Solution

Here, we don’t have parentheses (P) and we don’t exponents (E). So we move on to multiplication/division (MD).

Now, remember, multiplication and division have the same priority. So we go from left to right, and whatever comes first, gets solved.

So –

512÷2×5=56×5=530\begin{align*} 5 - {\color{Red} 12 \div 2} \times 5 \hspace{0.2em} &= \hspace{0.2em} 5 - {\color{Red} 6} {\color{Teal} \hspace{0.2em} \times \hspace{0.2em} 5} \\[1em] &= \hspace{0.2em} 5 - {\color{Teal} 30} \end{align*}

Just one more step.

530=255 - 30 \hspace{0.2em} = \hspace{0.2em} -25

And that’s our answer.

Example

Simplify : (78÷2)1+923\hspace{0.2em} (7 - 8 \div 2) - 1 + 9 - 2^3 \hspace{0.2em}

Solution

Alright, we are leveling up now.

Here, as usual, we start with the part within the parentheses.

But this time, we have more than one operation inside the parentheses as well. That means we’ll need to use PEMDAS for that too – division before subtraction.

(78÷2)1+923=(74)1+923=31+923\begin{align*} &(7 - {\color{Red} 8 \div 2} ) - 1 + 9 - 2^3 \\[1em] = \hspace{0.4em} &( {\color{Teal} 7 \hspace{0.2em}- \hspace{0.2em}} {\color{Red} 4} ) - 1 + 9 - 2^3 \\[1em] = \hspace{0.4em} & {\color{Teal} 3} - 1 + 9 - 2^3 \end{align*}

With parentheses out of the way, it’s time for the exponent.

31+923=31+983 - 1 + 9 - {\color{Red} 2^3} \hspace{0.2em} = \hspace{0.2em} 3 - 1 + 9 - 8

Finally, we have a few additional and subtraction operations. They enjoy the same priority, so we go from left to right.

31+98=2+98=118=3\begin{align*} {\color{Red} 3 - 1} + 9 - 8 \hspace{0.2em} &= \hspace{0.2em} {\color{Red} 2} {\color{Teal} \hspace{0.2em} + \hspace{0.2em} 9} - 8 \\[1em] &= \hspace{0.2em} {\color{Teal} 11} - 8 \\[1em] &= \hspace{0.2em} 3 \end{align*}

That’s it.

Parentheses Within Parentheses

If an expression contains parentheses within parentheses, we start with the innermost parentheses and work our way outwards.

Example

Simplify : ((1614÷2)2+32)÷8\hspace{0.2em} ((16 - 14 \div 2) - 2 + 3^2) \div 8 \hspace{0.2em}

Solution

Here we have one pair of parentheses inside another. So, we’ll take care of the inner pair first. Think about it. To evaluate outer parentheses, we have to evaluate parentheses contained within it first?

((1614÷2)2+32)÷8=((167)2+32)÷8=(92+32)÷8\begin{align*} &( {\color{Teal} (} 16 - {\color{Red} 14 \div 2} {\color{Teal} )} - 2 + 3^2) \div 8 \\[1em] = \, \, &( {\color{Teal} (} {\color{Teal} 16 \hspace{0.2em} - \hspace{0.2em} } {\color{Red} 7} {\color{Teal} )} - 2 + 3^2) \div 8 \\[1em] = \, \, &( {\color{Teal} 9} - 2 + 3^2) \div 8 \end{align*}

And from here it’s no different from the examples we solved earlier.

(92+32)÷8=(92+9)÷8=(7+9)÷8=16÷8=2\begin{align*} &(9 - 2 + {\color{Red} 3^2} ) \div 8 \\[1em] = \, \, &( {\color{Teal} 9 - 2} + {\color{Red} 9} ) \div 8 \\[1em] = \, \, &( {\color{Teal} 7} {\color{Red} \hspace{0.2em}+\hspace{0.2em}9} ) \div 8 \\[1em] = \, \, & {\color{Red} 16} \div 8 \\[1em] = \, \, &2 \end{align*}

If an expression contains exponents on exponents, we start at the top and work our way down.

Exponents over Exponents

Example

Simplify : 223\hspace{0.2em} 2^{2^3} \hspace{0.2em}

Solution

As mentioned above, we simplify the exponents at the top first and move downwards. So –

223=28=256\begin{align*} 2^{ {\color{Red} 2^3} } \, \, &= \, \, 2^ {\color{Red} 8} \\[1em] &= \, \, 256 \end{align*}

And that brings us to the end of this tutorial on the order of operations. Until next time.