imara learning library ← all courses
Math Foundations · refresher · self-paced

The school math you forgot, rebuilt from the ground up

Powers, logarithms, trigonometry, functions, the numerical-analysis toolkit — and now calculus, probability and statistics too. No fluff, no proofs for their own sake: intuition first, then a worked example you can follow line by line. The "oh right, that's what it means" course.

9
days, arithmetic through statistics
7
interactive widgets to poke at
3
on numerical analysis, calculus & probability
40+
worked examples with the arithmetic shown
Day 01the groundwork

Numbers, powers & roots

Everything later leans on powers and their rules. A power is just repeated multiplication — and once you see the handful of rules, they never need memorising again because they all come from that one fact.

What a power is

an means "multiply a by itself n times." So 23 = 2×2×2 = 8. The a is the base, the n is the exponent (or power, or index).

The rules — all from counting the multiplications

am · an = am+n    am / an = am−n    (am)n = am·n

Why? 22·23 is (2×2)×(2×2×2) — five 2's — so you add the exponents. Dividing cancels multiplications, so you subtract. A power of a power multiplies. Three special cases fall straight out:

Worked example
Simplify 23 · 24
= 23+4  →  add the exponents
= 27 = 128
And (103)2 = 103·2 = 106 = 1,000,000

Scientific notation — powers of 10 tame big and small numbers

Write any number as (a number between 1 and 10) × 10power. The power counts how many places the decimal point moves.

Worked example
5,230,000 → move the point left 6 places → 5.23 × 106
0.00042 → move the point right 4 places → 4.2 × 10−4
Multiplying? Add the powers: (3×104)(2×105) = 6×109

Order of operations — BODMAS

Brackets, Orders (powers/roots), Division & Multiplication, Addition & Subtraction. (Americans say PEMDAS — same thing.) Multiplication before addition is the one that trips everyone:

Worked example
2 + 3 × 4 = 2 + 12 = 14  (not 20 — the × happens first)
(2 + 3) × 4 = 5 × 4 = 20  (brackets force the + first)
Day 02the inverse of a power

Logarithms & exponentials

A logarithm sounds intimidating and is genuinely simple: it's the question "what power?" If powers ask "what is 10 cubed," logs ask the reverse — "10 to what gives 1000?"

The one definition to hold

logb(x) = y   means exactly   by = x"log base b of x" = "the power you raise b to, to get x"

So log10(1000) = 3 because 103 = 1000. And log2(8) = 3 because 23 = 8. That's the whole idea — a log is an exponent in disguise. Two facts follow immediately: logb(1) = 0 always (any base to the power 0 is 1), and logb(b) = 1.

The natural log and e

Two bases dominate. Base 10 (log) is the everyday one. Base e ≈ 2.718 — a special constant that shows up wherever things grow continuously — gives the natural log, written ln. So ln(e) = 1 and ln(e3) = 3. When a formula uses ln or log without a base, it almost always means natural log.

The rules — they turn multiplication into addition

log(a·b) = log a + log b    log(a/b) = log a − log b    log(an) = n·log a

These mirror the power rules exactly (because logs are exponents). The first is the historically famous one: before calculators, logs let people multiply huge numbers by adding — that's what slide rules and log tables did.

Worked example
log2(32) = ?  →  "2 to what gives 32?"   25=32 → 5
Using the rules: log10(200)
= log10(2 × 100) = log102 + log10100
≈ 0.301 + 2 = 2.301

Why anyone bothers with logs

Exponential & log are mirror images across y = x
The green curve is bx (shoots up); the gold curve is logb(x) (rises slowly). Fold the page along the dashed y = x line and they'd land on each other — that's what "inverse" means.
Day 03triangles & circles

Trigonometry: sin, cos, tan

Trigonometry connects angles to lengths. It starts with right triangles and three ratios, then the unit circle turns those ratios into something that works for any angle and gives you waves for free.

The three ratios — SOH-CAH-TOA

In a right triangle, label the sides relative to an angle θ: the hypotenuse (longest, opposite the right angle), the opposite (facing θ), and the adjacent (touching θ). Then:

sin θ = opp⁄hyp    cos θ = adj⁄hyp    tan θ = opp⁄adj = sin θ⁄cos θSOH · CAH · TOA — the mnemonic that has saved a million exams
Worked example — the 3-4-5 triangle
Sides: opposite = 3, adjacent = 4, hypotenuse = 5.
sin θ = 3/5 = 0.6
cos θ = 4/5 = 0.8
tan θ = 3/4 = 0.75
(θ ≈ 37°. A ladder 5 m long, base 4 m from a wall, reaches 3 m up.)

Degrees and radians

Two ways to measure an angle. Degrees are familiar (a full turn is 360°). Radians are the mathematician's unit, based on the circle itself: a full turn is 2π radians. The bridge you need:

180° = π radians  →  90° = π⁄2,   45° = π⁄4,   360° = 2π

The unit circle — trig for any angle

Draw a circle of radius 1. A point on it at angle θ has coordinates (cos θ, sin θ) — that's the definition that frees trig from triangles and lets angles go past 90°, negative, all the way around. tan θ is the slope of the radius line. Drag the point:

Unit circle · drag the point, read sin, cos, tan
The horizontal reach is cos, the vertical reach is sin. Notice cos and sin never leave −1…+1, while tan shoots to infinity near 90° and 270° (where the radius is vertical).

Key values worth knowing cold

θ0°30°45°60°90°
sin00.50.7070.8661
cos10.8660.7070.50
tan00.57711.732∞
Why it becomes waves

As the point goes round and round, its height (sin) rises and falls, rises and falls — tracing the smooth wave you've seen everywhere. That repetition (every 360°/2π) is why sin and cos describe anything cyclical: sound, tides, seasons, alternating current.

Day 04the glue

Functions & graphs

A function is just a rule that turns an input into exactly one output — a machine with a slot and a chute. Graphs are the picture of that rule. Getting fluent at reading the three common shapes makes everything else legible.

The idea

Write f(x) for "the output when the input is x." The rule f(x) = 2x + 1 takes 3 to 7. The only requirement to be a function: one input gives one output — no ambiguity.

Linear — constant change, a straight line

y = m·x + cm = slope (steepness), c = where it crosses the vertical axis

The slope m is "rise over run" — how much y changes for each step in x. Slope 2 means "up 2 for every 1 across." Constant slope is what makes it straight.

Worked example
f(x) = 2x + 1   slope 2, crosses y-axis at 1
x: 0 → 1 → 2 → 3
y: 1 → 3 → 5 → 7  (jumps by 2 each time — the slope)

Quadratic — a curve, a parabola

y = a·x2 + b·x + c makes a U-shaped curve (a parabola). The x2 term is what bends it; if a is negative the U flips upside down. This is the shape of a thrown ball's path.

Exponential — constant ratio, explosive growth

The crucial contrast with linear. Linear adds the same amount each step; exponential multiplies by the same factor each step.

Worked example — linear vs exponential
Linear 2x:   0, 2, 4, 6, 8, 10  (+2 each step)
Exponential 2x:   1, 2, 4, 8, 16, 32  (×2 each step)
By step 10: linear = 20, exponential = 1024. That gap is why "exponential" means "runaway."
The reading skill

Given a graph, ask one question: does it go up by a fixed amount (straight line, linear), curve gently (quadratic), or bend sharply upward and keep steepening (exponential)? Naming the shape tells you which rule is behind it — and, from Day 2, its log turns that exponential back into a readable straight line.

Day 05numerical analysis · part 1

Rounding & error

Real calculation almost never gives clean answers — it gives numbers you must round, and every rounding introduces error. Numerical analysis is the discipline of knowing how much error, and keeping it under control. This is where "the math" meets the real world.

Rounding: decimal places vs significant figures

Two different rulers. Decimal places (dp) counts digits after the point. Significant figures (sf) counts meaningful digits from the first non-zero one — better for expressing precision, because it doesn't care where the decimal point sits.

Worked example
3.14159 to 2 dp → 3.14  (look at the 3rd decimal, 1 < 5, round down)
3.14159 to 4 sf → 3.142  (4 significant digits: 3,1,4,1 — next is 5, round up)
0.004560 has 4 sig figs (4, 5, 6, 0 — leading zeros don't count, the trailing 0 does)

Absolute vs relative error — the distinction that matters

absolute error = | approx − true |     relative error = absolute error⁄| true |

Absolute error is the raw gap. Relative error is that gap as a fraction of the thing itself — usually the one you care about, because being off by 1 is trivial on a million and catastrophic on a two.

Worked example
True = 3.14159, approx = 3.14
absolute = |3.14 − 3.14159| = 0.00159
relative = 0.00159 / 3.14159 ≈ 0.00051 = 0.051%
Contrast: an error of 1 on a true value of 2 is 50% relative error — same "1", wildly different significance.

Try it — pick a value and a rounding, and watch both errors respond:

Rounding & error playground
Fewer decimal places → bigger error. The same absolute error looks tiny on a big number and huge on a small one — that's why relative error is the honest measure.
Error accumulates

Round early and often, and small errors pile up. Add a thousand numbers each rounded to 2 dp and your total can be off by far more than 0.005. The practitioner's rule: keep full precision through the calculation, round only the final answer. Rounding intermediate steps is one of the most common sources of wrong results in real spreadsheets and code.

Day 06numerical analysis · part 2

Approximation & iteration

Most equations that matter can't be solved with a neat formula — there's no tidy expression for many roots, integrals, or the value of √2. So instead of solving exactly, we approximate, and often we iterate: guess, improve, repeat until the answer stops changing. This is how calculators and computers actually compute.

Linear approximation — a curve looks straight up close

Zoom in on any smooth curve and it looks like a straight line. So near a point you know, you can estimate nearby values by following the tangent's slope:

f(x + h) ≈ f(x) + slope · h"take the known value, then step along the local slope"
Worked example — estimate √4.1 without a calculator
We know √4 = 2. For √x, the slope near x=4 is 1/(2√x) = 1/4.
√4.1 ≈ 2 + (1/4)(0.1) = 2 + 0.025 = 2.025
True value: 2.0248… — our estimate is right to 3 decimals from arithmetic alone.

Iteration — guess, improve, repeat

When one estimate isn't enough, feed the answer back in and improve it. The classic is the Babylonian method for square roots, known for 3,000 years: to find √N, repeat

xnext = ½ ( x + N⁄x )average your guess with N-over-your-guess — it homes in fast

The intuition: if your guess is too small, N/x is too big, and vice versa — so their average is closer than either. Watch it converge on √N in a handful of steps:

Babylonian square root · watch it converge
Each step roughly doubles the number of correct digits — that's "quadratic convergence," and it's why this ancient trick is still what's inside your calculator.
The big idea of numerical analysis

You trade an exact answer you can't get for an approximate answer you can, plus a handle on the error. Every method balances three things: how accurate (how small the error), how fast it converges (how many steps), and whether it converges at all (some iterations run away to infinity). Knowing those three questions is most of the subject.

When approximation bites back

That's the numerical craft: rounding, error, and iteration. Next we add the three big pillars of higher math — change, chance, and data.

Day 07the math of change

Calculus: rates and totals

Calculus has a fearsome reputation and two friendly ideas at its heart. The derivative measures how fast something is changing right now. The integral adds a changing quantity up into a total. Almost everything else is technique on top of those two.

The derivative — instantaneous slope

Think of a car's speedometer. Average speed is easy — distance ÷ time over a stretch. But the speedometer shows your speed at this instant. The derivative is exactly that: take the average rate of change over an interval, then shrink the interval to nothing.

f′(x) = slope of the curve at x = f(x+h) − f(x)⁄h  as h → 0the average slope between two points, as the points merge into one — the tangent

Graphically: pick two points on a curve and draw the line through them (a "secant") — its slope is the average rate. Slide the points together and the secant becomes the tangent, whose slope is the instantaneous rate. That's the derivative, written f′(x) or dy/dx.

Worked example — the slope of x² at x = 3
Shrink h and watch the average slope settle:
h = 1:  (4² − 3²)/1 = 7
h = 0.1:  (3.1² − 3²)/0.1 = 6.1
h = 0.001:  (3.001² − 3²)/0.001 = 6.001
→ it homes in on 6. So the slope of x² at x = 3 is 6.

The rule you'll use most

d/dx ( xn ) = n · xn−1     d/dx ( constant ) = 0

"Bring the power down in front, then knock one off the power." So x² → 2x (which is 6 at x=3, matching above), x³ → 3x², and any flat constant has slope 0. Drag the point along the curve and watch its tangent slope:

Derivative · drag the point, read the tangent slope
The curve is f(x) = x². Its slope f′(x) = 2x — steep on the sides, flat at the bottom (slope 0 at x = 0, the minimum). Derivatives are how you find peaks and troughs.

The integral — the running total

The integral runs the other way: it adds up a changing quantity, and geometrically that's the area under the curve. If a graph shows speed over time, the area beneath it is the distance travelled.

Worked example — distance from speed
Constant speed 60 km/h for 2 h → area of a rectangle = 60 × 2 = 120 km
Area under the line y = x from 0 to 4 → a triangle = ½ × 4 × 4 = 8
The two are inverses

Differentiate a total and you get the rate; integrate a rate and you get back the total. Speed is the derivative of distance; distance is the integral of speed. That mirror-image relationship is the Fundamental Theorem of Calculus — and it's why the two ideas are always taught together.

Day 08reasoning about chance

Probability: putting a number on uncertainty

Probability assigns a number between 0 and 1 to how likely something is: 0 means impossible, 1 means certain, 0.5 means even odds. A handful of rules let you combine those numbers correctly — which is harder than it looks, because intuition about chance is famously unreliable.

The basic recipe

When outcomes are equally likely, probability is just counting:

P(event) = favourable outcomes⁄total outcomes

One die: P(roll a 4) = 1/6. A deck: P(draw a heart) = 13/52 = 1/4.

The complement — the "not" shortcut

P(not A) = 1 − P(A)

Often far easier to compute the opposite. P(not a six) = 1 − 1/6 = 5/6. "At least one" problems are almost always easier as 1 − P(none).

Combining events — AND multiplies, OR adds

Worked example — overlap
P(card is a heart OR a king)?
= P(heart) + P(king) − P(king of hearts)
= 13/52 + 4/52 − 1/52 = 16/52 ≈ 0.31
(subtract the king of hearts, or it gets counted twice)

Conditional probability & expected value

Conditional — P(A | B), "the probability of A given B is known" — because information changes the odds. Given a die came up even (2, 4, 6), the chance it's a 2 is now 1/3, not 1/6: knowing "even" shrank the world of possibilities.

Expected value — the long-run average outcome, each value weighted by its probability:

E = Σ ( outcome × probability )
Worked example — a fair die
E = (1 + 2 + 3 + 4 + 5 + 6) × (1/6) = 21/6 = 3.5
You'll never roll 3.5 — it's the average you'd approach over thousands of rolls.

The law of large numbers

The bridge between "the probability is 0.5" and reality: as you repeat a trial more and more, the observed fraction closes in on the true probability. A few flips can be lopsided; ten thousand won't be. Flip a coin and watch it settle:

Law of large numbers · the running proportion converges to 0.5
Early on the line lurches around; as flips pile up it hugs the dashed 0.5 line. Short runs are noisy — this is why "it came up heads 5 times, it's due for tails" is a fallacy.
Day 09making sense of data

Statistics: centre, spread & shape

Where probability reasons forward from known odds to outcomes, statistics reasons backward — from a pile of observed numbers to what they tell you. Three questions cover most of it: where's the centre, how spread out is it, and what's the shape?

Centre — mean, median, mode

Worked example
Data: 2, 4, 4, 6, 9
mean = (2+4+4+6+9)/5 = 25/5 = 5
median = middle of the sorted list = 4
mode = most frequent = 4

Why the median earns its keep

Worked example — an outlier arrives
Change the 9 to 100:   2, 4, 4, 6, 100
mean jumps to 116/5 = 23.2 — dragged up by one value
median stays 4 — unmoved
The practical lesson

The median is robust to outliers; the mean is not. This is exactly why incomes are reported as a median — a handful of very high earners would make the mean wildly unrepresentative of a typical person. Choosing the right measure of centre is half of using statistics honestly.

Spread — standard deviation

Two datasets can share a mean and be nothing alike — one tightly clustered, one wildly scattered. Standard deviation captures that: the typical distance of a value from the mean.

Worked example — 2, 4, 4, 6, 9 (mean 5)
distances from mean: −3, −1, −1, 1, 4
square them: 9, 1, 1, 1, 16  → sum = 28
variance = 28 / 5 = 5.6  → SD = √5.6 ≈ 2.37
(squaring stops the +/− distances cancelling; the square root undoes it at the end. Note: for a sample you divide by n−1, not n — a small correction you'll see in tools.)

Shape — the normal distribution

Astonishingly many quantities — heights, measurement errors, exam scores — pile up symmetrically around the mean in a bell curve. When they do, the standard deviation tells you almost everything, via one rule:

≈ 68% within 1 SD  ·  95% within 2 SD  ·  99.7% within 3 SDthe 68–95–99.7 rule — how much of the data sits near the mean
The bell curve · adjust the spread, see 68–95–99.7
A bigger σ widens the curve — the same 68% just spreads over more ground. Nearly everything (99.7%) lands within 3 SD of the mean; a value beyond that is genuinely rare.

Two ideas to carry, one caution

You've rebuilt the whole toolkit

Powers and roots, logs as their inverse, trig from triangles to waves, functions as rules with shapes, the numerical craft of rounding, error and iteration — and now calculus for change, probability for chance, and statistics for data. That's the working mathematics most technical reading assumes, and the exact foundation the Transformer-math course was quietly standing on.