# Order of operations

Order of operations is the order in which we perform addition, subtraction, multiplication, division, and other operations in a mathematical expression.

There is a mnemonic **PEMDAS**--**P**lease **E**xcuse **M**y **D**ear **A**unt **S**ally--which may help you remember the order in which to perform the mathematical operations:

**P**= Parentheses**E**= Exponents**MD**= Multiplication and Division--working from left to right**AS**= Addition and Subtraction--working from left to right

Let's look at some examples of how this works. For each example below, the mathematical expression is listed fist, followed by a new version of the equation which shows the results of the individual operations (e.g., simplification of exponent or multiplying two numbers). The operations completed for each step are described next to the step. The first example shows only one operation completed in each step. Examples 2 and 3 show more than one operation completed in some steps.

### Example 1:

[math](2+1)^3+10-8*5/2[/math]

[math]\begin{align} & =3^3+10-8*5/2 \qquad \text{Parentheses}\\ & =27+10-8*5/2 \qquad \text{Exponent}\\ & =27+10-40/2 \qquad \text{Multiplication, because it is leftmost}\\ & =27+10-20 \qquad \text{Division, because it is next when working from left to right}\\ & =37 - 20 \qquad \text{Addition, because it is leftmost}\\ & =17 \qquad \text{Subtraction, because it is next when working from left to right}\\ \end{align}[/math]

### Example 2:

[math](5 + 3) / 2 + -8 / 4 + 2 * 3[/math]

[math]\begin{align} & = 8 / 2 + -8 / 4 + 2 * 3 \qquad \text{Parentheses}\\ & = 4 + -2 + 6 \qquad \text{Division, as they appear working from left to right}\\ & = 8 \qquad \text{Addition (including addition of negative number), as they appear working from left to right}\\ \end{align}[/math]

### Example 3:

[math]4^3 * 2 + 2^4 / 4 - (4 + 1)^2[/math]

[math]\begin{align} & = 4^3 * 2 + 2^4 / 4 - 5^2 \qquad \text{Parentheses}\\ & = 64 * 2 + 16 / 4 - 25 \qquad \text{Exponents}\\ & = 128 + 4 - 25 \qquad \text{Multiplication and Division, as they appear working from left to right}\\ & = 107 \qquad \text{Addition and Subtraction, as they appear working from left to right}\\ \end{align}[/math]