In mathematics, the hierarchy of operations refers to the order in which mathematical operations must be performed. Let’s imagine the following situation:

2 + 3 x 4 – 5 ÷ 5

We could do the following calculation:

- First we add 2 + 3, then we multiply by 4, subtract 5 from that, and finally divide by 5.
- Or we could add 2 plus 3, subtract 4 and 5, multiply that result and divide at the end by 5.

In either case, the result is different. Therefore, there are rules or instructions that must be followed so that a series of mathematical operations is always solved in the same way. Thus, in the expression 2 + 3 x 4 -5 ÷ 5 the correct result is 13 because:

- multiplication and division are performed first: 3 x 4 = 12, 5 ÷ 5 = 1
- then the additions and subtractions are carried out in the direction from left to right:

2 + 12 = 14, 14 – 1 = 13.

## Key to developing the hierarchy of operations

Mnemonic rule to remember the hierarchy of operations.

Mathematical operations are carried out as follows:

- The calculations are done from left to right.
- If there are parentheses or other grouping signs, those operations are performed first.
- The next order is to solve for the exponents.
- The next step is to evaluate multiplication and division.
- Finally, the indicated additions and subtractions are carried out.

To remember the order of operations, we can assert a mnemonic PEMDAS: **P** aréntesis, **E** xponentes, **M** ultiplicaciones / **D** ivisiones, **A** conditions / **S** ustracciones.

## Signs of grouping in the hierarchy of operations

The grouping signs indicate that the operations within them are performed first. These are:

- parentheses ()
- square bracket [ ]
- keys { }

Fraction bars -, absolute value bars | | and the root symbol √ also qualify as grouping signs.

For example, 5 x (3 + 4), this indicates that we first have to add what is inside the parentheses and then that result is multiplied by 5:

5 x (3 + 4) = 5 x (7) = 5 x 7 = 35

When several grouping signs appear, the order of resolution is as follows: first the parentheses, followed by square brackets and at the end the braces, that is, from the inside out.

{[(3 + 4) + (4-3)] x (2 + 1)}

First we solve the operations inside the parentheses:

{[7 + 1] x 3}

Then, the operations inside the brackets are resolved:

{[7 + 1] x 3} = {8 x 3}

Finally, the keys are developed:

{8 x 3} = 24

### Example

In this case we have a fraction bar, so we do the operations above and below the bar first:

7+ 5 = 12 and 3 + 1 = 4, we have the fraction 12/4 which is equal to 3:

## Addition and subtraction operations in which there are no grouping signs

In this case, the operations are carried out in the order presented:

5 + 3 – 4 + 2 – 6 + 2 ⇒

5 + 3 = 8,

8 – 4 = 4,

4 + 2 = 6,

6 – 6 = 0,

0 + 2 = 2

### Example

1) 32-19 + 40-20 + 30-50

We do the operations step by step:

32-19 = 13,

13 + 40 = 53,

53-20 = 33,

33 + 30 = 63,

63-50 = 13

2) 60-40 + 108-104 + 320-133-45

We do the operations step by step:

60 – 40 = 20,

20 + 108 = 128,

128 – 104 = 24,

24 + 320 = 344,

344 – 133 = 211,

211 – 45 = 166.

## Addition and subtraction operations in which there are grouping signs

Operations within the parentheses are performed first until only one number remains:

678 – [(34 + 28) + (73 – 15) – (12 + 43)] ⇒

34 + 28 = 62, 73 – 15 = 58, 12 + 43 = 55,

then the operations inside the bracket are resolved:

62 + 58 = 120, 120 -55 = 65,

Finally, the rest of the operations are carried out;

678 – 65 = 613.

## Multiplication operations in which there are no grouping signs

When there are no grouping signs, multiplications are performed first, followed by addition and subtraction:

3 x 4 + 5 x 6 ⇒

3 x 4 = **12** , 5 x 6 = **30** ,

12 + 30 = 42

### Example

15 – 5 x 3 + 4, first the multiplication is done:

5 x 3 = 15;

then the additions and subtractions in the order they appear:

15 -15 + 4 ⇒15 – 15 = 0,

0 + 4 = 4.

## Multiplication operations with grouping signs

In these cases, the operations enclosed in the grouping signs are carried out first, and then the indicated operations:

(5 – 2) 3 + 6 (4 – 1) ⇒ the operations inside the parentheses:

5 – 2 = 3,

4-1 = 3;

now the corresponding multiplications are carried out:

(3) 3 = **9** and 6 (3) = **18** ; finally the two terms obtained are added:

9 + 18 = 27

### Example

(20 – 5 + 2) (16 – 3 + 2 – 1) ⇒ 20 – 5 = 15, 15 + 2 = **17** ;

16 – 3 = 13, 13 + 2 = 15, 15 – 1 = **14** ;

then we multiply the results obtained from the parentheses:

17 x 14 = 238

## Division or multiplication operations in which there are no grouping signs

In these cases, the divisions and multiplications are carried out first, and then the additions and subtractions:

12 ÷ 3 x 4 ÷ 2 x 6; the divisions are 12 ÷ 3 = 4 and 4 ÷ 2 = 2;

then the expression becomes 4 x 2 x 6 = 48.

### Example

10 ÷ 5 + 4 – 16 ÷ 8 – 2 + 4 ÷ 4 – 1⇒ first we carry out the divisions:

10 ÷ 5 = 2, 16 ÷ 8 = 2, 4 ÷ 4 = 1;

we continue the operations indicated in order: 2 + 4 – 2 – 2 + 1 – 1

2 + 4 = 6, 6 – 2 = 4, 4 – 2 = 2, 2 + 1 = 3, 3 – 1 = 2.

The final answer to 10 ÷ 5 + 4 – 16 ÷ 8 – 2 + 4 ÷ 4 – 1 is 2.

## Division or multiplication operations with grouping signs

In these cases, the operations enclosed in the grouping signs are carried out first, and then the indicated operations:

150 ÷ (25 x 2) + 32 ÷ (8 x 2) ⇒ first we perform the operations inside the parentheses:

25 x 2 = 50, 8 x 2 = 16;

then we do the divisions:

150 ÷ 50 = 3, 32 ÷ 16 = 2;

Finally we do the sum:

3 + 2 = 5.

### Example

200 ÷ (8 – 6) (5 – 3) ⇒ we carry out the operations between parentheses:

8 – 6 = 2, 5 – 3 = 2;

then we do the division:

200 ÷ 2 = 100;

and finally the multiplication:

100 x 2 = 200

The final answer to 150 ÷ (25 x 2) + 32 ÷ (8 x 2) is 200.

## Root operations √

The radical symbol √ also functions as a grouping sign, so the operations embraced by this symbol must be performed first:

We first develop the sum under the square root:

12 + 13 = 25; we take the square root of 25:

√25 = 5; then the multiplication is carried out:

4 x 5 = 20;

we end with the sum:

3 + 20 = 23.

## Operations with exponents

Expressions with exponents also take precedence over other operations.

60 – 3 x 4 + (1 + 1) ^{2} .

We carry out the operation inside the parentheses:

(1+ 1) ^{2} = 2 ^{2} = 4;

We continue with the multiplication:

3 x 4 = 12; we finish the operations in the order indicated:

60 – 12 + 4 = 52