Week 1 · Intermediate Algebra

1. Real Numbers & Order of Operations

120 min

Before you start

  • Fluently add, subtract, multiply, and divide signed integers without a calculator
  • Translate fraction-decimal equivalents for halves, quarters, fifths, and tenths
  • Recognize the symbols for natural numbers, integers, rationals, and reals
  • Maintain a written work log so partial-credit traces are auditable

By the end you'll be able to

  • Classify any given number into the most specific set among naturals, integers, rationals, and reals
  • Evaluate mixed-operator expressions using PEMDAS with zero left-to-right slips
  • Distribute positive and negative coefficients across grouped terms while preserving sign integrity
  • Diagnose the difference between a 'factor' and a 'term' to avoid illegal cancellation
  • Verbally explain why two negatives multiplied yield a positive using a number-line reflection
Week 1 video coming soon
Read the lesson body below in the meantime.

Real Numbers & Order of Operations

Before manipulating unknowns, you must operate fluently on numbers. This week refreshes the real-number system, sign rules, and the universal evaluation order (PEMDAS).

The number system in layers

  • Naturals (ℕ): 1, 2, 3, …
  • Whole numbers: 0, 1, 2, …
  • Integers (ℤ): …, −2, −1, 0, 1, 2, …
  • Rationals (ℚ): any number expressible as a/b with a, b ∈ ℤ, b ≠ 0. Includes terminating and repeating decimals.
  • Irrationals: numbers like π, e, √2 — not expressible as a fraction.
  • Reals (ℝ): rationals ∪ irrationals.

Rationals are the only set among these that’s closed under all four arithmetic operations (division excluding zero). Naturals aren’t closed under subtraction; integers aren’t closed under division.

PEMDAS / order of operations

  1. Parentheses
  2. Exponents
  3. Multiplication / Division (left to right)
  4. Addition / Subtraction (left to right)

Example: 8 − 2·3² evaluates as 8 − 2·9 = 8 − 18 = −10. The exponent comes before multiplication; multiplication before subtraction.

Sign rules

  • Two negatives multiplied or divided yield a positive: (−3)(−4) = 12.
  • Subtracting a negative is the same as adding: 7 − (−2) = 9.
  • Distribution carries the negative across all terms: −(x − 6) = −x + 6, not −x − 6.

Absolute value

The absolute value of a real number x, written |x|, is its distance from zero on the number line. Distance is never negative, so |x| ≥ 0 always.

Piecewise definition:

So , , . The bars don’t flip a positive number — they strip the sign. A consequence: , not , because the square root must return a non-negative result.

Distributive property

a(b + c) = ab + ac. The single most-used identity in algebra. Used to expand parentheses, then re-used in reverse to factor. Watch the sign on a: a negative coefficient distributes as a negative to every inner term.

Why this matters

  1. Algebraic structure learned. PEMDAS, sign rules, and the distributive property over the real numbers — the grammar of every numerical expression.
  2. ML object with the same structure. Loss-function expressions like are nested arithmetic at scale: parentheses group sums, exponents come before products, and a misplaced sign flips the gradient.
  3. Computational payoff. Vectorized array code ((1/(2*m)) * np.sum(...)) evaluates these expressions in parallel across thousands of samples. A precedence slip in the formula cascades into wrong numbers across an entire batch — silent and expensive. PEMDAS discipline on paper transfers directly to bug-free vectorized code.

Common mistakes

These are the traps learners hit most often on this topic. Knowing them in advance is half the fix.

  • Dropping a negative sign on distribution

    Writing -2(x + 5) = -2x + 10 instead of the correct -2x - 10. The negative coefficient distributes to every term inside the parentheses. Same trap on -(x - 6): that’s -x + 6, not -x - 6.

  • Skipping the exponent step in PEMDAS

    Evaluating 8 - 2 · 3² left-to-right as (8 - 2) · 9 = 54. The exponent comes first: 3² = 9, then 2 · 9 = 18, then 8 - 18 = -10.

  • Confusing 'factor' with 'term'

    Cancelling x from (x + 1) / (x + 2) because both have an x. You can only cancel factors (things multiplied), never terms (things added). The x here is a term, not a factor.

Practice problems

Try each on paper first. Click Show solution only after you've made a real attempt.

  1. Problem 1
    Evaluate using PEMDAS.
    Show solution
    1. Exponents first: .
    2. Multiplication next: .
    3. Subtraction last: .

    Answer: .

  2. Problem 2
    Distribute and simplify: .
    Show solution
    1. Distribute the across both terms: and .
    2. So .
    3. Add : .

    Answer: .

  3. Problem 3
    Which set does belong to? (Pick the most specific.)
    Show solution

    is a fraction with integer numerator and integer denominator, so it’s a rational number. It’s also a real number, but rationals is more specific.

    Answer: rational.

  4. Problem 4
    Simplify: .
    Show solution
    1. Evaluate each absolute value:
      • .
      • .
    2. Subtract: .

    Answer: .

  5. Problem 5
    Evaluate .
    Show solution
    1. Resolve the inner parens: .
    2. Multiplication: .
    3. Resolve the leading .
    4. Add: .

    Answer: .

  6. Problem 6
    Evaluate .
    Show solution
    1. Parens: .
    2. Exponent: .
    3. Divide: .
    4. Subtract: .

    Answer: .

  7. Problem 7
    Simplify: .
    Show solution
    1. .
    2. .
    3. .
    4. .

    Answer: .

Practice quiz

  1. Question 1
    Which set contains -3?
  2. Question 2
    Evaluate: 8 - 2 · 3²
  3. Question 3
    Which is irrational?
  4. Question 4
    |-7| equals:
  5. Question 5
    Evaluate: -(-6) + 3·(2-5)
  6. Question 6
    Evaluate: 12 ÷ 4 + 2³
  7. Question 7
    Simplify: 2(3 - 5) - (-4)
  8. Question 8
    Distributive property: 5(x + 3) =?
  9. Question 9
    Which is closed under division (excluding 0)?
  10. Reflection 10
    Why does the order-of-operations matter for ML cost-function code?

Week 1 recap

This week you formalized the real-number tower (naturals inside integers inside rationals inside reals), drilled PEMDAS on mixed-operator expressions, and tightened sign discipline through distribution and absolute value. You neutralized three trap families: the operator-precedence trap (skipping exponents), the partial-distribution trap (forgetting to hit every interior term with a negative coefficient), and the term-vs-factor trap (illegal cancellation across addition). Each outcome maps to a downstream skill: classification supports later work in domains and codomains; PEMDAS underpins translating cost-function math into vectorized code; distribution reappears in every polynomial expansion. The discipline of writing each step on its own line — instead of compressing four operations into one — is the single habit that separates students who debug their algebra in seconds from students who restart from scratch when the answer is off by a sign.

Coming next: Week 2 — Linear Equations in One Variable

Next week you trade arithmetic on numbers for arithmetic on unknowns. You will learn to isolate in single-variable linear equations using inverse operations, verify candidates by substitution, and recognize the special cases of no solution and infinitely many solutions. The mechanical process you build is the same one that closed-form linear regression executes at scale to recover model parameters from data, so cleaner sign work now pays compounding interest later.

Saved in your browser only — no account, no server.