00 Β· Orientation: relearning math
This module has two jobs and neither of them is "learn math". First: measure, honestly, what survived from your bachelor degree. Second: fix the way you will study it this time β because the reason it evaporated last time was not your brain, it was the method.
By the end you can
- Name the three passes β Remember β Understand β Implement β and say what each one is for.
- Show which of the five core mathematical ideas you are weak in, from a cold diagnostic.
- Explain why knowledge learned for an exam decays, and what retrieval practice does about it.
- Set up the review rhythm (1 / 3 / 7 days) that keeps each module alive.
Why this module exists
Most engineers who "forgot the math" did not forget it β they never encoded it. Studying for a test with three days left is a pattern-matching activity: recognise the problem type, retrieve the recipe, execute, score. The recipe gets stored without its reason, and reasons are what survive. That is why you can still write a socket server from your computer-systems course (you used the idea for years) but cannot say what an eigenvector is for (you used it once, on paper, in June).
So the fix is not "read a better textbook". The fix is to attach every idea to three things it never had before: a picture (what it looks like geometrically), a purpose (what problem humans had before it existed), and a place in ML (the exact line of code or the exact algorithm where it does work). Those three attachments are the entire design of this notebook.
Remember β retrieve before you read
Do not scroll to the answers until you have written yoursThe method: three passes, then space it
Every module in this notebook is built the same way, so the shape becomes automatic:
- Remember (retrieve, don't re-read). Each module opens with questions you try from memory, in writing before seeing any content. Wrong answers here are the most valuable thing in the notebook β they mark exactly where to pay attention.
- Understand (attach a picture and a purpose). For each idea: what problem existed before it, what it looks like, what breaks without it. If you cannot state an idea in one plain sentence, you have recognition, not understanding β keep going.
- Implement (make it move). Type the code β do not copy it. Then change one number, predict the effect, run it. The moment an abstraction produces an output you can see, it stops being a formula and becomes a tool.
- Checkpoint (prove it). Instant-feedback multiple choice plus open questions you answer aloud. Only then tick Mark done β and only if you can explain it without notes.
- Space it (make it stay). Re-open the module in 1 day, then 3, then 7. Ten minutes of recall on day three beats an hour of re-reading on day one.
Memory decays fast unless it is retrieved at the moment it is fading. That is why this notebook opens every module with discomfort: the struggle to half-remember is not a sign you are failing, it is the act that strengthens the trace. Studies of students consistently find that testing yourself outperforms re-reading by a wide margin, even when re-reading feels far more productive. Feeling fluent while reading is the illusion; feeling stuck while recalling is the work.
Cold diagnostic: answer all 12 from memory
Ten minutes. Write short answers β a word, a formula, a sketch. Do not look anything up, do not open the modules. Answers are in the recall cards below, but only after you have written yours; grading yourself against an answer you did not attempt is worthless.
- In words: what does $f(x) = x^2$ mean? Then compute $f(3)$ and $f(-2)$.
- Expand $(a+b)^2$. How about $(a+b)^3$?
- What is a vector? Give a real 3-dimensional example from a machine learning dataset.
- What does the dot product of two vectors measure?
- What is a matrix? Geometrically, what does multiplying a matrix by a vector do?
- What is a derivative, in one sentence?
- What is the gradient of $g(x,y) = x^2 + y^2$ at the point $(1,2)$? Which direction does it point?
- If $P(A) = 0.3$, $P(B) = 0.4$ and $A$, $B$ are independent, what is $P(A \cap B)$?
- What does $\mathbb{E}[X]$ mean? What is the expected value of a fair six-sided die?
- Correlation vs causation β one sentence each, and one sentence on why ML cares.
- Why do we maximise the log-likelihood instead of the likelihood itself?
- Name one ML algorithm and list the mathematical ideas you believe hold it together.
What your answers mean
There is no pass mark. Instead, note which group of questions felt hardest β that maps onto the five ideas every classical ML algorithm is assembled from:
| Cold questions | Core idea | It becomes, in ML | Go here |
|---|---|---|---|
| 1, 2 | Functions, parameters, structure | Hypothesis space, the model as $f(x;\theta)$ | Module 01 |
| 3, 4, 5 | Linear algebra | Dataset = matrix, embeddings, PCA, attention | Module 02 |
| 6, 7 | Calculus | Gradient descent, backpropagation | Module 03 |
| 8, 9, 11 | Probability | Bayes classifier, MLE, calibrated predictions | Modules 04, 06 |
| 10, 12 | Statistics & evidence | Evaluation, A/B tests, generalisation claims | Module 05 |
Understand β the purpose of the whole journey
Why this math, and why before deep learningWhat machine learning actually needs from mathematics
Strip away the algorithms and every classical ML model is the same statement:
That single line is why the syllabus looks the way it does. To read it you need the notation of Module 01. To build $f$ and understand why a matrix of weights can represent a dataset you need linear algebra (Module 02). To move $\theta$ downhill you need derivatives, gradients and the chain rule (Module 03). To know that minimising sum-of-squares is secretly assuming Gaussian noise, and that cross-entropy comes from coding theory, you need probability (Module 04) and information theory (Module 06). To decide whether your 0.91 beats someone else's 0.93 you need statistics (Module 05). To actually run the minimisation β and to understand what $\lambda$ is trading off β you need optimization (Module 07). Module 08 then reassembles the classic algorithms from these parts, and Module 09 shows the same parts reappearing, at larger scale, inside deep learning and agents.
Deep learning frameworks compute derivatives for you, so it is tempting to skip calculus. That works until something breaks β and it always breaks. When a loss explodes, when a layer saturates, when a transformer attends to nothing, when a fine-tune forgets what it knew: the diagnosis is always the same three suspects β a matrix behaving badly (linear algebra), a gradient vanishing or exploding (calculus + numerics), or a probability assumption that no longer holds. People who own the fundamentals debug in hours what others debug in weeks. This notebook is that ownership.
How to read a formula from now on
From Module 01 onward, treat every formula as a sentence with a grammar. When you meet one, ask the same five questions, in this order, every time:
- What are the objects? Scalars, vectors, matrices, functions, sets. Which letters are data, which are parameters, which are outputs?
- What is the shape? If $X$ is $n \times d$ and $w$ is $d$, then $Xw$ is length $n$ β one number per sample. Shape errors are 80% of implementation errors.
- What is being summed or averaged? Most ML formulas are an average over data points. A $\sum_i$ over samples is almost always "average the error".
- What is the direction of "good"? Minimise or maximise? Which term fights which? What does $\lambda$ trade off?
- Where does it live in code? Find the equivalent line in NumPy or scikit-learn. If you cannot find it, you have not understood it yet.
Implement β set up the workspace
Ten minutes, once, and never againThe environment check
From Module 02 onwards every module has runnable code. Right now, confirm the three libraries everything depends on are installed and healthy:
import numpy as np
import matplotlib.pyplot as plt
import sklearn
print("numpy ", np.__version__)
print("sklearn ", sklearn.__version__)
# A 1-line sanity check you will reuse constantly:
# dot product of a vector with itself = squared length
v = np.array([3.0, 4.0])
print("||v||^2 =", v @ v) # expect 25.0
print("||v|| =", np.linalg.norm(v)) # expect 5.0
If those three lines run, you are ready. If not, fix it now β a broken environment two modules from now is the single most common reason people stop halfway.
- Write your diagnostic answers down (paper or a notes file). Put today's date on them. You will re-answer the same 12 questions after Module 09 β that comparison is your real score, not any quiz here.
- Create one notes file per module, and inside it, only two sections: "The one-sentence version" and "Where I still get stuck". No copying of formulas β a formula you transcribe you will not keep; a formula you re-derive you will.
- Book the rhythm: 25β40 focused minutes most days beats a 5-hour Sunday. Block it in your calendar now, including the 1 / 3 / 7-day reviews.
Prove it, then start Module 01
Answer first, then open the cardsMultiple choice β instant feedback
1. Your goal is to still understand gradient descent in six months. What does the learning-science evidence say works best?
2. In this notebook, "Understand" a concept meansβ¦
3. Which mathematical idea is the backbone of principal component analysis (PCA)?
4. You just finished a module and everything made sense while reading it. What should you do next for that knowledge to survive?
5. Which sequence does this notebook ask you to work in β and why that order?
6. A dataset lives in a matrix $X$ with shape $(5000, 12)$. What does one row represent?
Recall cards β the diagnostic answers
Only open these once your own answers are written down.
1β2. What is $f(x)=x^2$? And $(a+b)^2$, $(a+b)^3$?
3β4. What is a vector? What does the dot product measure?
5. What is a matrix? What does matrix Γ vector do?
6β7. What is a derivative? Gradient of $x^2+y^2$ at $(1,2)$?
8β9. $P(A\cap B)$ for independent events? $\mathbb{E}[X]$ and a fair die?
10. Correlation vs causation?
11. Why log-likelihood instead of likelihood?
12. One algorithm and its mathematical skeleton
Checkpoint β open questions
Answer aloud, without notes. Short and honest is fine.
- Explain, to an imaginary colleague, why knowledge learned for an exam decays β and what retrieval practice changes.
- What are the three passes, and what is the specific purpose of each?
- Write the generic ML objective from memory. Which symbol is data? Which is parameters? Which is the regulariser?
- Name the five core ideas and one ML algorithm each one powers.
- When you next meet a formula you have never seen, what five questions will you ask it?
- What are your 1 / 3 / 7-day review dates for this module?
The practical counterpart to this module is ML module 00 Β· Orientation & diagnostic, which does the same hole-finding for the modelling side. From here, the two notebooks interleave: this one explains why the math works, that one shows what the model does with it.