See How Things Work

Parentheses and grouping symbols

Unit
Order of Operations
Part
1. Order of Operations
Lesson
1.2

Parentheses say which operation of an expression is done first. This lesson defines grouping symbols, namely parentheses, brackets and braces, shows how to read groups nested inside other groups from the inside out, and proves that an expression in which every step is grouped has exactly one value, whatever order its separate groups are worked out in.

Parentheses

Lesson 1.1 (“Expressions with several operations”) showed that a row such as 15 − 6 ÷ 3 can be worked out in different orders with different results. Parentheses remove the doubt: they are grouping symbols that indicate which operations should be done first.⁠[1] Grouping symbols work like punctuation in written language: they show which parts of an expression belong together and are kept separate from the rest.⁠[2]

Definition (Group).

A group is a part of an expression enclosed in a pair of grouping symbols, an opening one on its left and a closing one on its right. The expression inside the group is worked out first, and its value then takes the place of the whole group, symbols included.

The rule is simple: whatever is inside the parentheses is evaluated first.⁠[3] So grouping symbols remove the ambiguity of a row with several operations.⁠[4]

Example (One row, two groupings).

Evaluate (15 − 6) ÷ 3 and 15 − (6 ÷ 3).

  1. (15 − 6) ÷ 3: the group comes first, 15 − 6 = 9; it is replaced by 9, giving 9 ÷ 3 = 3.
  2. 15 − (6 ÷ 3): now the group is 6 ÷ 3 = 2; it is replaced by 2, giving 15 − 2 = 13.

Answer: 3 and 13. The numbers and signs are the same; only the parentheses differ, and each expression now has one meaning.

Brackets, braces and nested groups

A group may itself contain a group. To help the eye match the pairs, other shapes are used besides parentheses ( ): the three most common grouping symbols are parentheses, brackets [ ] and braces { }.⁠[5] All three mean the same thing: whether parentheses, brackets or curly braces are used, the expression inside any pair must be evaluated first.⁠[6]

Convention.

In this unit, the innermost pairs are written as parentheses, the pairs around them as brackets, and the pairs around those as braces, and in the figures and games each shape has its own color: ( ) blue, [ ] orange, { } red. This is only a help for reading. Any shape could be used at any level, and parentheses inside parentheses are also correct.

When groups are nested, the innermost group is worked out first, then the work moves outward.⁠[7][8] An innermost group is easy to find: reading from the left, the first closing symbol ends one, and its partner is the last opening symbol before it. No other grouping symbol lies between those two, so the part between them contains no group.

Example (Two levels).

Evaluate 50 − [(4 + 5) × 3].

  1. The first closing symbol is “)”. Its partner is the “(” just before 4, so the innermost group is (4 + 5) = 9.
  2. Replace it: 50 − [9 × 3]. The innermost group is now [9 × 3] = 27.
  3. Replace it: 50 − 27 = 23.

Answer: 23. Check by reading from the inside out: 4 + 5 = 9, 9 × 3 = 27, 50 − 27 = 23.

Example (Three levels).

Evaluate 3 × {20 − [4 + (2 × 4)]}.

  1. Innermost: (2 × 4) = 8. The expression becomes 3 × {20 − [4 + 8]}.
  2. Next: [4 + 8] = 12. The expression becomes 3 × {20 − 12}.
  3. Next: {20 − 12} = 8. The expression becomes 3 × 8.
  4. Last: 3 × 8 = 24.

Answer: 24. There were four operations and four steps, one per operation, as in lesson 1.1.

Fully grouped expressions

With enough grouping symbols, every step of a calculation can be written into the expression itself. An expression written in this way, with a pair of parentheses for every operation, is called fully parenthesized.⁠[9]

Definition (Fully grouped expression).

An expression with several operations is fully grouped if every operation except one is enclosed, together with the two parts it acts on, in its own pair of grouping symbols. The one operation that is not enclosed is the last operation.

However the grouping symbols are placed, one operation remains outside all of them: the operation done last.⁠[10] Every order of the steps in lesson 1.1 corresponds to a fully grouped expression; for example, the order “×, then +” of 2 + 3 × 4 is 2 + (3 × 4). A fully grouped expression can be drawn as a tree, in which each operation joins its two parts and the numbers are at the ends of the branches.⁠[11]

[(8 − 3) × 2] + 6+×−8326= 5= 10= 16
Figure. The expression [(8 − 3) × 2] + 6 drawn as a tree. Each operation joins its two parts, and the numbers are at the bottom. The parentheses (blue) enclose the lowest branch, 8 − 3 = 5; the brackets (orange) enclose the branch above it, 5 × 2 = 10. The top operation, outside all grouping symbols, is done last: 10 + 6 = 16. Working from the inside out means working from the bottom of the tree up.
Theorem .

A fully grouped expression has exactly one value, or no whole-number value at all. Its value does not depend on the order in which separate groups are worked out.

Proof.

Look at the last operation, the one outside all grouping symbols. Its two parts are fully grouped expressions with fewer operations, or single numbers, and they do not overlap. The last operation can only be done when both parts have become numbers, and no step inside one part changes anything in the other. So the value is the result of the last operation on the value of the left part and the value of the right part.

Apply the same argument to each part, then to their parts, and so on. Each time the parts have fewer operations, so after finitely many repetitions only single operations on numbers remain, and each of these has one result or none. Working back up, each part has one value or none, and so does the whole expression. In which order separate parts are worked out was never used.

Looking ahead.

The repeated argument in this proof is an induction on the number of operations. Proofs by induction are studied in the unit Mathematical Induction.

Example (Two separate groups).

Evaluate (6 + 2) × (9 − 4), working out the groups in both orders.

  1. Left group first: 6 + 2 = 8, giving 8 × (9 − 4); then 9 − 4 = 5, giving 8 × 5 = 40.
  2. Right group first: 9 − 4 = 5, giving (6 + 2) × 5; then 6 + 2 = 8, giving 8 × 5 = 40.

Answer: 40 both times. The last operation is ×, and its two parts are worked out separately, as in the proof.

Writing and reading grouping symbols

Grouping symbols that do not change the order of the work may be added or left out without changing the value: (7) + 2 is 7 + 2, and (3 + 4) by itself is 3 + 4. In a sum of three numbers they make no difference to the value either: (2 + 3) + 4 = 2 + (3 + 4), by the associative property of addition (Addition 1.6). In a chain of subtractions or divisions they do (Subtraction 1.6, Division 1.2).

Example (A common mistake: dropping the parentheses).

Someone evaluates 3 × (4 + 5) as 3 × 4 = 12 and then 12 + 5 = 17. Find the mistake.

  1. The group (4 + 5) must be worked out first: 4 + 5 = 9.
  2. Then 3 × 9 = 27.
  3. The calculation 3 × 4, then + 5, belongs to a different expression, (3 × 4) + 5.

Answer: 3 × (4 + 5) = 27, not 17. Dropping the parentheses changed the expression.

Example (From words to symbols).

Write “subtract the sum of 4 and 5 from 50” as an expression and evaluate it.

  1. “The sum of 4 and 5” is 4 + 5. It must be found first, so it gets its own group: (4 + 5).
  2. “Subtract … from 50” puts 50 first: 50 − (4 + 5).
  3. Evaluate: 4 + 5 = 9, then 50 − 9 = 41.

Answer: 50 − (4 + 5) = 41. Without the parentheses, the row 50 − 4 + 5 could also be read as (50 − 4) + 5 = 51, which is not what the words say.

Game

Say it with grouping symbols

Round
1
Score
0
Streak
0

Which expression does exactly what this recipe says, in this order?

  1. Subtract 5 from 9.
  2. Divide the result by 2.
  3. Multiply 4 by the result.
Looking ahead.

Other symbols also group. The absolute value bars of the unit Integers act like grouping symbols: the inside is simplified first.⁠[12] Lesson 1.3 (“The order of operations as a convention”) shows how to read expressions that have fewer grouping symbols than operations.

Exercises

Exercise .

Evaluate (7 + 5) × 2 and 7 + (5 × 2).

▸ Show solution

(7 + 5) × 2 = 12 × 2 = 24, and 7 + (5 × 2) = 7 + 10 = 17.

Exercise .

Evaluate 60 ÷ [(8 − 2) × 5].

▸ Show solution

Innermost: (8 − 2) = 6. Then [6 × 5] = 30. Then 60 ÷ 30 = 2. The value is 2.

Exercise .

Place grouping symbols in 8 − 2 × 3 + 1 to make the value (a) 24, (b) 3, (c) 0.

▸ Show solution

The row 8 − 2 × 3 + 1 has five groupings:

  1. [(8 − 2) × 3] + 1 = 18 + 1 = 19;
  2. (8 − 2) × (3 + 1) = 6 × 4 = 24;
  3. [8 − (2 × 3)] + 1 = 2 + 1 = 3;
  4. 8 − [(2 × 3) + 1] = 8 − 7 = 1;
  5. 8 − [2 × (3 + 1)] = 8 − 8 = 0.

So 24 is (8 − 2) × (3 + 1), 3 is [8 − (2 × 3)] + 1, and 0 is 8 − [2 × (3 + 1)].

Exercise .

Write as one fully grouped expression and evaluate: “multiply 6 by the difference of 10 and 4, then add 7”.

▸ Show solution

The difference of 10 and 4 is (10 − 4); 6 times it is [6 × (10 − 4)]; adding 7 gives [6 × (10 − 4)] + 7. Value: 10 − 4 = 6, 6 × 6 = 36, 36 + 7 = 43.

Exercise .

Someone starts evaluating 2 × [10 − (3 + 4)] with 2 × 10 = 20. Explain the mistake and find the correct value.

▸ Show solution

The innermost group (3 + 4) must come first, then the bracket: 3 + 4 = 7, 10 − 7 = 3, and 2 × 3 = 6. Starting with 2 × 10 works on a number that is still inside the bracket, before the bracket has a value. The correct value is 6.

Exercise .

Using the idea of the last operation, show that a row of four numbers and three operation signs has exactly five fully grouped forms.

▸ Show solution

Sort the groupings of a row a ∘ b ∘ c ∘ d (any operation signs) by their last operation. If it is the first sign, the left part is a and the right part is the row b ∘ c ∘ d, which has 2 groupings. If it is the middle sign, both parts are rows of two numbers, with 1 grouping each: 1 grouping. If it is the third sign, there are 2 groupings, as in the first case.

Total: 2 + 1 + 2 = 5. The same count with two signs gives 1 + 1 = 2.

Summary

  1. Parentheses ( ), brackets [ ] and braces { } are grouping symbols. The expression inside a pair is worked out first, and its value replaces the group.
  2. Nested groups are worked out from the innermost outward; the first closing symbol from the left ends an innermost group.
  3. In a fully grouped expression every operation except the last is in its own pair. It can be drawn as a tree, and working from the inside out is working up the tree.
  4. A fully grouped expression has exactly one value (or none in the whole numbers), whatever order its separate groups are worked out in.
  5. Dropping or moving grouping symbols can change the value: 3 × (4 + 5) = 27, but (3 × 4) + 5 = 17.

Sources

  1. 1.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 7, “The Properties of Real Numbers”, section 7.2, “Commutative and Associative Properties” (“Use the Commutative and Associative Properties”), p. 548 (the whole topic: pp. 547–548).
    “Remember that parentheses are grouping symbols that indicate which operations should be done first.”
    Used for: parentheses are grouping symbols that indicate which operations are done first.
  2. 2.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Use Variables and Algebraic Symbols”), p. 101 (the whole topic: pp. 101).
    “Grouping symbols in algebra are much like the commas, colons, and other punctuation marks in written language. They indicate which expressions are to be kept together and separate from other expressions.”
    Used for: grouping symbols work like punctuation: they show which parts of an expression belong together and are kept separate from the rest.
  3. 3.
    David Arnold, “Prealgebra, 1.2 “Adding and Subtracting Whole Numbers””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “The rule is simple: Whatever is inside the parentheses is evaluated first.”
    Used for: whatever is inside the parentheses is evaluated first.
  4. 4.
    David Arnold, “Prealgebra, 1.5 “Order of Operations””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “Of course, grouping symbols can remove the ambiguity”
    Used for: grouping symbols remove the ambiguity of a row with several operations (the source’s example: 4 + 3 · 2).
  5. 5.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Use Variables and Algebraic Symbols”), p. 101 (the whole topic: pp. 101).
    “Table 2.3 lists three of the most commonly used grouping symbols in algebra.”
    Used for: the three most common grouping symbols; the table names them: parentheses, brackets and braces.
  6. 6.
    David Arnold, “Prealgebra, 1.2 “Adding and Subtracting Whole Numbers””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “Whether we use parentheses, brackets, or curly braces, the expression inside any pair of grouping symbols must be evaluated first.”
    Used for: parentheses, brackets and (curly) braces all mean the same: the expression inside any pair is evaluated first.
  7. 7.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 2, “The Language of Algebra”, section 2.1, “Use the Language of Algebra” (“Simplify Expressions Using the Order of Operations”), p. 108 (the whole topic: pp. 105–109).
    “When there are multiple grouping symbols, we simplify the innermost parentheses first and work outward.”
    Used for: with nested groups, the innermost is worked out first and the work moves outward.
  8. 8.
    David Arnold, “Prealgebra, 1.2 “Adding and Subtracting Whole Numbers””, Mathematics LibreTexts (College of the Redwoods, CC BY-NC-SA).
    “If grouping symbols are nested, we evaluate the innermost parentheses first.”
    Used for: with nested grouping symbols, the innermost group is evaluated first.
  9. 9.
    Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).
    Chapter 11, “Trees”, section 11.3, “Tree Traversal” (11.3.4, “Infix, Prefix, and Postfix Notation”), p. 816 (the whole topic: pp. 816–817).
    “The fully parenthesized expression obtained in this way is said to be in infix form.”
    Used for: an expression written with parentheses for every operation is called fully parenthesized.
  10. 10.
    Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).
    Chapter 8, “Advanced Counting Techniques”, section 8.1, “Applications of Recurrence Relations” (8.1.2, “Modeling With Recurrence Relations”), Example 5, p. 533 (the whole topic: pp. 532–533).
    “operator remains outside all parentheses, namely, the operator for the final multiplication to be performed.”
    Used for: however the parentheses are placed, one operation remains outside all of them: the operation done last (the source says this of a product of several numbers, in counting its groupings).
  11. 11.
    Kenneth H. Rosen, Discrete Mathematics and Its Applications (8th ed., McGraw-Hill, 2019).
    Chapter 11, “Trees”, section 11.3, “Tree Traversal” (11.3.4, “Infix, Prefix, and Postfix Notation”), p. 816 (the whole topic: pp. 816–817).
    “An ordered rooted tree can be used to represent such expressions, where the internal vertices represent operations, and the leaves represent the variables or numbers.”
    Used for: an expression can be drawn as a tree in which each operation joins its two parts and the numbers are at the ends of the branches.
  12. 12.
    Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).
    Chapter 3, “Integers”, section 3.1, “Introduction to Integers” (“Simplify Expressions with Absolute Value”), p. 181 (the whole topic: pp. 180–182).
    “Absolute value bars act like grouping symbols.”
    Used for: the absolute value bars of the unit Integers act like grouping symbols.