Math for AI
Linear algebra, probability, statistics, calculus intuition — no heavy proofs.
Start here
Not theorem-proving — working intuition for the handful of math ideas ML leans on daily. Four families:
- Linear algebra — the language of data. A dataset is a grid of numbers (matrix); one example is a list of numbers (vector). The measures how similar two vectors are — shows up from recommendations to .
- Probability & statistics — how ML reasons about uncertainty. A rarely says "definitely fraud," it says "87% likely." updates a probability given new evidence; distributions (normal, Bernoulli, Poisson) are the standard shapes randomness follows.
- Calculus — how a learns. A is the slope: nudge the input, how much does the output move? Training is repeatedly asking "which way should each move to shrink the loss" — exactly what a answers. The extends this to functions-of-functions (a ) — and are the same idea.
You won't derive any of this from scratch — you need to explain what each piece means and why it's used, in plain words.
Core threads
- Linear algebra: a matrix is a linear transformation; eigenvectors are directions that don't rotate under that transformation, eigenvalues are how much they stretch — this is the intuition behind (find directions of max ). = number of independent directions/information in a matrix.
- Probability: — P(A|B) = P(B|A)P(A)/P(B) — updates belief given new evidence; classic viva format is a word problem (disease testing, spam filter). Know (mean of a distribution) and (spread) cold.
- Distributions: Normal (continuous, symmetric, bell curve — most natural measurements), Bernoulli (single binary trial, e.g. click/no-click), Binomial (n Bernoulli trials), Poisson (count of rare events in fixed interval — e.g. fraud transactions/hour).
- Calculus: = rate of change = slope; the entire training loop is "compute the of loss w.r.t. , step opposite to it." Know the σ'(x) = σ(x)(1-σ(x)) and the by heart — it *is* .
Viva angle
Expect word-problem Bayes questions ("a test is 99% accurate, disease prevalence is 1% — you test positive, what's the actual probability you have it?" — answer: much lower than 99%, this is the classic base-rate fallacy trap). Practice 5 of these until instant.
Visual reference
Bayes' theorem as a tree
Eigenvector intuition
Gradient descent & learning rate
Cheatsheet
Bayes' theorem
P(A|B) = P(B|A)·P(A) / P(B)
Update belief given new evidence.
Eigen equation
A·v = λ·v
v = eigenvector, λ = eigenvalue.
Expectation
E[X] = Σ x·P(x)
Probability-weighted average.
Variance
Var(X) = E[(X − E[X])²]
Spread around the mean.
Chain rule
dy/dx = f'(g(x))·g'(x)
The math behind backprop.
Distributions at a glance
| Distribution | Models… | Example |
|---|---|---|
| Normal | Continuous, symmetric measurements | Transaction amounts (log scale) |
| Bernoulli | Single binary trial | Is this one transaction fraud? |
| Binomial | n Bernoulli trials | Fraud count in n transactions |
| Poisson | Rare events per fixed interval | Fraud alerts per hour |
- ▸ = number of independent directions of information in a matrix.
- ▸ = eigenvectors of the covariance matrix, ranked by ( captured).
- ▸: sample means trend normal regardless of the original distribution.
- ▸A rare condition + an imperfect test ⇒ most positives are false positives (base-rate fallacy).
Further study
Question bank
18 questionsA disease affects 1% of a population. A test is 99% accurate (both and specificity). You test positive — what's the actual probability you have the disease?
What are eigenvectors and eigenvalues, intuitively? How does this connect to ?
What does the of a matrix tell you?
Define and of a random variable. Why do both matter for understanding a distribution?
Compare Normal, Bernoulli, and Poisson distributions — give a real-world (ideally fintech) example of each.
What is a , intuitively, and why is it the mathematical backbone of training?
State the and explain why it's essential for training neural networks.
An SMS spam filter flags 5% of all legitimate messages as spam (false positive rate) and correctly catches 95% of actual spam. If 20% of all messages are spam, and a message is flagged, what's the probability it's actually spam?
What is the , and why does it matter in practice?
What does the between two vectors tell you, intuitively? How is it used in ML?
What's the intuition behind entropy in information theory, and how does cross-entropy connect to the used for classification?
What is KL divergence, intuitively — how does it capture "how different" two probability distributions are?
What is Maximum Likelihood Estimation, at a high level?
In plain language, what's a p-value, and what's the difference between a Type I and Type II error? Give an example.
What does a 95% confidence interval actually mean? Why is the common interpretation wrong?
What's the difference between covariance and correlation, and why is correlation easier to interpret?
Why does a convex make optimization easier — what does convexity actually guarantee?
Why doesn't correlation imply causation? Give an example, and name what can create a spurious correlation.