07-02: The Normal Distribution and Z-Scores¶
The normal distribution is the single most important distribution in statistics. Physical measurements, measurement errors, and — crucially — sample means all follow it. Everything from Chapter 08 to Chapter 13 rests on this curve.
Properties of the Normal Curve¶
- Bell-shaped and symmetric about
μ. - Mean = median = mode, all at the centre.
- Total area under the curve = 1.
- The curve approaches but never touches the horizontal axis.
- It is completely determined by two parameters:
μ(location) andσ(spread). - It obeys the empirical rule (04-01): 68% within 1σ, 95% within 2σ, 99.7% within 3σ.
Notation: X ~ N(μ, σ²).
The Standard Normal Distribution¶
The special case with μ = 0 and σ = 1, written Z ~ N(0, 1). Any normal variable becomes standard normal through the z-score transformation from 04-02:
The z-table (standard normal table) gives P(Z < z) — the area to the LEFT. Every other question is arithmetic on that one number.
P(Z < a) = table(a)
P(Z > a) = 1 − table(a)
P(a < Z < b) = table(b) − table(a)
P(Z < −a) = 1 − table(a) by symmetry
Landmark z-values worth memorizing¶
| Confidence | Two-tailed z |
P(Z < z) |
|---|---|---|
| 90% | 1.645 | 0.9500 |
| 95% | 1.96 | 0.9750 |
| 98% | 2.326 | 0.9900 |
| 99% | 2.576 | 0.9950 |
These reappear in every confidence interval in Chapter 09 and every z-test in 10-02.
The Two Directions of Every Normal Problem¶
Direction 1 — value → probability (x to area)¶
Step 1 Draw the curve, mark μ and shade what you want.
Step 2 Convert to z: z = (x − μ) / σ
Step 3 Look up (or compute) the LEFT area for that z.
Step 4 Adjust for the shading: right tail = 1 − left; between = subtract.
Direction 2 — probability → value (area to x), "inverse normal"¶
Step 1 Draw the curve and shade the given area.
Step 2 Convert to a LEFT area if it isn't already.
Step 3 Find the z with that left area (inverse lookup).
Step 4 Un-standardize: x = μ + z·σ
Tip
Always sketch the curve first. Nearly every normal-distribution mistake is a shading mistake, not an arithmetic one — and a sketch catches it immediately.
Worked Examples¶
Adult male heights are normally distributed with μ = 175 cm and σ = 7 cm.
(a) P(X < 182)
(b) P(X > 185)
(c) P(168 < X < 182)
z₁ = (168 − 175)/7 = −1.00 z₂ = (182 − 175)/7 = +1.00
P = 0.8413 − 0.1587 = 0.6826 → 68.26% (the empirical rule's 68%)
(d) Inverse — the 90th percentile of height
(e) Inverse — the middle 95% of heights
Left area 0.025 → z = −1.96 x = 175 − 1.96(7) = 161.28 cm
Left area 0.975 → z = +1.96 x = 175 + 1.96(7) = 188.72 cm
The middle 95% of men are between 161.3 and 188.7 cm.
The Normal Approximation to the Binomial¶
When n is large, computing binomial probabilities by hand becomes impractical. If
then the binomial is well approximated by N(μ = np, σ = √npq).
The continuity correction¶
The binomial is discrete, the normal continuous — so extend each whole number by ±0.5:
| Binomial question | Normal interval |
|---|---|
P(X = 12) |
P(11.5 < X < 12.5) |
P(X ≤ 12) |
P(X < 12.5) |
P(X < 12) |
P(X < 11.5) |
P(X ≥ 12) |
P(X > 11.5) |
P(X > 12) |
P(X > 12.5) |
Worked example¶
A coin is flipped 100 times. P(at least 60 heads)?
n = 100, p = 0.5 → np = 50 ≥ 5, nq = 50 ≥ 5 ✓
μ = 50, σ = √(100 × 0.5 × 0.5) = 5
With continuity correction: P(X ≥ 60) → P(X > 59.5)
z = (59.5 − 50) / 5 = 1.90
P(Z > 1.90) = 1 − 0.9713 = 0.0287 → 2.87%
The exact binomial answer is 0.0284 — the approximation is off by 0.0003. Without the correction you would get 0.0228, an error more than ten times larger.
Assessing Normality¶
Before using any normal-based method, check that the assumption is reasonable:
- Histogram — roughly bell-shaped and symmetric?
- Boxplot — median centred, whiskers similar, few outliers?
- Normal Q-Q plot — points close to a straight line? (The most sensitive visual check.)
- Skewness and kurtosis — both near 0 for a normal distribution.
- Formal test — Shapiro-Wilk (
n < 50), Anderson-Darling, Kolmogorov-Smirnov. A small p-value means "not normal".
Note
With large samples, formal normality tests reject almost any real data set for trivial departures. With small samples they lack the power to detect real ones. Prefer the Q-Q plot as the primary evidence, and remember that the Central Limit Theorem (08-02) makes the sample mean approximately normal even when the raw data is not.
Excel¶
' ── Value → probability ─────────────────────────────────────────────
=NORM.DIST(182, 175, 7, TRUE) ' P(X < 182) CDF -> 0.84134
=NORM.DIST(182, 175, 7, FALSE) ' density at 182 (rarely needed)
=1-NORM.DIST(185, 175, 7, TRUE) ' P(X > 185) -> 0.07656
=NORM.DIST(182,175,7,TRUE)-NORM.DIST(168,175,7,TRUE) ' between -> 0.68269
' ── Working through the z-score (shows the method) ──────────────────
=STANDARDIZE(182, 175, 7) ' z -> 1.0
=NORM.S.DIST(1, TRUE) ' P(Z < 1) -> 0.84134
=1-NORM.S.DIST(1.43, TRUE) ' P(Z > 1.43) -> 0.07636
' ── Probability → value (inverse) ───────────────────────────────────
=NORM.INV(0.90, 175, 7) ' 90th percentile -> 183.97
=NORM.INV(0.025, 175, 7) ' lower bound, middle 95%-> 161.28
=NORM.INV(0.975, 175, 7) ' upper bound -> 188.72
=NORM.S.INV(0.975) ' the critical z -> 1.95996
=NORM.S.INV(0.95) ' one-tailed 95% -> 1.64485
' ── Normal approximation to the binomial ────────────────────────────
=1-NORM.DIST(59.5, 50, 5, TRUE) ' with continuity correction -> 0.02872
=1-BINOM.DIST(59, 100, 0.5, TRUE) ' exact binomial -> 0.02844
' ── Random normal values ────────────────────────────────────────────
=NORM.INV(RAND(), 175, 7) ' one random height
' or: Data ▸ Data Analysis ▸ Random Number Generation ▸ Normal
' ── Normality diagnostics ───────────────────────────────────────────
=SKEW(A2:A101) ' near 0 if normal
=KURT(A2:A101) ' near 0 if normal (Excel reports EXCESS)
' Q-Q plot: sort the data, compute =NORM.S.INV((RANK-0.5)/n) for each,
' then scatter the sorted data against those z-scores.
R¶
mu <- 175; sigma <- 7
# ── Value → probability: pnorm ────────────────────────────────────
pnorm(182, mu, sigma) # P(X < 182) -> 0.8413447
pnorm(185, mu, sigma, lower.tail = FALSE) # P(X > 185) -> 0.0765637
pnorm(182, mu, sigma) - pnorm(168, mu, sigma) # between -> 0.6826895
# Through the z-score
z <- (182 - mu) / sigma; z # 1
pnorm(z) # 0.8413447
# ── Probability → value: qnorm ────────────────────────────────────
qnorm(0.90, mu, sigma) # 90th pct -> 183.9709
qnorm(c(0.025, 0.975), mu, sigma) # middle 95% -> 161.28 188.72
qnorm(0.975) # critical z -> 1.959964
qnorm(0.95) # one-tailed -> 1.644854
# ── Density and random draws ───────────────────────────────────────
dnorm(175, mu, sigma) # peak height
set.seed(1); rnorm(5, mu, sigma)
# ── Plot with a shaded tail ────────────────────────────────────────
curve(dnorm(x, mu, sigma), from = mu - 4*sigma, to = mu + 4*sigma,
col = "#5B2A86", lwd = 2, ylab = "density", main = "N(175, 7²)")
xs <- seq(185, mu + 4*sigma, length.out = 200)
polygon(c(185, xs, mu + 4*sigma), c(0, dnorm(xs, mu, sigma), 0),
col = "#0FA3A390", border = NA)
# ── Normal approximation to the binomial ───────────────────────────
pnorm(59.5, mean = 50, sd = 5, lower.tail = FALSE) # 0.02872 approx
pbinom(59, 100, 0.5, lower.tail = FALSE) # 0.02844 exact
pnorm(60, 50, 5, lower.tail = FALSE) # 0.02275 no correction
# ── Assessing normality ────────────────────────────────────────────
x <- rnorm(60, mu, sigma)
hist(x, breaks = 10, col = "#8A5FBF", border = "white", freq = FALSE)
curve(dnorm(x, mean(x), sd(x)), add = TRUE, col = "#0FA3A3", lwd = 2)
qqnorm(x, pch = 19, col = "#5B2A86"); qqline(x, col = "#0FA3A3", lwd = 2)
shapiro.test(x) # H0: the data IS normal; small p -> not normal
psych::skew(x); psych::kurtosi(x)
Python¶
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
mu, sigma = 175, 7
N = stats.norm(loc=mu, scale=sigma)
# ── Value → probability ────────────────────────────────────────────
N.cdf(182) # P(X < 182) -> 0.8413447
N.sf(185) # P(X > 185) -> 0.0765637
N.cdf(182) - N.cdf(168) # between -> 0.6826895
# Through the z-score
z = (182 - mu) / sigma # 1.0
stats.norm.cdf(z) # 0.8413447
# ── Probability → value ────────────────────────────────────────────
N.ppf(0.90) # 90th pct -> 183.9709
N.ppf([0.025, 0.975]) # middle 95% -> [161.28, 188.72]
stats.norm.ppf(0.975) # critical z -> 1.959964
stats.norm.ppf(0.95) # one-tailed -> 1.644854
# ── Density and random draws ───────────────────────────────────────
N.pdf(175)
N.rvs(5, random_state=1)
# ── Normal approximation to the binomial ───────────────────────────
stats.norm(50, 5).sf(59.5) # 0.02872 with correction
stats.binom.sf(59, 100, 0.5) # 0.02844 exact
stats.norm(50, 5).sf(60) # 0.02275 without correction
# ── Plot with a shaded tail ────────────────────────────────────────
xs = np.linspace(mu - 4*sigma, mu + 4*sigma, 500)
fig, ax = plt.subplots()
ax.plot(xs, N.pdf(xs), color="#5B2A86")
tail = xs[xs >= 185]
ax.fill_between(tail, N.pdf(tail), color="#0FA3A3", alpha=0.5)
ax.set(title="N(175, 7²)", ylabel="density")
# ── Assessing normality ────────────────────────────────────────────
x = N.rvs(60, random_state=0)
stats.probplot(x, dist="norm", plot=plt) # Q-Q plot
stats.shapiro(x) # H0: normal
stats.skew(x), stats.kurtosis(x) # both near 0 if normal
plt.show()
Quick Reference¶
| Task | Excel | R | Python |
|---|---|---|---|
P(X < x) |
NORM.DIST(x,μ,σ,TRUE) |
pnorm(x,μ,σ) |
norm(μ,σ).cdf(x) |
P(X > x) |
1-NORM.DIST(x,μ,σ,TRUE) |
pnorm(x,μ,σ,lower.tail=FALSE) |
norm(μ,σ).sf(x) |
P(Z < z) |
NORM.S.DIST(z,TRUE) |
pnorm(z) |
norm.cdf(z) |
| Percentile → value | NORM.INV(p,μ,σ) |
qnorm(p,μ,σ) |
norm(μ,σ).ppf(p) |
| Critical z | NORM.S.INV(p) |
qnorm(p) |
norm.ppf(p) |
| Z-score | STANDARDIZE(x,μ,σ) |
(x-μ)/σ |
(x-μ)/σ |
| Density | NORM.DIST(x,μ,σ,FALSE) |
dnorm(x,μ,σ) |
norm(μ,σ).pdf(x) |
| Random normal | NORM.INV(RAND(),μ,σ) |
rnorm(n,μ,σ) |
norm(μ,σ).rvs(n) |
| Q-Q plot | manual scatter | qqnorm(x); qqline(x) |
stats.probplot(x, plot=plt) |
| Normality test | — | shapiro.test(x) |
stats.shapiro(x) |
Common Mistakes¶
- Forgetting that tables and software give the left area, then reporting
P(Z < z)when the question asked for the right tail. - Using
NORM.DISTwhereNORM.INVis needed (or vice versa) — the tell is whether the given is a value or an area. - Dropping the continuity correction in the binomial approximation.
- Using the normal approximation when
np < 5ornq < 5. - Assuming a data set is normal because
nis large. Largenmakes the sample mean normal, not the data. - Confusing
σwithσ²in the software argument — Excel, R, and SciPy all want the standard deviation, never the variance.
Exercises: 07-02: Exercises — The Normal Distribution and Z-Scores
⬅️ Previous: 07-01: Continuous, Uniform and Exponential Distributions ➡️ Next: 08-01: Sampling Methods and Bias