18 formulas from statistics, machine learning and LLMs. Each in plain words, every symbol explained, and a worked example, most with numbers from our own tools. For the words around them, see the glossary.
Mean
Statistics
Add up the values and divide by how many there are.
How far values typically sit from their mean: average the squared distances (dividing by n − 1), then take the square root.
s=√Σ (xi−x)2n− 1
Tap a symbol to see what it means.
s
the standard deviation
Σ
add up, over every value
xi
each value
x
the mean
n
how many values (n − 1 corrects for using the sample’s own mean)
Worked example
The same times: distances from 35 are -7, 0, -4, 7, 4; their squares add to 130; 130 ÷ 4 = 32.5; √32.5 = 5.70 minutes.
z-score
Statistics
How many standard deviations a value sits above (or below) the mean.
z=x−μσ
Tap a symbol to see what it means.
z
the z-score
x
the value
μ
the mean, “mu”
σ
the standard deviation, “sigma”
Worked example
A 42-minute delivery, with mean 35 and standard deviation 5.70: (42 − 35) ÷ 5.70 = 1.23, about one and a quarter standard deviations slow.
Standard error of a mean
Statistics
How much a sample’s mean would wobble from sample to sample: the spread divided by the square root of the sample size.
SE=σ√n
Tap a symbol to see what it means.
SE
the standard error
σ
the spread of single values
n
the sample size
Worked example
One roll of a die has a spread of 1.71. Averages of 30 rolls: 1.71 ÷ √30 = 0.31, and the central limit theorem simulator’s 1,000 averages had a spread of 0.30.
An estimate, plus and minus about two standard errors: a range made by a method that catches the true value 95% of the time.
θ±1.96×SE
Tap a symbol to see what it means.
θ
the estimate, such as a mean or a difference
1.96
how many standard errors cover the middle 95% of a normal curve
SE
the estimate’s standard error
Worked example
In the A/B test calculator’s example, B converts 4.52% and A 4.00%: a difference of 0.52 points, with a standard error of 0.286. So 0.52 ± 1.96 × 0.286 = -0.04 to +1.08 points, which includes zero.
Is B’s rate really different from A’s? The difference, divided by how much it would wobble if there were no difference.
z=pB−pA√p(1 −p) (1nA+1nB)
Tap a symbol to see what it means.
z
how many standard errors apart the rates are
pB
B’s conversion rate
pA
A’s conversion rate
p
both versions’ rate pooled together
n
each version’s visitors
Worked example
400 of 10,000 against 452 of 10,000: z = 1.82, so the p-value, the chance of a gap this big if the versions were the same, is 0.069: not significant at 0.05.
A prediction as a starting value plus a fixed amount for each unit of the feature.
ŷ=β0+β1x
Tap a symbol to see what it means.
ŷ
the prediction, “y hat”
β0
the intercept: the prediction when x is 0
β1
the slope: the change in ŷ for each unit of x
x
the feature
Worked example
A made-up line, ŷ = 20 + 3x: at x = 4, ŷ = 20 + 3 × 4 = 32. With more features, each gets its own β.
R²
Machine learning
The share of the target’s variation the model explains: 1 minus its squared errors over the squared distances from the mean.
R2= 1 −Σ (yi−ŷi)2Σ (yi−y)2
Tap a symbol to see what it means.
R²
the share explained, at most 1
Σ
add up, over every point
yi
each true value
ŷi
each prediction
y
the mean of the true values
Worked example
The overfitting playground’s degree-3 curve, on its 200 new points: R² = 0.77. Degree 15’s wild curve scores far below zero: worse than predicting the mean every time.
The confusion matrix’s churn model at 0.5: (45 + 583) ÷ 1,000 = 62.8%. Saying nobody leaves scores 93.1%, which is why accuracy misleads when one class is rare.
How alike two lists of numbers are by the angle between them: multiply them position by position, add up, divide by both lengths.
cos θ=a·b‖a‖ ‖b‖
Tap a symbol to see what it means.
cos θ
the similarity, from −1 to 1
a
the first vector (embedding)
b
the second vector
·
the dot product: multiply position by position, then add
Worked example
Two made-up vectors, [3, 4] and [4, 3]: (3×4 + 4×3) ÷ (5 × 5) = 0.96. bge-small-en-v1.5 rates “How do I get a refund?” and “Can I get my money back?” at 0.87 across its 384 numbers.