Algebra 1 · Study guide

Order of Operations

Chapter 1 · Expression compiler

Order of operations

An expression has grammar. Grouping defines scope, powers bind to a base, and equal-priority operations are compiled from left to right.

compile one valid step
Syntax changes meaning

Grouping changes the parse

The same numbers and operations can describe different structures. Grouping tells every reader which structure is intended.

No grouping
6 + 2 · 5

Multiplication binds first.

16
Grouped base
(6 + 2) · 5

The sum becomes one factor.

40
Compiler pass order

Resolve high-priority structure first

Scope library

Grouping is more than parentheses

( ) [ ]

Parentheses or brackets

With nested groups, simplify the innermost pair first.

a + b
────
c

Fraction bar

The numerator and denominator are separate groups.

√(a + b)

Radical

The radicand stays grouped beneath the radical symbol.

|a − b|

Absolute value

Simplify inside before measuring distance from zero.

Exponent scope

Which base does the power own?

Narrow scope
−3²
base: 3→\(-(3^2)=-9\)
Grouped scope
(−3)²
base: −3→\((-3)^2=9\)
Shared priority

Equal-priority operations compile left to right

18 ÷ 3 · 2
  1. Division and multiplication tie.
  2. The division appears first: \(18\div3=6\).
  3. Continue right: \(6\cdot2=12\).
Trace output

Evaluate \(4[12-(3+2)^2]\)

Change one part per line and preserve everything else. That makes every structural decision visible.

014[12 − (3 + 2)²]innermost group
024[12 − 5²]power
034[12 − 25]bracket
044(−13)multiply
05−52output
Parallel groups

Compile numerator and denominator separately

Diagnostics

Four common parse errors

Error

“Do everything from left to right.”

Grouping and powers must resolve before lower-priority operations.
Error

“Multiplication always comes before division.”

They share a level; use left-to-right position.
Error

Ignoring a fraction bar or radical as grouping.

Compile the numerator, denominator, or radicand as its own group.
Error

Changing several unrelated parts at once.

Rewrite unchanged structure on each new line.
Unit tests

Verify the compiler

Evaluate \(4+3^2\).

Expected output

13

Evaluate \((4+3)^2\).

Expected output

49

Evaluate \(\frac{18-6}{2+4}\).

Expected output

2