Day 1 — Integers, Fractions & Decimals

Updated

July 30, 2025

Day 1 — Integers, Fractions & Decimals

Day 1 — Integers & order of operations

Stage I · concept day
Goal: Master integer structure, signed arithmetic, precedence and associativity with proofs and counterexamples, parity in full, absolute value with the triangle inequality, and expression-tree thinking.

Why this matters

Every later algebra step, complexity calculation, index arithmetic, and modular argument assumes you never lose track of parentheses, signs, and left-to-right rules. Mistakes here cascade into “wrong answers that look like algebra.” Compilers and interpreters encode the same ideas as precedence tables and abstract syntax trees. This day makes integer arithmetic automatic, justified, and checkable.

Theory

The integers \(\mathbb{Z}\)

The set of integers is

\[\mathbb{Z} = \{\ldots,-3,-2,-1,0,1,2,3,\ldots\}.\]

Structural properties (ring axioms, informal list):

Property Statement
Closure under \(+\) \(a,b\in\mathbb{Z}\Rightarrow a+b\in\mathbb{Z}\)
Closure under \(\times\) \(a,b\in\mathbb{Z}\Rightarrow ab\in\mathbb{Z}\)
Closure under \(-\) \(a,b\in\mathbb{Z}\Rightarrow a-b\in\mathbb{Z}\)
Associativity of \(+\) \((a+b)+c=a+(b+c)\)
Commutativity of \(+\) \(a+b=b+a\)
Additive identity \(a+0=a\)
Additive inverse \(a+(-a)=0\)
Associativity of \(\times\) \((ab)c=a(bc)\)
Commutativity of \(\times\) \(ab=ba\)
Multiplicative identity \(1\cdot a=a\)
Distributivity \(a(b+c)=ab+ac\)

Not closed under division in \(\mathbb{Z}\): \(1/2\notin\mathbb{Z}\). The natural numbers \(\mathbb{N}\) are \(\{0,1,2,\ldots\}\) or \(\{1,2,3,\ldots\}\) by convention; when it matters, say which you use. Zero is an integer; \(0\) is even because \(0=2\cdot 0\).

Even and odd (parity) — full case set

An integer \(n\) is even if \(\exists k\in\mathbb{Z}\) with \(n=2k\).
An integer \(n\) is odd if \(\exists k\in\mathbb{Z}\) with \(n=2k+1\).

Every integer is exactly one of even or odd (remainder \(0\) or \(1\) on division by \(2\); formalized Day 5).

Theorem (parity of sums and products). Let \(m,n\in\mathbb{Z}\).

  1. even \(+\) even \(=\) even
  2. odd \(+\) odd \(=\) even
  3. even \(+\) odd \(=\) odd
  4. even \(\times\) even \(=\) even
  5. even \(\times\) odd \(=\) even
  6. odd \(\times\) odd \(=\) odd

Proof of (1). Write \(m=2k\), \(n=2\ell\). Then \(m+n=2(k+\ell)\), even. \(\square\)

Proof of (2). Write \(m=2k+1\), \(n=2\ell+1\). Then \[m+n=2k+2\ell+2=2(k+\ell+1),\] even. \(\square\)

Proof of (3). \(m=2k\), \(n=2\ell+1\) \(\Rightarrow\) \(m+n=2(k+\ell)+1\), odd. \(\square\)

Proof of (4). \(m=2k\), \(n=2\ell\) \(\Rightarrow\) \(mn=4k\ell=2(2k\ell)\), even. \(\square\)

Proof of (5). \(m=2k\), \(n=2\ell+1\) \(\Rightarrow\) \(mn=2k(2\ell+1)=2(\cdots)\), even. \(\square\)

Proof of (6). \(m=2k+1\), \(n=2\ell+1\) \(\Rightarrow\) \[mn=(2k+1)(2\ell+1)=4k\ell+2k+2\ell+1=2(2k\ell+k+\ell)+1,\] odd. \(\square\)

Corollary. \(n\) even \(\Leftrightarrow\) \(n^2\) even; \(n\) odd \(\Leftrightarrow\) \(n^2\) odd. (Use (4) and (6).)

Order of operations (precedence)

Standard mathematical convention for evaluating an expression:

  1. Grouping — parentheses (and brackets, braces) from the inside out
  2. Exponents — usually right-associative: \(a^{b^c}=a^{(b^c)}\)
  3. Unary minus / signs — careful interaction with exponents (see below)
  4. Multiplication and divisionleft to right (same precedence)
  5. Addition and subtractionleft to right (same precedence)

PEMDAS/BODMAS is incomplete if you forget that \(\times\) and \(\div\) share a level, and \(+\) and \(-\) share a level. Always scan left to right within a level.

Programming note: languages define their own precedence tables. When unsure, parenthesize. Mathematics and code are not guaranteed to match on unary minus and exponentiation.

Associativity and commutativity

Let \(\ast\) be a binary operation on a set.

  • Commutative: \(a\ast b = b\ast a\) for all \(a,b\).
  • Associative: \((a\ast b)\ast c = a\ast(b\ast c)\) for all \(a,b,c\).
Operation Commutative? Associative?
\(+\) yes yes
\(\times\) yes yes
\(-\) no no
\(\div\) no no

Counterexamples (associativity).

\[(5-3)-1=1,\qquad 5-(3-1)=3,\] so \((a-b)-c\neq a-(b-c)\) in general.

\[(16\div 4)\div 2=2,\qquad 16\div(4\div 2)=8.\]

Counterexamples (commutativity). \(3-1\neq 1-3\); \(8\div 2\neq 2\div 8\).

Useful rewrite: define subtraction as adding the inverse, \[a-b := a+(-b).\] Then associativity of \(+\) yields \[(a-b)-c = a+(-b)+(-c)=a-(b+c),\] which is a reliable identity (both sides equal \(a-b-c\) in usual notation).

Theorem. Addition and multiplication on \(\mathbb{Z}\) are associative and commutative (taken as ring axioms / standard facts). Subtraction and division (where defined) are neither.

Unary minus and signs

\(-a\) is the additive inverse of \(a\), not “a binary minus stuck in front.”

Laws.

\[ \begin{align*} -(-a)&=a,\\ (-a)b &= -(ab) = a(-b),\\ (-a)(-b)&=ab,\\ -(a+b)&=(-a)+(-b)=-a-b. \end{align*} \]

Proof sketch of \((-a)(-b)=ab\).
\((-a)(-b)+(-a)b = (-a)\bigl((-b)+b\bigr)=(-a)\cdot 0=0\), so \((-a)(-b)\) is the additive inverse of \((-a)b=-(ab)\). The inverse of \(-(ab)\) is \(ab\). \(\square\)

Convention for \(-3^2\): in most school algebra and many languages that lack ** as a single operator binding tighter than unary minus, \(-3^2=-(3^2)=-9\), not \((-3)^2=9\). Write \((-3)^2\) if you mean the square of negative three.

Integer powers

For \(a\in\mathbb{Z}\) and \(n\) a nonnegative integer:

\[a^0=1\quad(a\neq 0\text{ in some contexts; }0^0\text{ left undefined}),\qquad a^{n+1}=a^n\cdot a.\]

For negative exponents (when \(a\neq 0\) and we allow rationals): \(a^{-n}=1/a^n\). Today stay mostly in nonnegative integer exponents.

Laws (integer \(m,n\ge 0\), with care at zero base):

\[a^m a^n=a^{m+n},\qquad (a^m)^n=a^{mn},\qquad (ab)^n=a^n b^n.\]

Exponent towers: for positive integers, \(a^{b^c}\) is almost always \(a^{(b^c)}\), not \((a^b)^c\). Note \((a^b)^c=a^{bc}\), while \(a^{(b^c)}\) grows much faster when bases and exponents exceed \(1\).

Nested parentheses and expression trees

An arithmetic expression can be viewed as a tree: leaves are integers (or variables later); internal nodes are operators. Evaluation is a post-order traversal: evaluate children, then apply the operator.

Example: \((3+4)\times(2-5)\)

  • Root: \(\times\)
  • Left child: \(+\) of \(3,4\)
  • Right child: \(-\) of \(2,5\)
  • Value: \(7\times(-3)=-21\)

Fully parenthesized forms remove all ambiguity. Precedence is a human/compiler convention that inserts the “missing” parentheses implicitly.

Absolute value

For \(x\in\mathbb{Z}\) (or \(\mathbb{R}\)),

\[|x|=\begin{cases}x & \text{if }x\ge 0,\\ -x & \text{if }x<0.\end{cases}\]

Axiomatic properties (all \(a,b\in\mathbb{Z}\)):

  1. \(|a|\ge 0\), and \(|a|=0\Leftrightarrow a=0\)
  2. \(|-a|=|a|\)
  3. \(|ab|=|a||b|\)
  4. \(|a+b|\le |a|+|b|\) (triangle inequality)

Theorem (triangle inequality). For all integers \(a,b\), \[|a+b|\le |a|+|b|.\]

Proof. Note \(-|a|\le a\le |a|\) and \(-|b|\le b\le |b|\). Adding: \[-(|a|+|b|)\le a+b\le |a|+|b|.\] If a number \(x\) satisfies \(-M\le x\le M\) with \(M\ge 0\), then \(|x|\le M\). Apply with \(x=a+b\) and \(M=|a|+|b|\). \(\square\)

Corollary. \(||a|-|b||\le |a-b|\) (reverse triangle). Sketch: \(|a|=|(a-b)+b|\le |a-b|+|b|\) so \(|a|-|b|\le |a-b|\); swap \(a,b\).

Worked examples

Example 1 — Precedence

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

Multiplication before addition: \(4\times 2=8\), then \(3+8=\mathbf{11}\).
(The incorrect left-to-right “add first” path gives \(14\).)

Example 2 — Left-to-right at one level

Evaluate \(16\div 4\div 2\).

Same precedence, left to right: \((16\div 4)\div 2 = 4\div 2 = \mathbf{2}\).
Not \(16\div(4\div 2)=8\).

Example 3 — Mixed chain

Evaluate \(7-3\times 2+8\div 4\).

First \(\times\) and \(\div\): \(3\times 2=6\), \(8\div 4=2\).
Expression becomes \(7-6+2\). Left to right: \((7-6)+2=1+2=\mathbf{3}\).

Example 4 — Nested parentheses

Evaluate \(2\bigl(3-(4-7)\bigr)^2\).

Innermost: \(4-7=-3\). Then \(3-(-3)=6\). Then \(6^2=36\). Then \(2\cdot 36=\mathbf{72}\).

Example 5 — Exponent tower vs power of a power

Compare \(2^{3^2}\) and \((2^3)^2\).

  • \(2^{3^2}=2^{(3^2)}=2^9=\mathbf{512}\).
  • \((2^3)^2=8^2=\mathbf{64}=2^{6}\).

Different expressions; never conflate them.

Example 6 — Unary minus vs parentheses

Evaluate \(-2^4\) and \((-2)^4\).

\(-2^4=-(2^4)=-16\).
\((-2)^4=16\).
Also \((-2)^3=-8\), while \(-2^3=-8\) (same in this case).

Example 7 — Signed arithmetic chain

Evaluate \(-3-(-5)+(-2)\times 4\).

Product first: \((-2)\times 4=-8\).
Then \(-3-(-5)+(-8)=-3+5-8=2-8=\mathbf{-6}\).

Example 8 — Integer powers and product law

Compute \(2^5\cdot 2^3\) and \((2^5)^3\).

\(2^5\cdot 2^3=2^{8}=256\).
\((2^5)^3=2^{15}=32768\).

Example 9 — Expression tree

Fully parenthesize \(a-b\times c+d\) under standard precedence as \((a-(b\times c))+d\), and evaluate at \(a=10\), \(b=3\), \(c=2\), \(d=1\): \((10-6)+1=\mathbf{5}\).

Example 10 — Absolute value

Compute \(|-7|\), \(|3-11|\), and \(|-3|\cdot|-4|\).

\(7\); \(|-8|=8\); \(3\cdot 4=12\). Check \(|(-3)(-4)|=|12|=12\).

Example 11 — Triangle inequality numeric check

For \(a=5\), \(b=-3\): \(|a+b|=|2|=2\), \(|a|+|b|=8\), and \(2\le 8\).
For \(a=-4\), \(b=-6\): \(|a+b|=10=|a|+|b|\) (equality when same sign).

Example 12 — Full parity proof

Claim. The sum of an even integer and an odd integer is odd.

Proof. Let \(m\) be even and \(n\) odd: \(m=2k\), \(n=2\ell+1\). Then \[m+n=2k+(2\ell+1)=2(k+\ell)+1,\] odd. \(\square\)

Example 13 — Product of odds

Claim. The product of two odds is odd.
Proof as in Theory (6). Numeric check: \(7\cdot 9=63=2\cdot 31+1\).

Example 14 — Identity for subtraction

Show \((a-b)-c=a-(b+c)\) for \(a=10\), \(b=3\), \(c=4\): left \(7-4=3\); right \(10-7=3\).

Exercises

Solve by hand. Show steps. Calculator only after you have an answer.

Easy

  1. Evaluate: \(7-3\times 2+8\div 4\).
  2. Evaluate: \((7-3)\times(2+8)\div 4\).
  3. Evaluate \(-5+(-3)\times 2\) and \(-5+(-3\times 2)\); are they equal?
  4. Compute \(|-12|\), \(|8-15|\), and \(|-2|^3\) (interpret carefully).
  5. Evaluate \(2^{4}\cdot 2^{3}\) and \((2^{4})^{3}\).

Medium

  1. Evaluate both \(2^{3\times 2}\) and \((2^3)\times 2\); compare with \(2^{3^2}\) under tower convention.
  2. Insert parentheses into \(6\div 2\times 3+1\) to obtain \(10\) if possible; also try to obtain \(4\). Write each fully parenthesized form.
  3. True or false: subtraction is associative. If false, give a concrete counterexample with integers.
  4. True or false: \((a-b)-c = a-(b+c)\) for all integers \(a,b,c\). Prove or disprove.
  5. Evaluate \(-2^4\) and \((-2)^4\). Explain the difference in words.
  6. If a language evaluated all binary ops strictly left-to-right with equal precedence (no PEMDAS), what would \(10-3\times 2\) become? What does standard math give?
  7. Draw (or describe) the expression tree for \((2+3)\times(4-1)^2\). Evaluate it.
  8. Prove: \(|ab|=|a||b|\) for all integers \(a,b\) (case analysis on signs, or use \(a=\pm|a|\)).

Hard / proof

  1. Prove: the product of two odd integers is odd. (Use \(2k+1\) forms.)
  2. Prove: the sum of two even integers is even; the sum of two odd integers is even.
  3. Prove: \(n\) is even if and only if \(n^2\) is even. (Both directions; one uses contrapositive or cases.)
  4. Prove the triangle inequality \(|a+b|\le|a|+|b|\) as in the Theory section, writing every step.
  5. Prove \(||a|-|b||\le|a-b|\).
  6. Disambiguate each plain-text string with parentheses in two different ways and evaluate both:
    1. 8/2/2 (b) 2^3^2 (c) -3^2+1
  7. Show that the average of two integers need not be an integer; relate to “not closed under division.”

Challenge / CS-flavored

  1. An array is \(0\)-indexed with length \(n=10\). The last valid index is \(n-1\). Explain why \(n-1\) is not “subtract first then …”; it is ordinary arithmetic. What goes wrong if someone writes \(n+1\) for the last index?
  2. Invent three integer expressions that look “obvious” but trip precedence; write the correct value and the common wrong value.
  3. Prove: if \(a\) and \(b\) are both even or both odd, then \(a+b\) is even and \(a-b\) is even. (Same parity \(\Rightarrow\) difference even.)
  4. For \(a=100\), \(b=-37\), verify triangle inequality and compute the “slack” \((|a|+|b|)-|a+b|\).
  5. Explain why \(0\) is even using the definition \(n=2k\). Is \(0\) positive? Negative? Neither?

CS connection

Operator precedence and integer overflow are everyday programming footguns. Expression trees in compilers are built from formal precedence/associativity tables; when humans and languages disagree, bugs appear as “off by a factor of two” or wrong branch conditions. Absolute value and triangle-style bounds appear in distance metrics, error analysis, and complexity inequalities. Prefer parentheses for anything non-trivial, and never assume school PEMDAS matches your language’s unary-minus or exponent rules. Parity arguments show up in hashing, tiling proofs, and “two-color” invariants.

Common pitfalls

Pitfall What to do instead
Doing \(+\) before \(\times\) Apply precedence deliberately; rewrite in steps
Treating \(\div\) chain as right-to-left Same level → left to right
Assuming \(a^{b^c}=(a^b)^c\) Use tower convention or force parentheses
\(-3^2\) vs \((-3)^2\) Square first unless parentheses group the minus
Sign errors with double minus Rewrite \(a-(-b)\) as \(a+b\)
“Proof by example” for parity laws Use \(2k\) / \(2k+1\) definitions
Forgetting \(|x|\) is never negative \(|x|\ge 0\) always
Claiming subtraction is associative Counterexample with concrete integers

Checkpoint

  • State the ring-like properties of \(\mathbb{Z}\) (closure, identities, inverses for \(+\))
  • State precedence levels from memory (including left-to-right within a level)
  • Evaluate a mixed \(+,-,\times,\div\) chain without a calculator
  • Explain exponent tower convention and give a numeric example
  • Prove all six parity sum/product cases from definitions (or write them cleanly once)
  • State and prove \(|a+b|\le|a|+|b|\)
  • Describe an expression as a tree and evaluate post-order
  • Write one sentence on why parentheses matter in code and math

Write two takeaways in your own words.

Tomorrow

Day 2 — Fractions & rationals. Equality via cross-multiplication, field operations on \(\mathbb{Q}\), reducing by gcd, mixed numbers, complex fractions, rates, density of \(\mathbb{Q}\), and a light look at Egyptian fractions.


Day 2 — Fractions & rationals

Stage I · concept day
Goal: Define \(\mathbb{Q}\) as a field of fractions; prove equality via \(ad=bc\); reduce by gcd; master mixed numbers, complex fractions, rates/proportions; sketch density of \(\mathbb{Q}\); see one Egyptian fraction decomposition.

Why this matters

Rationals are the language of slopes, probabilities (ratios of counts), normalized quantities, unit conversions, and fixed-point thinking. If fraction arithmetic is shaky, every later manipulation of \(\frac{p(x)}{q(x)}\) will feel harder than it is. Division algorithms, sampling rates, and “\(k\) of \(n\) succeed” all live in \(\mathbb{Q}\).

Theory

Rational numbers as a field

A rational number is a quotient of integers with nonzero denominator:

\[\mathbb{Q} = \Bigl\{\frac{p}{q} : p\in\mathbb{Z},\; q\in\mathbb{Z}\setminus\{0\}\Bigr\}.\]

The same rational has many names: \(\frac{1}{2}=\frac{2}{4}=\frac{-3}{-6}\).

\(\mathbb{Q}\) with \(+\) and \(\times\) is a field: closed under the four arithmetic operations (except divide-by-zero), associative and commutative as appropriate, distributive, with identities \(0,1\) and additive inverses, and every nonzero element has a multiplicative inverse.

Multiplicative inverse: if \(\frac{a}{b}\neq 0\) (so \(a\neq 0\)), then \(\bigl(\frac{a}{b}\bigr)^{-1}=\frac{b}{a}\).

Equality (cross-multiplication test)

For \(b,d\neq 0\),

\[\frac{a}{b}=\frac{c}{d}\quad\Longleftrightarrow\quad ad=bc.\]

Proof. \[ \frac{a}{b}-\frac{c}{d}=\frac{ad-bc}{bd}. \] This difference is \(0\) if and only if the numerator is \(0\) (since \(bd\neq 0\)). So \(\frac{a}{b}=\frac{c}{d}\) iff \(ad-bc=0\) iff \(ad=bc\). \(\square\)

Corollary. \(\frac{a}{b}=\frac{ka}{kb}\) for any integer \(k\neq 0\) (cancel common factors / scale).

Lowest terms and gcd

A fraction \(\frac{p}{q}\) with \(q>0\) is in lowest terms (canonical form) when \(\gcd(|p|,q)=1\).
Any nonzero rational has a unique such representation with positive denominator (unique \(p\in\mathbb{Z}\), \(q\in\mathbb{Z}_{>0}\)).

To reduce: compute \(d=\gcd(|p|,|q|)\), divide numerator and denominator by \(d\), then fix the sign so the denominator is positive.

Example of uniqueness idea: if \(\frac{p}{q}=\frac{r}{s}\) with \(\gcd(|p|,q)=\gcd(|r|,s)=1\) and \(q,s>0\), then \(ps=qr\). Since \(p\) and \(q\) share no common prime factors, \(q\) divides \(s\), and similarly \(s\) divides \(q\), so \(q=s\) and \(p=r\).

Field operations (formulas)

For \(b,d\neq 0\) (and \(c\neq 0\) when dividing by \(\frac{c}{d}\)):

\[ \begin{align*} \frac{a}{b}+\frac{c}{d}&=\frac{ad+bc}{bd},\\ \frac{a}{b}-\frac{c}{d}&=\frac{ad-bc}{bd},\\ \frac{a}{b}\cdot\frac{c}{d}&=\frac{ac}{bd},\\ \frac{a}{b}\div\frac{c}{d}&=\frac{a}{b}\cdot\frac{d}{c}=\frac{ad}{bc}. \end{align*} \]

Strategy: reduce intermediate fractions when possible; for addition, use least common multiple of denominators for smaller intermediates: \[\frac{a}{b}+\frac{c}{d}=\frac{a(d/\gcd)+c(b/\gcd)}{\operatorname{lcm}(b,d)}\] when \(b,d>0\) (using \(\operatorname{lcm}(b,d)=bd/\gcd(b,d)\) — Day 4).

Mixed numbers

A mixed number \(n\frac{a}{b}\) (with \(n\in\mathbb{Z}_{\ge 0}\), \(0\le a<b\)) means \(n+\frac{a}{b}=\frac{nb+a}{b}\).

Convert mixed \(\to\) improper: \(3\frac{2}{5}=\frac{17}{5}\).
Convert improper \(\to\) mixed: \(\frac{17}{5}=3+\frac{2}{5}=3\frac{2}{5}\).

In algebra and CS, prefer improper fractions for calculation; mixed form is for human display.

Complex fractions

A complex fraction has a fraction in numerator, denominator, or both:

\[\frac{\frac{a}{b}}{\frac{c}{d}}=\frac{a}{b}\div\frac{c}{d}=\frac{ad}{bc},\qquad \frac{a+\frac{b}{c}}{d}=\frac{\frac{ac+b}{c}}{d}=\frac{ac+b}{cd}.\]

Clear by multiplying top and bottom by a common denominator of all “inner” denominators.

Rates and proportions

A ratio \(a:b\) is the rational \(\frac{a}{b}\) (when \(b\neq 0\)).
A proportion is an equality of ratios: \(\frac{a}{b}=\frac{c}{d}\).

Cross-multiply to solve: if \(\frac{x}{12}=\frac{5}{8}\), then \(8x=60\), \(x=\frac{15}{2}\).

Rate: quantity per unit (speed \(= \frac{\text{distance}}{\text{time}}\)). Unit analysis is fraction cancellation of units.

Density of \(\mathbb{Q}\) (sketch)

Theorem (density of rationals in reals — sketch). Between any two reals \(x<y\) there exists a rational \(q\) with \(x<q<y\).

Idea. Choose integer \(n\) large enough that \(\frac{1}{n}<y-x\). Among the multiples of \(\frac{1}{n}\), some \(\frac{m}{n}\) lands in \((x,y)\). (Full real-analysis construction uses Archimedean property.)

Consequence for CS intuition: finite decimals and floats are a discrete grid; true \(\mathbb{Q}\) is dense — there is always a rational between two values, so “next rational” is meaningless without a fixed denominator.

Egyptian fractions (lite)

An Egyptian fraction representation writes a positive rational as a sum of distinct unit fractions \(\frac{1}{n_i}\).

Example. \(\frac{3}{4}=\frac{1}{2}+\frac{1}{4}\).
Greedy idea (Fibonacci–Sylvester): for \(\frac{a}{b}\) in \((0,1)\), take \(\frac{1}{\lceil b/a\rceil}\), subtract, repeat.

One step: \(\frac{3}{7}\): \(\lceil 7/3\rceil=3\), so \(\frac{1}{3}\); remainder \(\frac{3}{7}-\frac{1}{3}=\frac{2}{21}\); then \(\lceil 21/2\rceil=11\), etc. You need only one full worked example today, not a complete algorithm proof.

Ordering rationals

\(\frac{a}{b}<\frac{c}{d}\) (with \(b,d>0\)) iff \(ad<bc\). Signs and negative denominators require care: always reduce to positive denominators first.

Worked examples

Example 1 — Equality test

Is \(\frac{14}{21}=\frac{10}{15}\)? Cross: \(14\cdot 15=210\), \(21\cdot 10=210\). Yes. Both reduce to \(\frac{2}{3}\).

Example 2 — Reduce

Reduce \(\frac{84}{126}\). \(\gcd(84,126)=42\), so \(\frac{84/42}{126/42}=\frac{2}{3}\).

Example 3 — Add with LCD

\(\frac{2}{15}+\frac{4}{9}\). \(\operatorname{lcm}(15,9)=45\).
\(\frac{2\cdot 3}{45}+\frac{4\cdot 5}{45}=\frac{6+20}{45}=\frac{26}{45}\).

Example 4 — Subtract negatives

\(\frac{-3}{4}-\frac{5}{6}=\frac{-9-10}{12}=\frac{-19}{12}\).

Example 5 — Multiply and divide

\(\frac{6}{35}\cdot\frac{14}{9}=\frac{6\cdot 14}{35\cdot 9}\). Cancel \(7\): \(\frac{6\cdot 2}{5\cdot 9}=\frac{12}{45}=\frac{4}{15}\).
\(\frac{6}{35}\div\frac{9}{14}=\frac{6}{35}\cdot\frac{14}{9}=\frac{6\cdot 14}{35\cdot 9}=\frac{4}{15}\) after canceling.

Example 6 — Mixed numbers

\(2\frac{1}{3}+1\frac{3}{4}=\frac{7}{3}+\frac{7}{4}=\frac{28+21}{12}=\frac{49}{12}=4\frac{1}{12}\).

Example 7 — Complex fraction

Simplify \(\dfrac{1+\frac{1}{2}}{1-\frac{1}{3}}\).
Numerator \(\frac{3}{2}\), denominator \(\frac{2}{3}\), quotient \(\frac{3}{2}\cdot\frac{3}{2}=\frac{9}{4}\).
Alternatively multiply top and bottom by \(6\): \(\frac{6+3}{6-2}=\frac{9}{4}\).

Example 8 — Nested complex

\(\dfrac{\frac{2}{3}-\frac{1}{4}}{\frac{5}{6}}=\frac{\frac{8-3}{12}}{\frac{5}{6}}=\frac{\frac{5}{12}}{\frac{5}{6}}=\frac{5}{12}\cdot\frac{6}{5}=\frac{1}{2}\).

Example 9 — Proportion

If \(3\) of \(8\) packets fail and the failure rate stays proportional, about how many of \(120\) fail? \(\frac{x}{120}=\frac{3}{8}\Rightarrow x=45\).

Example 10 — Rate

A link transfers \(150\) MB in \(40\) seconds. Rate \(= \frac{150}{40}=\frac{15}{4}\) MB/s \(=3.75\) MB/s. Time for \(90\) MB: \(90\div\frac{15}{4}=90\cdot\frac{4}{15}=24\) s.

Example 11 — Density sketch

Between \(0.1\) and \(0.11\), the rational \(\frac{1}{10}+\frac{1}{200}=\frac{21}{200}=0.105\) works. Or \(\frac{105}{1000}=\frac{21}{200}\).

Example 12 — Egyptian fraction

\(\frac{3}{4}=\frac{1}{2}+\frac{1}{4}\). Check: \(\frac{2+1}{4}=\frac{3}{4}\).
Greedy for \(\frac{4}{13}\): \(\lceil 13/4\rceil=4\), take \(\frac{1}{4}\); remainder \(\frac{4}{13}-\frac{1}{4}=\frac{3}{52}\); continue if desired.

Example 13 — Order

Compare \(\frac{5}{7}\) and \(\frac{7}{10}\): \(5\cdot 10=50\), \(7\cdot 7=49\), so \(\frac{5}{7}>\frac{7}{10}\).

Example 14 — Inverse and field

Multiplicative inverse of \(-\frac{3}{8}\) is \(-\frac{8}{3}\). Product: \(\bigl(-\frac{3}{8}\bigr)\bigl(-\frac{8}{3}\bigr)=1\).

Exercises

Easy

  1. Test equality: \(\frac{15}{25}\) vs \(\frac{9}{15}\); reduce both.
  2. Compute \(\frac{2}{3}+\frac{5}{6}\) and reduce.
  3. Compute \(\frac{7}{8}\cdot\frac{4}{21}\).
  4. Convert \(5\frac{2}{7}\) to improper; convert \(\frac{47}{6}\) to mixed.
  5. Compute \(\frac{5}{9}\div\frac{10}{3}\).

Medium

  1. Prove carefully that \(\frac{a}{b}=\frac{c}{d}\) iff \(ad=bc\) for \(b,d\neq 0\).
  2. Simplify \(\dfrac{\frac{3}{4}+\frac{1}{6}}{\frac{5}{12}-\frac{1}{8}}\).
  3. Evaluate \(\frac{-2}{15}-\frac{4}{9}+\frac{1}{5}\); reduce.
  4. Solve the proportion \(\frac{x-1}{6}=\frac{2x+1}{15}\).
  5. A job takes \(12\) person-hours. What fraction of the job do \(5\) people do in \(2\) hours (assuming equal constant rate)?
  6. Show \(\frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}\) by using a common denominator.
  7. Reduce \(\frac{360}{504}\) by prime factors or Euclidean gcd steps.
  8. Write \(\frac{5}{6}\) as an Egyptian sum of distinct unit fractions (not necessarily greedy).

Hard

  1. Prove: if \(\frac{p}{q}\) is in lowest terms and \(q>0\), and \(\frac{p}{q}=\frac{r}{s}\) with \(s>0\) and \(\gcd(|r|,s)=1\), then \(p=r\) and \(q=s\).
  2. Between \(\frac{1}{3}\) and \(\frac{1}{2}\), find three distinct rationals. Explain a general method using midpoints repeatedly.
  3. Prove that if \(b,d>0\), then \(\frac{a}{b}<\frac{c}{d}\) iff \(ad<bc\).
  4. Simplify \(\dfrac{1}{1+\dfrac{1}{1+\dfrac{1}{2}}}\) to a single fraction.
  5. Rate: \(A\) finishes a task in \(6\) hours, \(B\) in \(4\) hours. Working together at constant rates, what fraction per hour, and how long for one task?
  6. Show that the sum of two rationals is rational; the product of two rationals is rational (closure proofs with formulas).
  7. Disprove: “between two rationals there are only finitely many rationals.”

Challenge / CS-flavored

  1. A progress bar shows \(\frac{7}{32}\) complete. What percent (exact fraction then decimal)? How many of \(256\) equal parts?
  2. Fixed-point: values stored as integer thousandths. What rational is the integer \(137\) representing? Add “\(0.25\)” in this system.
  3. Why is \(\frac{1}{2}+\frac{1}{3}+\frac{1}{6}=1\) useful for splitting a whole into unit fractions? Connect to Egyptian style.
  4. Prove \(\frac{a}{b}-\frac{c}{d}=\frac{ad-bc}{bd}\).
  5. If a hash table load factor is \(\alpha=\frac{n}{m}=\frac{5}{8}\), and \(m=1024\), find \(n\). If \(n\) grows by \(10\%\), what is new \(\alpha\) as a fraction in lowest terms?

Additional identities and techniques

Negatives. \(\frac{-a}{b}=\frac{a}{-b}=-\frac{a}{b}\). Prefer a single minus in the numerator with \(b>0\).

Multiplicative cancellation. If \(k\neq 0\), then \(\frac{ka}{kb}=\frac{a}{b}\). Never cancel addends: \(\frac{a+c}{b+c}\neq\frac{a}{b}\) in general.

Mediant (optional curiosity). The mediant of \(\frac{a}{b}\) and \(\frac{c}{d}\) (positive denominators) is \(\frac{a+c}{b+d}\), which lies between them. Used in Farey sequences and continued-fraction intuition—not a field operation.

Continued fraction lite. \(1+\frac{1}{2+\frac{1}{2}}=\frac{7}{5}\). Nested unit structure connects to Egyptian/greedy ideas and Diophantine approximation (advanced).

More worked reasoning (patterns)

Pattern A — clear complex fraction by LCD.
\(\dfrac{\frac{a}{b}+\frac{c}{d}}{\frac{e}{f}}\): multiply top and bottom by \(bdf\) in one stroke when all letters nonzero.

Pattern B — proportion cross.
\(\frac{a}{b}=\frac{c}{d}\Rightarrow ad=bc\) even when solving for a letter inside \(a\) or \(c\).

Pattern C — rate composition.
If \(A\) does a job in \(p\) hours and \(B\) in \(q\) hours, together rate \(\frac{1}{p}+\frac{1}{q}=\frac{p+q}{pq}\) jobs per hour; time \(\frac{pq}{p+q}\).

Pattern D — density construction.
Given \(x<y\) rationals, midpoint \(\frac{x+y}{2}\) is rational and strictly between them; iterate for infinitely many.

Pattern E — Egyptian non-uniqueness.
\(\frac{3}{4}=\frac{1}{2}+\frac{1}{4}=\frac{1}{3}+\frac{1}{4}+\frac{1}{6}\) (check). Representations need not be unique.

Mini-proofs to internalize

  1. Closure under \(+\). \(\frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}\) with \(bd\neq 0\) is a ratio of integers.
  2. Closure under \(\times\). \(\frac{ac}{bd}\) likewise.
  3. Inverse. Nonzero \(\frac{a}{b}\) has inverse \(\frac{b}{a}\) because product is \(1\).
  4. Cross-equality. Already proved via difference formula.

Extra exercises (for volume practice)

  1. Prove \(\frac{a}{b}-\frac{c}{d}=\frac{ad-bc}{bd}\) from the addition formula.
  2. Simplify \(\dfrac{1-\frac{1}{n}}{1+\frac{1}{n}}\) for integer \(n>1\).
  3. A tank fills at \(\frac{1}{6}\) per hour and leaks at \(\frac{1}{8}\) per hour; net rate and hours to fill from empty.
  4. Show that \(\frac{p}{q}\) in lowest terms is an integer iff \(q=1\).
  5. Between \(\frac{22}{7}\) and \(\frac{333}{106}\), find one rational (midpoint OK).

CS connection

Fractions appear as load factors, sampling rates, aspect ratios, time quanta, and rational slopes in graphics. Exact rational arithmetic (big integers for numerator/denominator) avoids floating-point drift when it matters (geometry predicates, some financial ledgers). Proportions solve “scale this recipe” problems in resource allocation. Density of \(\mathbb{Q}\) reminds you that “the next number after \(x\)” only makes sense on a discrete type (integers, fixed-precision floats), not on true rationals.

Common pitfalls

Pitfall What to do instead
Adding denominators: \(\frac{1}{2}+\frac{1}{3}=\frac{2}{5}\) Common denominator: \(\frac{3+2}{6}=\frac{5}{6}\)
Canceling terms across \(+\) Only cancel factors of whole numerator/denominator
Forgetting signs when reducing Put the minus in the numerator; keep \(q>0\)
Mixed number \(2\frac{1}{3}\) as \(2\cdot\frac{1}{3}\) It means \(2+\frac{1}{3}\)
Complex fraction paralysis Multiply top and bottom by LCD of inner denominators
Cross-multiplying inequalities with negatives Flip inequality if multiplying by negative quantity
Assuming “unique next rational” Density: infinitely many between any two

End-of-day synthesis problems

S1. Prove \(\frac{a}{b}=\frac{c}{d}\Leftrightarrow ad=bc\) carefully; apply to \(\frac{21}{28}\) vs \(\frac{15}{20}\).

S2. Compute \(\frac{5}{6}-\frac{7}{15}+\frac{1}{10}\) reduced.

S3. Complex fraction \(\dfrac{\frac{3}{4}-\frac{1}{6}}{1+\frac{1}{2}}\) simplified.

S4. Work rates: \(A\) alone \(8\) h, \(B\) alone \(12\) h; hours together.

S5. Midpoint method: three rationals between \(\frac{1}{5}\) and \(\frac{1}{4}\).

S6. Egyptian: write \(\frac{5}{6}\) as sum of distinct unit fractions two different ways if possible.

S7. Invert \(-\frac{14}{9}\); verify product \(1\).

S8. Load factor \(\frac{n}{m}=\frac{3}{5}\) with \(m=512\); find \(n\).

Checkpoint

  • Define \(\mathbb{Q}\) and state what “field” means at a practical level
  • Prove equality \(\Leftrightarrow ad=bc\)
  • Add, multiply, divide fractions and reduce by gcd
  • Convert mixed \(\leftrightarrow\) improper
  • Simplify a complex fraction
  • Solve a proportion / rate problem
  • Sketch why rationals are dense
  • Write one Egyptian decomposition
  • S1–S3 exam-ready

Write two takeaways in your own words.

Deep dive — more worked reasoning

D1 — Clear a nested complex fraction in one LCD.
Simplify \(\dfrac{\dfrac{1}{2}+\dfrac{1}{3}}{\dfrac{1}{4}-\dfrac{1}{6}}\).
Inner numerator \(\frac{3+2}{6}=\frac{5}{6}\); denominator \(\frac{3-2}{12}=\frac{1}{12}\); quotient \(\frac{5}{6}\cdot 12=\frac{5}{6}\cdot\frac{12}{1}=10\).
One stroke: multiply top and bottom by \(12\): \(\dfrac{6+4}{3-2}=\dfrac{10}{1}=10\).

D2 — Proportion with a linear expression.
\(\frac{2x+1}{5}=\frac{x-3}{2}\). Cross-multiply: \(2(2x+1)=5(x-3)\), \(4x+2=5x-15\), \(17=x\). Check: \(\frac{35}{5}=7\), \(\frac{14}{2}=7\).

D3 — Work rates three agents (optional stretch).
\(A\) alone \(6\) h, \(B\) alone \(8\) h, \(C\) alone \(24\) h. Together rate \(\frac{1}{6}+\frac{1}{8}+\frac{1}{24}=\frac{4+3+1}{24}=\frac{8}{24}=\frac{1}{3}\) job/h → \(3\) hours for one job.

D4 — Ordering with negatives.
Compare \(-\frac{5}{6}\) and \(-\frac{4}{5}\) with positive denominators: \(-\frac{5}{6}<-\frac{4}{5}\) because \(\frac{5}{6}>\frac{4}{5}\) (cross: \(25>24\)). Taking negatives reverses order.

Extra practice set (post-checkpoint)

  1. Simplify \(\dfrac{\frac{2}{5}-\frac{1}{10}}{\frac{3}{4}}\) and reduce.
  2. Solve \(\frac{3x-1}{4}=\frac{x+5}{6}\).
  3. Prove closure of \(\mathbb{Q}\) under division by a nonzero rational.
  4. Between \(\frac{2}{5}\) and \(\frac{3}{7}\), produce two distinct rationals (midpoint and mediant both OK).
  5. A pipeline delivers \(\frac{2}{3}\) of capacity for \(3\) hours and \(\frac{1}{2}\) for \(2\) hours; total “capacity-hours” as a single fraction.

Tomorrow

Day 3 — Decimals, percent, scientific notation. Terminating vs repeating decimals, fraction\(\leftrightarrow\)decimal, percent change, compound percent, scientific notation operations, order of magnitude, significant figures.


Day 3 — Decimals, percent & scientific notation

Stage I · concept day
Goal: Convert between fractions and decimals; classify terminating vs repeating; master percent and compound percent; operate in scientific notation; use order of magnitude and significant-figure discipline.

Why this matters

Humans read decimals and percents; machines store binary fractions and scaled exponents. Misreading \(0.1\), “\(20\%\) off then \(20\%\) off,” or \(3.2\times 10^{-3}\) causes off-by-factor bugs in metrics, money display, and logs. This day builds reliable conversion and estimation.

Theory

Place value (base 10)

A finite decimal \(d_k\ldots d_0.d_{-1}d_{-2}\ldots d_{-m}\) means

\[\sum_{i=-m}^{k} d_i\,10^{i},\qquad d_i\in\{0,1,\ldots,9\}.\]

Example: \(32.07=3\cdot 10+2\cdot 1+0\cdot 10^{-1}+7\cdot 10^{-2}\).

Terminating vs repeating decimals

A terminating decimal has finitely many nonzero digits after the point: \(0.25=\frac{1}{4}\).
A repeating (recurring) decimal eventually cycles: \(0.\overline{3}=0.333\ldots=\frac{1}{3}\), \(0.1\overline{6}=0.1666\ldots=\frac{1}{6}\).

Theorem (characterization, sketch). A reduced fraction \(\frac{p}{q}\) with \(q>0\) and \(\gcd(p,q)=1\) has a terminating decimal expansion iff the prime factors of \(q\) lie in \(\{2,5\}\) only (i.e. \(q=2^a 5^b\) for some \(a,b\ge 0\)).

Why. Terminating means \(\frac{p}{q}=\frac{n}{10^m}=\frac{n}{2^m 5^m}\) for some \(n,m\), so \(q\) divides \(2^m 5^m\) after canceling factors with \(p\)—hence only primes \(2\) and \(5\) in \(q\).

Otherwise the expansion is infinite and eventually periodic (long division of \(p\) by \(q\) has finitely many remainders \(0,\ldots,q-1\); once a remainder repeats, the digit cycle repeats). Remainder \(0\) \(\Leftrightarrow\) terminates.

Fraction \(\to\) decimal

Long division: divide \(p\) by \(q\), record remainders.
Examples: \(\frac{3}{8}=0.375\) (terminates). \(\frac{2}{11}=0.\overline{18}\).

Decimal \(\to\) fraction

Terminating: \(0.d_1\ldots d_m=\frac{d_1\ldots d_m}{10^m}\), then reduce.
Pure repeat \(0.\overline{d_1\ldots d_k}=\frac{N}{10^k-1}\) where \(N\) is the \(k\)-digit block as integer.
Example: \(0.\overline{27}=\frac{27}{99}=\frac{3}{11}\).

Mixed repeat \(0.ab\overline{cde}\): let \(x\) be the value; multiply by powers of \(10\) to align periods, subtract (standard algebra).

Percent

Percent means “per hundred”:

\[r\% = \frac{r}{100}.\]

So \(15\%=0.15=\frac{3}{20}\).
\(p\%\) of \(A\)” means \(\frac{p}{100}\cdot A\).

Percent change

If a quantity goes from \(A\) to \(B\):

\[\text{relative change}=\frac{B-A}{A},\qquad \text{percent change}=100\cdot\frac{B-A}{A}\%.\]

Increase if \(B>A\); decrease if \(B<A\). Base matters: \(100\to 80\) is \(-20\%\); \(80\to 100\) is \(+25\%\).

Compound percent

Applying successive factors multiplies:

\[A\mapsto A\bigl(1+\tfrac{r_1}{100}\bigr)\bigl(1+\tfrac{r_2}{100}\bigr)\cdots.\]

Not additive: \(10\%\) then \(10\%\) is factor \(1.1\times 1.1=1.21\), i.e. \(21\%\) total, not \(20\%\).

Discount then tax order matters in general if rates apply to different bases; track the actual quantity each rate multiplies.

Scientific notation

A positive number in scientific notation is \(m\times 10^{e}\) with \(1\le m<10\) (normalized) and \(e\in\mathbb{Z}\).
(Engineering notation sometimes uses exponents multiple of \(3\).)

Operations:

\[ \begin{align*} (a\times 10^{m})(b\times 10^{n})&=(ab)\times 10^{m+n},\\ \frac{a\times 10^{m}}{b\times 10^{n}}&=\frac{a}{b}\times 10^{m-n},\\ (a\times 10^{m})+(b\times 10^{n})&=\text{align exponents first}. \end{align*} \]

Renormalize so the mantissa is in \([1,10)\).

Order of magnitude

The order of magnitude is roughly the power of ten: \(\lfloor\log_{10} x\rfloor\) for \(x>0\).
\(3\times 10^{4}\) and \(7\times 10^{4}\) are the same order of magnitude; \(3\times 10^{5}\) is one higher. Used for sanity checks (“is this megabytes or gigabytes?”).

Significant figures (discipline)

Significant figures count digits that carry meaning in a measurement or rounded value.

Rules of thumb:

  • Nonzero digits are significant.
  • Zeros between nonzero digits are significant.
  • Leading zeros after the decimal are not significant (\(0.0032\) has \(2\) sig figs).
  • Trailing zeros in a decimal are significant (\(1.200\) has \(4\)).
  • Trailing zeros in integers may be ambiguous (\(1200\)); scientific notation \(1.20\times 10^{3}\) clarifies \(3\) sig figs.

Arithmetic discipline (intro): when multiplying/dividing, result sig figs \(\approx\) min of inputs; when adding, align decimal places (least precise place). Today: awareness and honest reporting, not legalistic lab protocol.

Worked examples

Example 1 — Terminating conversion

\(\frac{7}{20}=0.35\) because \(\frac{7}{20}=\frac{35}{100}\). Denominator \(20=2^2\cdot 5\), only primes \(2,5\).

Example 2 — Repeating conversion

\(\frac{1}{6}=0.1\overline{6}\). Long division: \(1.000\div 6\)\(0.1666\ldots\).

Example 3 — Decimal to fraction

\(0.125=\frac{125}{1000}=\frac{1}{8}\).
\(0.\overline{1}=\frac{1}{9}\).
\(0.\overline{09}=\frac{9}{99}=\frac{1}{11}\).

Example 4 — Mixed repeat

Let \(x=0.1\overline{6}=0.1666\ldots\). Then \(10x=1.666\ldots\), \(100x=16.666\ldots\), so \(100x-10x=15\Rightarrow 90x=15\Rightarrow x=\frac{15}{90}=\frac{1}{6}\).

Example 5 — Percent of

\(18\%\) of \(250\): \(0.18\times 250=45\).

Example 6 — Percent change

Price \(80\to 100\): \(\frac{20}{80}=0.25=25\%\) increase.
Price \(100\to 80\): \(\frac{-20}{100}=-20\%\) decrease.

Example 7 — Compound percent

Start \(200\). Up \(10\%\), then down \(10\%\): \(200\times 1.1\times 0.9=200\times 0.99=198\neq 200\). Order both ways here gives same product of factors.

Example 8 — Two discounts

\(20\%\) off then extra \(10\%\) off list \(L\): pay \(L\times 0.8\times 0.9=0.72L\), i.e. \(28\%\) total off, not \(30\%\).

Example 9 — Scientific multiply

\((3.0\times 10^{4})(2.5\times 10^{-2})=7.5\times 10^{2}=750\).

Example 10 — Scientific divide and add

\(\frac{6.0\times 10^{-3}}{2.0\times 10^{2}}=3.0\times 10^{-5}\).
\(3.2\times 10^{3}+4.5\times 10^{2}=3.2\times 10^{3}+0.45\times 10^{3}=3.65\times 10^{3}\).

Example 11 — Order of magnitude

\(8.1\times 10^{6}\) bytes \(\approx\) order \(10^{6}\) (megabyte scale if \(10^{6}\) definition). \(2^{20}=1048576\approx 1.05\times 10^{6}\).

Example 12 — Fraction \(\leftrightarrow\) percent

\(\frac{3}{8}=0.375=37.5\%\).
\(12.5\%=\frac{12.5}{100}=\frac{1}{8}\).

Example 13 — Characterization check

\(\frac{1}{7}\) has denominator \(7\notin\{2,5\}\) primes → nonterminating (period \(6\): \(0.\overline{142857}\)).
\(\frac{3}{40}=\frac{3}{2^3\cdot 5}\) terminates: \(0.075\).

Example 14 — Sig figs

\(1.20\times 10^{3}\) has three significant figures. Product \(1.2\times 3.45\) with \(2\) and \(3\) sig figs → report \(\approx 4.1\) (two sig figs) as a rough rule.

Exercises

Easy

  1. Write \(0.45\) and \(2.05\) as reduced fractions.
  2. Convert \(\frac{5}{16}\) to a decimal.
  3. Convert \(36\%\) and \(2.5\%\) to fractions in lowest terms.
  4. What is \(15\%\) of \(80\)?
  5. Write \(45000\) and \(0.00032\) in normalized scientific notation.

Medium

  1. Convert \(0.\overline{36}\) to a reduced fraction.
  2. Convert \(0.2\overline{7}\) to a fraction (algebra method).
  3. Does \(\frac{9}{24}\) terminate? Reduce first, then apply the \(2\)\(5\) criterion.
  4. A value rises from \(40\) to \(50\), then falls back to \(40\). Percent changes each step? Net percent from original?
  5. Apply \(+5\%\) then \(+5\%\) to \(1000\); compare to a single \(+10\%\).
  6. Compute \((1.2\times 10^{-3})+(3.4\times 10^{-4})\) in scientific notation.
  7. \(\frac{6.0\times 10^{5}}{1.5\times 10^{-2}}\) in scientific notation.
  8. Express \(\frac{7}{11}\) as a repeating decimal (long division).

Hard

  1. Prove: if \(\gcd(p,q)=1\) and \(q=2^a 5^b\), then \(\frac{p}{q}\) terminates (produce an explicit denominator \(10^m\)).
  2. Explain why \(\frac{1}{3}+\frac{1}{3}+\frac{1}{3}\) in terminating decimal display can look like \(0.999\ldots\) vs \(1\) — connect to repeating nines.
  3. A store marks up cost \(C\) by \(25\%\) to get list price, then discounts list by \(25\%\). Express final price in terms of \(C\).
  4. Order of magnitude: estimate \(2^{30}\) using \(2^{10}\approx 10^{3}\).
  5. From \(A\) to \(B\) is \(+r\%\). What percent change goes from \(B\) back to \(A\)? (Formula in \(r\).)
  6. Classify \(\frac{21}{28}\) after reducing: terminating or not?
  7. Significant figures: which of \(0.00450\), \(450\), \(4.50\times 10^{2}\) has unambiguous three sig figs?

Challenge / CS-flavored

  1. Why can \(0.1+0.2\) in binary floating point fail to equal \(0.3\) exactly? (Connect to “denominator primes other than \(2\).”)
  2. A metric reports \(99.5\%\) success on \(n=200\) trials. How many successes? Can you recover an exact fraction?
  3. Latency \(3.2\times 10^{-3}\) s in ms? in μs?
  4. Compound: software license grows \(8\%\) per year for \(3\) years on base \(B\). Factor and expanded form \(B(1.08)^3\).
  5. Percent points vs percent: explain why “grew from \(10\%\) to \(12\%\)” is \(+2\) percentage points but \(+20\%\) relative change.

More conversion techniques

Long division remainder map. Remainders when dividing by \(q\) live in \(\{0,1,\ldots,q-1\}\). Period length of \(\frac{1}{q}\) (reduced, \(q\) coprime to \(10\)) divides \(\varphi(q)\) (Euler)—optional fact for culture, not required proof.

Scientific comparison. To compare \(a\times 10^{m}\) and \(b\times 10^{n}\) with \(1\le a,b<10\): if \(m>n\) then first is larger (same for normalized positives); if \(m=n\) compare mantissas.

Percent composition identities.

  • Successive factors: overall multiplier \(\prod(1+r_i)\).
  • \(p\%\) of \(q\%\) of \(A\)” means \(\frac{p}{100}\cdot\frac{q}{100}\cdot A\), not \(\frac{pq}{100}A\) unless one percent is \(1\).
  • Reverse percent: if after \(+r\%\) you have \(B\), original is \(B/(1+r/100)\) for \(r\neq -100\).

Order-of-magnitude arithmetic. Rough product: add exponents and rough-mantissa multiply. Sanity check algorithms and data sizes (\(2^{10}\approx 10^3\), \(2^{20}\approx 10^6\), \(2^{30}\approx 10^9\)).

Sig-fig worked discipline. \(12.3\times 4.56\) has three and three sig figs → product \(56.088\) reported as \(56.1\) under the min-sig-fig product rule of thumb. Addition: \(12.3+0.045=12.345\)\(12.3\) if tenths place limits.

Extra numeric drills

Drill 1. Convert \(\frac{5}{6}\), \(\frac{5}{7}\), \(\frac{5}{8}\) to decimals; classify terminating/repeating.
Drill 2. \(0.\overline{142857}=\frac{1}{7}\) check by \(1\div 7\).
Drill 3. Price \(P\), tax \(8\%\), then \(10\%\) tip on post-tax vs pre-tax—write both formulas.
Drill 4. \((6.02\times 10^{23})\times(3.0\times 10^{-2})\) order of magnitude.
Drill 5. Relative error when approximating \(\frac{1}{3}\) by \(0.333\).

Extra exercises

  1. Prove terminating criterion for reduced \(\frac{p}{q}\): if only primes \(2,5\) in \(q\), construct \(m\) with \(q\mid 10^m\).
  2. Convert \(0.1\overline{6}\) two ways (algebra alignment vs known \(\frac{1}{6}\)).
  3. A metric drops from \(99\%\) to \(97\%\) availability: percentage points vs relative percent change of downtime.
  4. Expand \((1+r)^2\) and interpret compound two-period growth.
  5. Write \(2^{-10}\) in scientific notation approximately using \(2^{10}\approx 10^3\).

CS connection

Floating-point numbers are binary scientific notation with fixed mantissa width (Day 9). Decimal \(0.1\) is repeating in binary—hence classic sum errors. Logs, metrics dashboards, and SLOs speak percent; capacity planning uses orders of magnitude. Scientific notation is how you read 1e-6 in code and SI prefixes (milli, micro, mega). Sig-fig discipline is honesty about measurement and rounded intermediates—not the same as exact integer arithmetic.

Common pitfalls

Pitfall What to do instead
Adding percents of different bases Convert each step to a multiply factor
\(20\%\) then \(20\%\) = \(40\%\) \(1.2\times 1.2=1.44\)
Moving decimal wrong in scientific notation Count places; renormalize mantissa to \([1,10)\)
Assuming all fractions terminate Only \(2\)\(5\) denominators (reduced)
Confusing percentage points with relative \(\%\) State base and formula
Treating \(0.999\ldots\) and \(1\) as “different reals” They are equal as real numbers
Spurious precision (many decimal places) Match significant figures to data quality

End-of-day synthesis problems (show full work)

S1. A laptop costs \(\$900\). Markup \(20\%\) to list, then holiday discount \(15\%\) off list. Final price? Overall percent change from cost?

S2. Convert \(0.\overline{27}\) and \(0.2\overline{7}\) to fractions; compare.

S3. Compute \(\dfrac{(4.0\times 10^{-3})(3.0\times 10^{5})}{6.0\times 10^{-2}}\) in scientific notation.

S4. Explain with prime factors why \(\frac{11}{28}\) does not terminate but \(\frac{11}{40}\) does.

S5. Population \(2.5\times 10^{4}\) grows \(4\%\) then \(4\%\) again. Exact factor and new population.

S6. Absolute and relative error when \(2^{10}\) is approximated by \(10^{3}\).

S7. Write a \(3\)-significant-figure scientific notation for \(0.00045678\).

S8. Chain: \(50\) increased by \(10\%\), decreased by \(10\%\), increased by \(10\%\). Final value?

Checkpoint

  • Convert fraction \(\leftrightarrow\) terminating/repeating decimal
  • State the \(2\)\(5\) criterion for terminating decimals
  • Compute percent of and percent change
  • Apply compound percent as product of factors
  • Multiply/divide/add in scientific notation
  • Estimate order of magnitude
  • Report a result with sensible significant figures
  • Complete synthesis problems S1–S4 without notes

Write two takeaways in your own words.

Deep dive — conversions, compound percent, sci-notation

D1 — Mixed repeating to fraction (full algebra).
Let \(x=0.23\overline{45}=0.23454545\ldots\). Then \(100x=23.454545\ldots\), \(10000x=2345.4545\ldots\).
Subtract: \(10000x-100x=2345.45\ldots-23.45\ldots=2322\), so \(9900x=2322\), \(x=\frac{2322}{9900}=\frac{387}{1650}=\frac{129}{550}\) after dividing by \(6\). (Reduce fully for your write-up.)

D2 — Terminating criterion with reduction first.
\(\frac{14}{35}\) reduces by \(7\) to \(\frac{2}{5}\); denominator \(5=5^1\) → terminates: \(0.4\). Without reducing you might wrongly stare at the \(7\) in \(35\).

D3 — Compound percent chain with three factors.
Start \(500\). Up \(20\%\), down \(10\%\), up \(5\%\):
\(500\times 1.2\times 0.9\times 1.05=500\times 1.134=567\).
Overall factor \(1.134\) means \(+13.4\%\) net, not \(20-10+5=15\%\).

D4 — Scientific addition with different exponents.
\((7.2\times 10^{-3})+(4.5\times 10^{-4})=7.2\times 10^{-3}+0.45\times 10^{-3}=7.65\times 10^{-3}\).
Renormalize only if mantissa leaves \([1,10)\).

D5 — Order of magnitude for \(2^{40}\).
\(2^{10}\approx 10^3\), so \(2^{40}=(2^{10})^4\approx (10^3)^4=10^{12}\). More tightly \(2^{10}=1024\approx 1.024\times 10^3\), so \(2^{40}\approx 1.1\times 10^{12}\).

D6 — Percentage points vs relative change (SLO story).
Availability \(99.0\%\to 99.5\%\) is \(+0.5\) percentage points. Relative change of availability is small; relative change of unavailability \(1.0\%\to 0.5\%\) is a \(50\%\) reduction in downtime fraction—always name the base quantity.

Extra practice set

  1. Convert \(0.\overline{142857}\) recognition: show \(1/7\) by long division remainders cycling.
  2. Markup \(30\%\) then discount \(30\%\) on cost \(C\): final price as fraction of \(C\).
  3. \((2.5\times 10^{4})\div(5.0\times 10^{-3})\) in scientific notation.
  4. Does \(\frac{15}{48}\) terminate? Reduce, then apply \(2\)\(5\) criterion.
  5. Round \(0.009876\) to \(3\) significant figures in scientific notation.

Tomorrow

Day 4 — Factors, primes & FTA. Primes and composites, sieve idea, fundamental theorem of arithmetic, Euclid’s infinite primes, gcd/lcm identities, coprimality.