Mathematics.

arithmetic conventions

Order of Operations

Foundations15 minDifficulty1 out of 10

Overview

The order of operations is the agreed-upon sequence for evaluating a mathematical expression with multiple operations, so that everyone gets the same answer from the same expression. Without a fixed convention, 2 + 3 × 4 could mean either (2+3)×4=20 or 2+(3×4)=14 — the order of operations resolves this ambiguity by fixing which operations happen first.

Intuition

Think of it as a hierarchy of 'binding strength': exponents bind more tightly than multiplication, which binds more tightly than addition. Parentheses override everything, letting you explicitly force a different order. The common mnemonic PEMDAS (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction) encodes this hierarchy, with the caveat that multiplication/division are actually equal-priority (evaluated left to right), as are addition/subtraction.

Formal Definition

Definition

The standard precedence, from highest to lowest:

1. ()2. xn3. ×,÷ (left to right)4. +, (left to right)1.\ () \quad 2.\ x^n \quad 3.\ \times,\, \div \text{ (left to right)} \quad 4.\ +,\, - \text{ (left to right)}
Precedence order

Notation

NotationMeaning
PEMDAS\text{PEMDAS}Mnemonic: Parentheses, Exponents, Multiplication/Division, Addition/Subtraction

Properties

Multiplication/division tie

× and ÷ have EQUAL precedence, evaluated left to right\times \text{ and } \div \text{ have EQUAL precedence, evaluated left to right}

Example: 8 \div 2 \times 2 = (8\div2)\times2 = 8, \text{ not } 8\div(2\times2)=2

Addition/subtraction tie

+ and  have EQUAL precedence, evaluated left to right+ \text{ and } - \text{ have EQUAL precedence, evaluated left to right}

Parentheses override

Anything inside () is fully evaluated before it interacts with anything outside\text{Anything inside } () \text{ is fully evaluated before it interacts with anything outside}

Applications

Every programming language's expression parser implements a precise operator-precedence table, a direct formalization of order of operations.

Worked Examples

  1. Multiplication before addition.

    2+(3×4)=2+12=142 + (3\times4) = 2+12 = 14

Answer: 14

Practice Problems

Difficulty 2/10

Evaluate 6 - 2 × (1 + 2).

Common Mistakes

Common Mistake

Always evaluating multiplication fully before any division, or addition fully before any subtraction.

Multiplication and division are the SAME priority tier (left to right), as are addition and subtraction — you don't finish all multiplications before starting divisions.

Summary

  • Order of operations fixes how to evaluate expressions with multiple operations unambiguously.
  • Precedence, highest to lowest: parentheses, exponents, multiplication/division (tied), addition/subtraction (tied).
  • Tied-precedence operations are evaluated left to right.
  • This convention is exactly what programming language parsers implement as operator precedence.

References