1. Real Numbers & Order of Operations
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
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/bwitha, 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
- Parentheses
- Exponents
- Multiplication / Division (left to right)
- 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
- Algebraic structure learned. PEMDAS, sign rules, and the distributive property over the real numbers — the grammar of every numerical expression.
- 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.
- 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 + 10instead 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, then2 · 9 = 18, then8 - 18 = -10.Confusing 'factor' with 'term'
Cancelling
xfrom(x + 1) / (x + 2)because both have anx. You can only cancel factors (things multiplied), never terms (things added). Thexhere is a term, not a factor.
Practice problems
Try each on paper first. Click Show solution only after you've made a real attempt.
- Problem 1Evaluate using PEMDAS.
Show solution
- Exponents first: .
- Multiplication next: .
- Subtraction last: .
Answer: .
- Problem 2Distribute and simplify: .
Show solution
- Distribute the across both terms: and .
- So .
- Add : .
Answer: .
- Problem 3Which 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.
- Problem 4Simplify: .
Show solution
- Evaluate each absolute value:
- .
- .
- Subtract: .
Answer: .
- Evaluate each absolute value:
- Problem 5Evaluate .
Show solution
- Resolve the inner parens: .
- Multiplication: .
- Resolve the leading .
- Add: .
Answer: .
- Problem 6Evaluate .
Show solution
- Parens: .
- Exponent: .
- Divide: .
- Subtract: .
Answer: .
- Problem 7Simplify: .
Show solution
- .
- .
- .
- .
Answer: .
Practice quiz
- Question 1Which set contains -3?
- Question 2Evaluate: 8 - 2 · 3²
- Question 3Which is irrational?
- Question 4|-7| equals:
- Question 5Evaluate: -(-6) + 3·(2-5)
- Question 6Evaluate: 12 ÷ 4 + 2³
- Question 7Simplify: 2(3 - 5) - (-4)
- Question 8Distributive property: 5(x + 3) =?
- Question 9Which is closed under division (excluding 0)?
- Reflection 10Why 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.