Order of Operations

Arithmetic

The order of operations is the standard set of rules that determines the sequence in which calculations are performed in a mathematical expression.

Formula

\text{PEMDAS: Parentheses, Exponents, Multiply/Divide (left to right), Add/Subtract (left to right)}

Definition

The order of operations is a set of rules that tells you which math operation to do first when an expression has more than one operation: (1) parentheses and grouping symbols, (2) exponents and roots, (3) multiplication and division from left to right (same priority), and (4) addition and subtraction from left to right (same priority), often remembered as PEMDAS. Operations at the same priority level are resolved left to right, so $12 / 4 \times 3 = 3 \times 3 = 9$, not $12/12=1$. Formally, this is a syntactic convention for parsing mathematical expressions unambiguously, encoded in operator precedence and associativity rules; formal notations like Reverse Polish Notation eliminate the need for such rules by making the parse tree explicit.

Example

$2 + 3 \times 4 = 2 + 12 = 14$ (multiply first), not $(2+3) \times 4=20$ unless parentheses say so. $3 + 6^2 / (2 \times 3) - 1 = 3 + 36/6 - 1 = 3+6-1=8$, following parentheses, then exponent, then division, then left-to-right addition/subtraction. The expression $2^{3^2}$ is ambiguous without an associativity convention: right-associative (standard) gives $2^{(3^2)}=2^9=512$, while left-associative gives $(2^3)^2=8^2=64$; mathematics and most programming languages use right-associativity for exponentiation.

Key Insight

"Please Excuse My Dear Aunt Sally" helps you remember PEMDAS, and the rules exist so everyone gets the same answer from the same expression. Multiplication and division sit at the same level and resolve left to right, which is the rule that removes ambiguity there. Operator precedence is ultimately a design decision, not a mathematical law: different programming languages make different choices (APL, for instance, evaluates strictly right to left with no precedence), and PEMDAS is simply the standard convention adopted in mathematics education.