Before you can read the parent note, you need to own every squiggle it uses. Below is every symbol and idea, in build order — plain words first, then a picture, then why the topic can't live without it.
Plain words: roll a die — the outcome is a dot pattern, but X turns that into a number1,2,…,6. The capital X is the machine; a lowercase x (or xi) is one specific number it can spit out.
The picture: think of a bag of possible values, each ball a number.
Why the topic needs it: expectation and variance are questions aboutX. Without a number-producing machine there is nothing to average or to measure the spread of. This is built in detail in 1.3.01-Randomvariables-and-probability-distributions.
Plain words: P=0 means "never," P=1 means "always," P=61 means "one time in six."
Figure s01 — Bar chart of the six die values. Each value on the horizontal axis gets a bar whose height is its probability 1/6; the six heights add to exactly 1.
Look at the figure: each value on the horizontal axis gets a bar whose height is its probability. Two ironclad rules — every bar height is ≥0, and all bar heights add up to exactly 1 (something must happen).
Why the topic needs it: expectation weights each value by how likely it is. The weights ARE these probabilities.
Figure s02 — A seesaw with a block at each value; block size = probability. The single point where the plank balances is the expectation E[X]=3.5.
Look at the figure: it is a seesaw. Each value sits at its position on the plank; the size of the block at that position is its probability. The single point where the plank balances is the expectation E[X]. That is why people call it the "centre of mass."
Why this and not a plain average? Because outcomes are not equally likely in general. The probability is the correct weight — it is literally how often that value shows up in the long run.
Figure s03 — Each die value has an arrow back to the mean line μ=3.5. Green arrows are positive deviations (value above mean), red arrows negative (value below).
Look at the figure: each value has an arrow back to the centre line μ. Arrows pointing right are positive deviations (green), arrows pointing left are negative (red).
Why the topic needs it: variance is about how far values sit from the centre — the deviation is exactly that distance, and we must handle both signs, which motivates the next idea.
We need a way to make every deviation count as "distance," ignoring direction. Two candidates:
Absolute value∣X−μ∣ — throws away the minus sign.
Square(X−μ)2 — a squared number is always ≥0.
The topic squares. Why square and not absolute value? Two concrete reasons:
Squaring is smooth everywhere — you can do calculus on it. Absolute value has a sharp corner at zero (not differentiable), which breaks later machinery like gradient descent.
Squaring gives the clean algebra E[X2]−μ2 that makes hand-computation easy.
Plain words: if X is a height in cm, then (X−μ)2 is in cm² — an awkward unit. The square root drags it back to plain cm, so you can say "typically about σ cm away from the mean."
Why the topic needs it: interpretability. Variance is the algebra-friendly number; standard deviation is the human-friendly number. Feature scaling (4.1.02-Feature-scaling-and-normalization) divides by σ precisely because it lives in real units.
The integral sign ∫ is just the ∑ from before, taken to the limit of infinitely many infinitely thin slivers:
E[X]=∫−∞∞xf(x)dx
Read the pieces: x is the value, f(x)dx is the tiny probability of that value's sliver (a weight), and ∫ adds every "value × its tiny chance" — exactly the weighted average from §4, now with a curve instead of bars.
The figure below shows the term-by-term translation between the discrete sum and the continuous integral — the same weighted-average idea, once with bars and once with a smooth curve.
Figure s04 — Left: discrete bars, E[X]=∑ixiP(X=xi). Right: a smooth density curve, E[X]=∫xf(x)dx. Arrows link ∑↔∫, xi↔x, and P(X=xi)↔f(x)dx.
Why the topic needs it: real ML features (weights, pixel intensities, times) are continuous. You must recognise ∫ as "the same weighted-average idea, now with a curve."