The Gaussian Distribution

Fully specified by mean and variance; about 68%, 95% and 99.7% of its mass lies within 1, 2 and 3 standard deviations.

5 min read350 wordscore3 viewsupdated 2026-10-03

Definition

The Gaussian (normal) distribution N(μ,σ2)\mathcal N(\mu,\sigma^2) is the continuous distribution with density f(x)=1σ2πe−(x−μ)2/2σ2f(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/2\sigma^2} — a symmetric bell centred at the mean μ\mu, whose width is set by the standard deviation σ\sigma.

At a glance

Notation
X∼N(μ,σ2)X\sim\mathcal N(\mu,\sigma^2); the standard normal is Z∼N(0,1)Z\sim\mathcal N(0,1)
Parameters
mean μ∈R\mu\in\mathbb R (location), variance σ2>0\sigma^2>0 (spread)
Key property
68.27% / 95.45% / 99.73% of the mass lies within ±1\pm1 / ±2\pm2 / ±3σ\pm3\sigma
Closed under
shifting, scaling, sums of independent Gaussians, conditioning, marginalizing
Prerequisites
random variables, expectation and variance
Used in
noise models, z-tests and confidence intervals, anomaly detection, VAEs, weight initialization

The intuition

Add up many small independent effects — measurement errors, the thousands of genes that influence height — and the total is approximately Gaussian; that is the central limit theorem. The density falls off as e−z2/2e^{-z^2/2} in the number of standard deviations zz from the mean, so extremes become rare very fast: a 3σ3\sigma deviation happens 0.27% of the time, a 5σ5\sigma one about once in 1.7 million.

The math

f(x)=1σ2πexp⁡ ⁣(−(x−μ)22σ2),E[X]=μ,Var⁡(X)=σ2f(x)=\frac{1}{\sigma\sqrt{2\pi}}\exp\!\Big(-\frac{(x-\mu)^2}{2\sigma^2}\Big),\qquad \mathbb E[X]=\mu,\quad \operatorname{Var}(X)=\sigma^2
μ\mu
mean — centre of the bell
σ\sigma
standard deviation — distance from μ\mu to each inflection point

Every Gaussian is a shifted, stretched standard normal. If X∼N(μ,σ2)X\sim\mathcal N(\mu,\sigma^2), its z-score Z=(X−μ)/σZ=(X-\mu)/\sigma is N(0,1)\mathcal N(0,1), so every probability reduces to the standard normal CDF Φ\Phi:

P(X≤x)=Φ(x−μσ),Φ(z)=∫−∞z12πe−t2/2 dt=12[1+erf⁡(z/2)]P(X\le x)=\Phi\Big(\frac{x-\mu}{\sigma}\Big),\qquad \Phi(z)=\int_{-\infty}^{z}\frac{1}{\sqrt{2\pi}}e^{-t^2/2}\,dt=\tfrac12\Big[1+\operatorname{erf}\big(z/\sqrt2\big)\Big]

Φ\Phi has no closed form; libraries evaluate it numerically. Independent Gaussians add: if X∼N(μ1,σ12)X\sim\mathcal N(\mu_1,\sigma_1^2) and Y∼N(μ2,σ22)Y\sim\mathcal N(\mu_2,\sigma_2^2) are independent, then aX+bY∼N(aμ1+bμ2, a2σ12+b2σ22)aX+bY\sim\mathcal N(a\mu_1+b\mu_2,\ a^2\sigma_1^2+b^2\sigma_2^2) — variances add, standard deviations do not.

In dd dimensions, with mean vector μ\mu and covariance matrix Σ\Sigma:

N(x∣μ,Σ)=1(2π)d/2∣Σ∣1/2exp⁡ ⁣(−12(x−μ)⊤Σ−1(x−μ))\mathcal N(x\mid\mu,\Sigma)=\frac{1}{(2\pi)^{d/2}|\Sigma|^{1/2}}\exp\!\Big(-\tfrac12(x-\mu)^\top\Sigma^{-1}(x-\mu)\Big)
(x−μ)⊤Σ−1(x−μ)(x-\mu)^\top\Sigma^{-1}(x-\mu)
squared Mahalanobis distance — distance in standard deviations

Contours of equal density are ellipses (ellipsoids) whose axes are the eigenvectors of Σ\Sigma, with half-length λi\sqrt{\lambda_i} per standard deviation. Among all distributions with a given mean and variance, the Gaussian has maximum entropy: it assumes nothing beyond those two numbers.

See it

±1σ 68.27%±2σ 95.45%±3σ 99.73%P(X > x)
-8-6-4-202468μx
x = 1.50 · z = (x − μ)/σ = 1.50f(x) = 0.1295 · peak 1/(σ√2π) = 0.399P(X > x) = 1 − Φ(z) = 0.0668

2-D: Σ = [[1, ρ], [ρ, 1]], 300 samples

inside 1σ ellipse: 37.7% (theory 39.3%)

inside 2σ ellipse: 86.0% (theory 86.5%)

In d dimensions “±kσ” holds far less than in 1-D: P = 1 − e^(−k²/2) for d = 2.

fig.Drag x to read its z-score and tail area; at z = 1.5 the tail is 0.0668. Below: in 2-D the 1σ ellipse holds only 39.3% of the mass and the 2σ ellipse 86.5%.

Worked example

IQ scores are scaled to μ=100\mu=100, σ=15\sigma=15. For x=130x=130: z=(130−100)/15=2z=(130-100)/15=2, so P(X>130)=1−Φ(2)=0.0228P(X>130)=1-\Phi(2)=0.0228 — about 2.3% of people. Between 85 and 115 (±1σ\pm1\sigma): Φ(1)−Φ(−1)=0.6827\Phi(1)-\Phi(-1)=0.6827. The 97.5th percentile is 100+1.96⋅15=129.4100+1.96\cdot15=129.4.

In code

python
1import numpy as np
2from scipy.stats import norm
3
4X = norm(loc=100, scale=15)
5X.sf(130) # P(X > 130) = 0.0228
6X.cdf(115) - X.cdf(85) # 0.6827
7X.ppf(0.975) # 129.4 — the 97.5th percentile
8
9rng = np.random.default_rng(0)
10samples = rng.normal(100, 15, size=10_000)
scipy.stats.norm: probabilities, quantiles and sampling.

Where it's used

Noise models

Least squares is maximum likelihood under Gaussian noise; Kalman filters propagate Gaussian beliefs.

Inference

z-tests, standard errors and confidence intervals use the Gaussian approximation from the CLT.

Anomaly detection

Flag points with ∣z∣>3|z|>3, or with low density under a fitted multivariate Gaussian.

Deep learning

He / Xavier initialization, the VAE prior N(0,I)\mathcal N(0,I), and the noise in diffusion models.

Check yourself

X∼N(50, 102)X\sim\mathcal N(50,\,10^2). What is P(X<30)P(X<30)?

Check yourself

XX and YY are independent, each N(0,1)\mathcal N(0,1). The standard deviation of X+YX+Y is…

Remember

  • ✓N(μ,σ2)\mathcal N(\mu,\sigma^2) is fixed by its mean and variance.
  • ✓Standardize with z=(x−μ)/σz=(x-\mu)/\sigma; probabilities come from Φ\Phi.
  • ✓68.27% / 95.45% / 99.73% lie within 1 / 2 / 3σ — in 1-D only.
  • ✓Variances of independent Gaussians add. Check real tails before assuming normality.
← back to Mathematics roadmap