# Order of Operations (PEMDAS)

## Related calculator: Order of Operations (PEMDAS) Calculator

Order of Operations (PEMDAS):

1. Parentheses
2. Exponent
3. Multiplication
4. Division
6. Subtraction

Note, that multiplication and division rank equally. Also addition and subtraction rank equally.

Operations, that rank equally, can be performed from left to right.

These are the rules, that allows us to simplify number expressions, because there are situationss, when we don't know what operation to perform first.

Instead of parentheses ${\left(\ \right)}$, square brackets ${\left[\ \right]}$ can be used. They are often used to make expression look nicer.

We used term "order of operations"? But what is an operation?

Operation means action (you need to do something). Addition, subtraction, multiplication, division, raising to power are examples of operations.

For example, in expression ${2}+{3}$, $+$ is operation, because you need to add two numbers to get the result.

Number expression is a bunch of numbers and operations.

For example, ${9}+{3}\cdot{{\left({7}-{5}\right)}}^{{2}}+\frac{{8}}{{2}}$ is a number expression.

To simplify expression means to perform operations (where it is possible).

Example 1. Simplify ${4}+{5}\cdot{6}$.

How do we simplify this?

From left to right? ${4}+{5}\cdot{6}={9}\cdot{6}={54}$.

No, we need to use PEMDAS: multiplication ranks higher, so we perform it first: ${4}+{5}\cdot{6}={4}+{30}={34}$.

But, if we slightly modify our expression, like ${\left({4}+{5}\right)}\cdot{6}$, then addition is performed first, because parentheses have the highest rank:

${\color{red}{{{\left({4}+{5}\right)}\cdot{6}={9}\cdot{6}={54}}}}$

${\color{purple}{{{4}+{5}\cdot{6}={4}+{30}={34}}}}$

In most cases, you will need to evaluate expression inside parenthesis, using same rules.

Example 2. Simplify the following: ${\left({{6}}^{{2}}-{8}\right)}\div{7}\cdot{{3}}^{{2}}$.

Paretheses first, but inside parentheses there is complex expression, that can be evaluated, using order of operations.

 ${\color{red}{{{\left({{6}}^{{2}}-{8}\right)}}}}\div{7}\cdot{{3}}^{{2}}$ (parentheses first) ${\color{red}{{{\left({36}-{8}\right)}}}}\div{7}\cdot{{3}}^{{2}}$ (exponent) ${\color{red}{{{28}}}}\div{7}\cdot{{3}}^{{2}}$ (subtraction)

We are done with parentheses, so apply PEMDAS to the obtained result.

 ${28}\div{7}\cdot{9}$ (exponent) ${4}\cdot{9}$ (division) ${36}$ (multiplication and done)

Sometimes, in the expression there can be a fraction, like $\frac{{m}}{{n}}$. But each numerator and denominator can be expression itself. In this case, since $\frac{{m}}{{n}}={\left({m}\right)}\div{\left({n}\right)}$, we separately evaluate numerator and denominator, and then divide the result.

Example 3. Simplify the following: $\frac{{{5}+{7}}}{{{{3}}^{{2}}-{5}}}\cdot\frac{{{18}+{8}}}{{{9}+{4}}}$.

Here we have two fractions, so we evaluate them from left to right.

 $\frac{{12}}{{{{3}}^{{2}}-{5}}}\cdot\frac{{{18}+{8}}}{{{9}+{4}}}$ (numerator of the first fraction) $\frac{{12}}{{{9}-{5}}}\cdot\frac{{{18}+{8}}}{{{9}+{4}}}$ (denominator of the first fraction: exponent) $\frac{{12}}{{4}}\cdot\frac{{{18}+{8}}}{{{9}+{4}}}$ (denominator of the first fraction: subtraction) $\frac{{12}}{{4}}\cdot\frac{{26}}{{{9}+{4}}}$ (numerator of the second fraction) $\frac{{12}}{{4}}\cdot\frac{{26}}{{13}}$ (denominator of the second fraction) ${3}\cdot\frac{{26}}{{13}}$ (division and multiplication from left to right) $\frac{{78}}{{13}}$ (division and multiplication from left to right) ${6}$ (division and done)

As you could notice, operations that rank equally, can be performed simultaneously.

For example, ${3}\cdot{6}-\frac{{12}}{{4}}$ can be rewritten as ${18}-{3}$ (we perform multiplication and division simultaneously, because they have equal rank).

No need to say, that parentheses can be nested, as well as other operations.

For example, in ${\left({2}+{\left({5}-{4}\right)}\cdot{3}\right)}\cdot{3}$ we have nested parentheses and in ${{3}}^{{{2}+{5}\cdot{{4}}^{{3}}}}$ exponent is expression, that also contains exponent.

No need to panic! Such expressions are simplified as always. We start from outer, but, in fact, to evaluate outer, we need to simplify inner.

Example 4. Simplify the following: ${\left({2}+{\left({5}-{4}\right)}\cdot{3}\right)}\cdot{{3}}^{{{325}-{5}\cdot{{4}}^{{3}}}}$.

We start from outer parentheses, but to simplify it, we need to evaluate inner expression: ${\color{red}{{{\left({2}+{\left({5}-{4}\right)}\cdot{3}\right)}}}}\cdot{{3}}^{{{325}-{5}\cdot{{4}}^{{3}}}}$.

 ${\color{red}{{{\left({2}+{1}\cdot{3}\right)}}}}\cdot{{3}}^{{{325}-{5}\cdot{{4}}^{{3}}}}$ (parentheses inside parentheses) ${\color{red}{{{\left({2}+{3}\right)}}}}\cdot{{3}}^{{{325}-{5}\cdot{{4}}^{{3}}}}$ (multiplication inside parentheses) ${5}\cdot{{3}}^{{{325}-{5}\cdot{{4}}^{{3}}}}$ (addition inside parentheses)

Now, we need to evaluate exponent, but exponent is a complex expression, so we simplify it, using PEMDAS.

 ${5}\cdot{{3}}^{{{\color{red}{{{325}-{5}\cdot{64}}}}}}$ (exponent inside the exponent) ${5}\cdot{{3}}^{{{\color{red}{{{325}-{320}}}}}}$ (multiplication inside the exponent) ${5}\cdot{{3}}^{{5}}$ (subtraction inside the exponent) ${5}\cdot{243}$ (exponent) ${1215}$ (multiplication and done)

Finally, let's solve the last example, that has all features, that we've discussed.

Example 5. Simplify the following: $\frac{{{70}-{4}\cdot{{\left({5}-{1}\right)}}^{{2}}}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$.

Wow! There is a lot of work to do!

We start from the numerator of first fraction: $\frac{{{\color{red}{{{70}-{4}\cdot{{\left({5}-{1}\right)}}^{{2}}}}}}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$.

$\frac{{{\color{red}{{{70}-{4}\cdot{{4}}^{{2}}}}}}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (evaluate base of the exponent)

$\frac{{{\color{red}{{{70}-{4}\cdot{16}}}}}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (exponent)

$\frac{{{\color{red}{{{70}-{64}}}}}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (multiplication)

$\frac{{6}}{{{2}\cdot{3}}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

Now, evaluate denominator of the first fraction:

$\frac{{6}}{{6}}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

Since fraction means division, we can simplify the fraction and then perform other operations. Alternatively, we can perform division from left to right:

${1}\cdot\frac{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

Now, simplify numerator of the second fraction: ${1}\cdot\frac{{{\color{red}{{{{3}}^{{{11}-{{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{3}}}}}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$.

${1}\cdot\frac{{{\color{red}{{{{3}}^{{{11}-{{3}}^{{{9}-{4}-{3}}}}}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (first operation is exponent, but we need to simplify it, so start from the inner exponent; inner exponent ${{3}}^{{{{3}}^{{2}}-{{2}}^{{2}}-{5}}}$ also has exponents, so we simplify them first; here, as you can see, we have deep nesting)

${1}\cdot\frac{{{\color{red}{{{{3}}^{{{11}-{{3}}^{{2}}}}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction; simultaneously 2 times)

${1}\cdot\frac{{{\color{red}{{{{3}}^{{{11}-{9}}}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (inner exponent)

${1}\cdot\frac{{{\color{red}{{{{3}}^{{2}}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

${1}\cdot\frac{{{\color{red}{{{9}\cdot{3}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (at last, outer exponent)

${1}\cdot\frac{{{\color{red}{{{27}-{5}}}}}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (multiplication)

${1}\cdot\frac{{22}}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

Now, handle the denominator of fraction: ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{\left({4}+{3}\right)}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$.

Remember that square brackets play the same role as parentheses.

We start from parentheses (from left to right):

${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{\left[{2}+{\left({3}+{\left({12}-{6}\right)}\div{3}\right)}\cdot{5}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction)

To simplify next parentheses, we need to simplify expression between them. This expression also contains parentheses, so we need to simplify the innermost parentheses:

 ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{\left[{2}+{\left({3}+{\color{green}{{{6}}}}\div{3}\right)}\cdot{5}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction) ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{\left[{2}+{\left({3}+{\color{green}{{{2}}}}\right)}\cdot{5}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (division) ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{\left[{2}+{5}\cdot{5}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (addition) ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{\left[{2}+{25}\right]}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (multiplication) ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{7}\cdot{27}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (addition) ${1}\cdot\frac{{22}}{{{\color{red}{{{200}-{189}}}}}}\div{\left({5}+{7}\cdot{1}\right)}$ (multiplication) ${1}\cdot\frac{{22}}{{11}}\div{\left({5}+{7}\cdot{1}\right)}$ (subtraction) ${1}\cdot{2}\div{\left({5}+{7}\cdot{1}\right)}$ (division) ${1}\cdot{2}\div{\left({5}+{7}\right)}$ (parentheses: multiplication inside them) ${1}\cdot{2}\div{12}$ (parentheses) ${2}\div{12}$ (multiplication) $\frac{{1}}{{6}}$ (division and done)

So, answer is $\frac{{1}}{{6}}$.

Things to remember:

• Don't be afraid of complex expressions. Just use order of operations and simplify expressions, using PEMDAS, step by step.
• Nested expressions can be simplified, starting from the innermost one (to allow simplification of outer expression)
• Simplification of expressions can be performed in a number of ways. For example, in expression ${3}\cdot{4}\div{6}$, we can first perform multiplication, then division. From another side, we can perform division and then multiplication. This can be done, because they have equal rank. You are free to choose the way you like, as long as it follows PEMDAS.
• Operations, that rank equally, can be performed simultaneously. For example, ${4}+{5}-{7}={2}$.

Now, it is time to exercise.

Exercise 1. Simplify the following: ${4}+{6}\div{2}$.

Answer: ${7}$.

Exercise 2. Simplify the following: ${\left({{3}}^{{2}}-{5}\right)}\cdot{{\left({{2}}^{{2}}+{5}\right)}}^{{2}}-{35}\div{\left({5}+{2}\right)}$.

Answer: ${319}$.

Exercise 3. Simplify the following: $\frac{{{{4}}^{{3}}-{3}\cdot{7}}}{{{4}\cdot{5}-{12}}}\cdot{{2}}^{{{2}+{1}}}$.

Answer: ${43}$.

Exercise 4. Simplify the following: ${\left({2}\cdot{\left({5}+{\left({3}\cdot{7}+{2}\right)}\cdot{4}\right)}\right)}-{{3}}^{{{5}\cdot{7}\cdot{{2}}^{{2}}-{135}}}$.

Answer: $-{49}$.

Exercise 5. Simplify the following: ${2}+\frac{{{3}\cdot\frac{{{1}+{{3}}^{{2}}}}{{{{2}}^{{3}}-{3}}}}}{{{34}-{\left({5}\cdot{\left({2}+{\left({3}\cdot{2}\right)}\right)}\right)}}}$.

Answer: $1$.