NapkinCalc

Pre-Algebra — Numbers & First Variables

Order of operations (PEMDAS)

ELI5: when an expression mixes operations, everyone must agree on the order or we'd get different answers. The rule is PEMDAS: Parentheses, then Exponents, then Multiply/Divide (left to right), then Add/Subtract. So 2 + 3 × 4 = 14 (multiply first), not 20.

pem=2+34pem = 2 + 3 \cdot 4 = 1414 multiply before adding: 14
✓ pass pem==14pem == 14 not 20 — × beats +
pemparen=(2+3)4pem_{paren} = \left(2 + 3\right) \cdot 4 = 2020 parentheses jump the queue: 20
✓ pass pemparen==20pem_{paren} == 20 now the addition goes first

Real-world hook: every spreadsheet, calculator, and programming language obeys exactly this order — get it wrong and a budget or a dosage comes out wrong.

Try it yourself: evaluate 5 + 2 × 3² (exponent first, then ×, then +).

pemdasyou=5+232pemdas_{you} = 5 + 2 \cdot 3^{2} = 2323 ✏️ Your turn: evaluate 5 + 2 × 3². Do 3² first (= 9), then ×2, then +5.
✓ pass abs(pemdasyou5+232)<109\mathrm{abs}\left(pemdas_{you} - 5 + 2 \cdot 3^{2}\right) < 10^{-9} green when you follow PEMDAS correctly