Joint, Marginal and Conditional Distributions

Almost nothing in physics is measured one number at a time. A tracking detector reports a position and a momentum; a gravitational-wave interferometer reports a strain time-series whose samples are all correlated. To describe several random quantities together we need one object: the joint distribution over a vector of random variables. This single function is the complete probabilistic description — every question you can legitimately ask, individually or in combination, is already answered inside it and extracted by nothing more than integration. Two operations do almost all the work. Marginalisation integrates out the variables we do not care about, collapsing the joint to the law of what remains — "the distribution of XX alone?" Conditioning fixes some variables at observed values and renormalises the surviving slice — "given Y=yY=y, the law of XX?" Conditioning is the continuous face of conditional probability, and Bayes' theorem is just the statement that fX∣Yf_{X\mid Y} and fY∣Xf_{Y\mid X} are two views of the same joint density. Dependence is summarised — usefully but incompletely — by the covariance matrix, its diagonal holding variances and its off-diagonal entries measuring how variables move together; rescaled by the standard deviations it becomes the correlation ρ∈[−1,1]\rho\in[-1,1]. Covariance sees only linear association, so it can vanish while the variables remain tightly, non-linearly bound; genuine independence is the stronger statement that the joint factorises. Only for jointly Gaussian variables do the two coincide — which is exactly why the multivariate normal governs so much of physics.

Key takeaways
  • The joint distribution of several random variables is the complete probabilistic description; for two continuous variables it is a density fXY(x,y)≥0f_{XY}(x,y)\ge 0 that integrates to one over the plane.
  • Marginals come from integrating the unwanted variables out: fX(x)=∫fXY(x,y) dyf_X(x)=\int f_{XY}(x,y)\,\mathrm{d}y. Conditionals come from fixing a value and renormalising: fX∣Y(x∣y)=fXY(x,y)/fY(y)f_{X\mid Y}(x\mid y)=f_{XY}(x,y)/f_Y(y).
  • Independence is factorisation, fXY=fXfYf_{XY}=f_X f_Y; it is equivalent to "every conditional equals the corresponding marginal".
  • Covariance Cov⁡(X,Y)=E[XY]−μXμY\operatorname{Cov}(X,Y)=E[XY]-\mu_X\mu_Y and the dimensionless correlation ρ=Cov⁡/(σXσY)∈[−1,1]\rho=\operatorname{Cov}/(\sigma_X\sigma_Y)\in[-1,1] quantify only linear dependence.
  • Independence forces Cov⁡=0\operatorname{Cov}=0, but zero covariance does not force independence — except for jointly Gaussian variables, where it does.
  • Dependence propagates: Var⁡(aX+bY)=a2Var⁡X+b2Var⁡Y+2abCov⁡(X,Y)\operatorname{Var}(aX+bY)=a^2\operatorname{Var}X+b^2\operatorname{Var}Y+2ab\operatorname{Cov}(X,Y), the term the naive "add errors in quadrature" rule wrongly drops.
  • Key idea: the joint distribution is the master object — marginals come from integrating out variables, conditionals from fixing and renormalising, and covariance and correlation summarise the linear dependence, with independence equivalent to the joint factorising into its marginals.
The core insight

The joint distribution is the complete description; marginals come from integrating out variables, conditionals from fixing and renormalising, and covariance and correlation summarise the (linear) dependence — with independence equivalent to factorisation of the joint into its marginals.

Where this lives today

Joint, marginal, and conditional distributions are the daily machinery of quantitative physics. In precision cosmology the analysis of the Planck cosmic-microwave-background data delivers a high-dimensional joint posterior over cosmological parameters; the headline numbers — the matter density, the Hubble constant — are marginals got by Markov-chain Monte Carlo integrating out every nuisance parameter, and the "banana" contours in a Ωm\Omega_m–σ8\sigma_8 plane are two-dimensional marginals whose tilt is a correlation. In gravitational-wave astronomy, LIGO and Virgo model detector noise by a large covariance matrix and infer source masses and spins as marginals of a joint posterior. The Kalman filter that steers spacecraft is the bivariate-Gaussian conditioning of Derivation C applied recursively, each measurement updating a Gaussian prior exactly as N(ρy,1−ρ2)\mathcal{N}(\rho y,1-\rho^2) prescribes. Principal-component analysis diagonalises Σ\boldsymbol\Sigma to find the uncorrelated (for Gaussians, independent) modes carrying the variance. And every serious particle-physics uncertainty now ships a full covariance matrix, because the correlated-error arithmetic of Worked Example 3 is the difference between a correct and an overconfident result.

The physical picture

Picture the joint density of two variables as a hill of probability over the (x,y)(x,y) plane, its enclosed volume exactly one — normalisation. Marginalising over yy is like shining a lamp down the yy-direction and reading the shadow the hill casts on the xx-axis: you sum the probability in every yy-column, and what remains is the law fX(x)f_X(x). Conditioning on Y=y0Y=y_0 is the complementary move: cut the hill along Y=y0Y=y_0, take the exposed profile, and rescale it to area one again — because a raw slice does not integrate to one, and only a renormalised slice is a legitimate density.

Figure
Marginalise by projecting the joint density hill onto the x-axis (integrate out y); condition by slicing at fixed Y = y0 and renormalising that profile to unit area
One joint density, two reductions: marginalise (project) and condition (slice + renormalise) x y joint density f(x,y) slice Y = y0 conditional f(x given Y=y0), renormalised marginal f(x) = ∫ f(x,y) dy

Whether the hill tilts is what covariance measures: positive if large xx accompanies large yy, negative if large xx accompanies small yy. But a hill can be circular, or symmetric like a saddle or a ring, with no net tilt at all — covariance zero — while still richly structured, so knowing yy tells you a great deal about xx. That gap is why "uncorrelated" is weaker than "independent". Independence is the special case where the hill is an exact product of a profile in xx and a profile in yy: every conditional slice is then a rescaled copy of the single marginal.

Figure
Correlation ρ tilts the Gaussian 1σ ellipse: the conditional law of X given Y = y is Normal with mean ρy and variance 1 − ρ², here ρ = 0.8 and 1 − ρ² = 0.36; at ρ = 0 the contour is a circle and X and Y are independent
Correlation ρ tilts the Gaussian ellipse and sets the conditional law N(ρy, 1 − ρ²) x y ρ = 0: circle, X ⊥ Y E of X given Y=y = ρy ρ = 0.8 ρ = 0.8 ellipse Var(X given Y) = 1 − ρ² = 0.36

The correlation coefficient ρ\rho is covariance with the units divided out — a pure number in [−1,1][-1,1] reporting how tightly the samples hug a straight line, ρ=±1\rho=\pm1 exact linear dependence and ρ=0\rho=0 no linear trend. For the Gaussian hills above, ρ\rho fixes the entire dependence structure: the conditional law of XX given Y=yY=y is N(ρy, 1−ρ2)\mathcal{N}(\rho y,\,1-\rho^2) — mean sliding linearly with yy, variance shrunk from one to 1−ρ21-\rho^2.

The core equations

The starting point is the joint cumulative distribution function and, when it is smooth, the joint density obtained by differentiating in both arguments — the probability mass per unit area, from which everything else is computed.

P(X≤x, Y≤y)=FXY(x,y),fXY(x,y)=∂2FXY∂x ∂y(1)P(X\le x,\,Y\le y)=F_{XY}(x,y),\qquad f_{XY}(x,y)=\frac{\partial^2 F_{XY}}{\partial x\,\partial y} \qquad (1)

where: FXYF_{XY} — joint cumulative distribution function; fXYf_{XY} — joint probability density; x,yx,y — values of X,YX,Y. Reading it: the CDF accumulates probability over the quadrant below-and-left of (x,y)(x,y); the mixed derivative recovers the local density. A joint density is admissible exactly when it is non-negative and integrates to one — normalisation in two dimensions.

∬R2fXY(x,y) dx dy=1,fXY≥0(2)\iint_{\mathbb{R}^2} f_{XY}(x,y)\,\mathrm{d}x\,\mathrm{d}y = 1,\qquad f_{XY}\ge 0 \qquad (2)

where: fXYf_{XY} — joint density, non-negative and integrating to unit mass. Reading it: the probability hill has volume one, so any legitimate reduction must preserve that. Marginalisation integrates the unwanted variable out — the shadow the hill casts on each axis.

fX(x)=∫−∞∞fXY(x,y) dy,fY(y)=∫−∞∞fXY(x,y) dx(3)f_X(x)=\int_{-\infty}^{\infty} f_{XY}(x,y)\,\mathrm{d}y,\qquad f_Y(y)=\int_{-\infty}^{\infty} f_{XY}(x,y)\,\mathrm{d}x \qquad (3)

where: fX,fYf_X,f_Y — marginal densities of XX and YY. Reading it: to forget a variable, integrate over it; derived in Derivation A. Conditioning fixes one variable and renormalises the exposed slice by the marginal, giving a proper density in the survivor.

fX∣Y(x∣y)=fXY(x,y)fY(y),fY(y)>0(4)f_{X\mid Y}(x\mid y)=\frac{f_{XY}(x,y)}{f_Y(y)},\qquad f_Y(y)>0 \qquad (4)

where: fX∣Yf_{X\mid Y} — density of XX given Y=yY=y; fY(y)f_Y(y) — marginal of YY, the normaliser. Reading it: the raw slice fXY(x,y0)f_{XY}(x,y_0) has area fY(y0)f_Y(y_0), so dividing restores unit area. Bayes' theorem is the identity that both conditionals are the joint divided by a marginal, so one determines the other.

fX∣Y(x∣y)=fY∣X(y∣x) fX(x)fY(y)(5)f_{X\mid Y}(x\mid y)=\frac{f_{Y\mid X}(y\mid x)\,f_X(x)}{f_Y(y)} \qquad (5)

where: fY∣Xf_{Y\mid X} — reverse conditional, the likelihood; fX(x)f_X(x) — prior marginal on XX; fY(y)f_Y(y) — the evidence. Reading it: the continuous engine of Bayesian inference. The covariance is the mean of the product of the centred variables — one number for how they co-vary about their means.

Cov⁡(X,Y)=E ⁣[(X−μX)(Y−μY)]=E[XY]−μXμY(6)\operatorname{Cov}(X,Y)=E\!\left[(X-\mu_X)(Y-\mu_Y)\right]=E[XY]-\mu_X\mu_Y \qquad (6)

where: μX,μY\mu_X,\mu_Y — the means E[X],E[Y]E[X],E[Y]; E[XY]E[XY] — mixed second moment. Reading it: positive when both exceed their means together, negative when one exceeds as the other falls short; it captures linear co-movement only. Dividing covariance by the two standard deviations strips the units, giving the correlation that Cauchy–Schwarz confines to [−1,1][-1,1].

ρXY=Cov⁡(X,Y)σX σY∈[−1,1](7)\rho_{XY}=\frac{\operatorname{Cov}(X,Y)}{\sigma_X\,\sigma_Y}\in[-1,1] \qquad (7)

where: σX,σY\sigma_X,\sigma_Y — standard deviations; ρXY\rho_{XY} — dimensionless linear correlation. Reading it: ρ=±1\rho=\pm1 is exact linear dependence, ρ=0\rho=0 no linear trend; see Derivation B. The variance of a linear combination carries a covariance cross-term — what correlated measurement errors add.

Var⁡(aX+bY)=a2Var⁡X+b2Var⁡Y+2ab Cov⁡(X,Y)(8)\operatorname{Var}(aX+bY)=a^2\operatorname{Var}X+b^2\operatorname{Var}Y+2ab\,\operatorname{Cov}(X,Y) \qquad (8)

where: a,ba,b — real constants. Reading it: only when Cov⁡=0\operatorname{Cov}=0 do variances add in quadrature; otherwise abCov⁡ab\operatorname{Cov} shifts the result. Expectations of any function of the pair come from weighting with the joint density — LOTUS in two variables.

E[g(X,Y)]=∬g(x,y) fXY(x,y) dx dy(9)E[g(X,Y)]=\iint g(x,y)\,f_{XY}(x,y)\,\mathrm{d}x\,\mathrm{d}y \qquad (9)

where: gg — any measurable function of both variables. Reading it: integrate gg against the joint density directly, never needing the law of gg itself. For several variables the covariances organise into a symmetric, positive-semidefinite matrix with the variances on its diagonal.

Σ=(σX2Cov⁡(X,Y)Cov⁡(X,Y)σY2)(10)\boldsymbol{\Sigma}=\begin{pmatrix}\sigma_X^2 & \operatorname{Cov}(X,Y)\\ \operatorname{Cov}(X,Y) & \sigma_Y^2\end{pmatrix} \qquad (10)

where: Σ\boldsymbol{\Sigma} — the covariance matrix, symmetric with Σ⪰0\boldsymbol{\Sigma}\succeq0. Reading it: for a Gaussian this matrix and the mean vector are the entire distribution — every marginal and conditional follows from it.

Derivation AFrom the joint density to its marginals and conditionals

The goal is to show that the two reduction operations are not definitions imposed from outside but forced consequences of what a joint distribution already is. We start from the joint cumulative distribution function, obtain the marginal by pushing the other variable to infinity and differentiating, and obtain the conditional as the unique renormalisation of a slice that integrates back to one — so marginalisation and conditioning are the only self-consistent answers to "the law of XX alone" and "the law of XX given Y=yY=y".

Step 1. Write the marginal CDF of XX by allowing YY any value: FX(x)=P(X≤x, Y<∞)=FXY(x,∞)F_X(x)=P(X\le x,\,Y<\infty)=F_{XY}(x,\infty). Why: "the law of XX alone" places no restriction on YY, which in CDF language sends its upper limit to infinity.

Step 2. Express it as an integral of the joint density and differentiate: fX(x)=ddx∫−∞x ⁣ ⁣∫−∞∞fXY(u,y) dy duf_X(x)=\dfrac{\mathrm d}{\mathrm dx}\displaystyle\int_{-\infty}^{x}\!\!\int_{-\infty}^{\infty} f_{XY}(u,y)\,\mathrm dy\,\mathrm du. Why: the density is the derivative of the CDF, and the double integral exposes the inner yy-integral that survives.

Step 3. The outer derivative cancels the outer integral, leaving fX(x)=∫−∞∞fXY(x,y) dyf_X(x)=\displaystyle\int_{-\infty}^{\infty} f_{XY}(x,y)\,\mathrm dy, equation (3). Why: differentiating an accumulation in xx undoes it, so only the integration over the discarded yy remains — marginalisation is "integrate out what you drop".

Step 4. Now fix Y=yY=y. The raw slice fXY(x,y)f_{XY}(x,y) integrates over xx to fY(y)f_Y(y), not to one, so dividing by that constant gives fX∣Y(x∣y)=fXY(x,y)/fY(y)f_{X\mid Y}(x\mid y)=f_{XY}(x,y)/f_Y(y), equation (4). Why: a conditional must be a genuine density in xx, and there is exactly one rescaling that restores unit area — division by the slice's own total mass fY(y)f_Y(y).

Step 5. Rearranging equation (4) as fXY=fX∣Y(x∣y)fY(y)=fY∣X(y∣x)fX(x)f_{XY}=f_{X\mid Y}(x\mid y)f_Y(y)=f_{Y\mid X}(y\mid x)f_X(x) and equating the two products gives Bayes' theorem, equation (5). Why: the joint factors two ways, and setting them equal is the identity that inverts a forward likelihood into a posterior.

Go deeper · Derivation B · 1 minWhy the correlation coefficient lives in minus one to plus one
Derivation BWhy the correlation coefficient lives in minus one to plus one

The goal is to prove the sharp bound −1≤ρXY≤1-1\le\rho_{XY}\le1 and, in the same stroke, see why independence forces zero correlation while zero correlation does not force independence. The bound is Cauchy–Schwarz applied to the centred variables, got by demanding a certain expected square stay non-negative for every real parameter; the equality condition pins down the extremes, and a symmetric counterexample shows the converse fails — the backbone behind treating ρ\rho as a normalised measure of linear association.

Step 1. Centre the variables as U=X−μXU=X-\mu_X, V=Y−μYV=Y-\mu_Y, and consider q(t)=E[(tU+V)2]=t2E[U2]+2t E[UV]+E[V2]q(t)=E[(tU+V)^2]=t^2E[U^2]+2t\,E[UV]+E[V^2] for real tt. Why: (tU+V)2≥0(tU+V)^2\ge0 pointwise, so q(t)≥0q(t)\ge0 for every tt — one scalar inequality that encodes the whole bound.

Step 2. A quadratic at2+bt+cat^2+bt+c with a≥0a\ge0 that never goes negative has non-positive discriminant b2−4ac≤0b^2-4ac\le0; with a=E[U2]a=E[U^2], b=2E[UV]b=2E[UV], c=E[V2]c=E[V^2] this is 4(E[UV])2−4E[U2]E[V2]≤04(E[UV])^2-4E[U^2]E[V^2]\le0. Why: a positive discriminant would let the parabola dip below zero, contradicting q(t)≥0q(t)\ge0.

Step 3. Simplify to (E[UV])2≤E[U2]E[V2](E[UV])^2\le E[U^2]E[V^2], i.e. Cov⁡2≤σX2σY2\operatorname{Cov}^2\le\sigma_X^2\sigma_Y^2, so ρ2≤1\rho^2\le1 and −1≤ρ≤1-1\le\rho\le1. Why: this is Cauchy–Schwarz for the inner product E[UV]E[UV]; dividing by the variances gives the correlation squared.

Step 4. Equality holds only when q(t0)=0q(t_0)=0, i.e. t0U+V=0t_0U+V=0 almost surely — an exact affine relation Y=aX+bY=aX+b, with the sign of aa setting the sign of ρ=±1\rho=\pm1. Why: a non-negative quadratic touches zero only at a double root, and E[(t0U+V)2]=0E[(t_0U+V)^2]=0 forces the bracket to vanish with probability one.

Step 5. Now suppose XX and YY are independent, fXY=fXfYf_{XY}=f_Xf_Y. By LOTUS E[XY]=(∫xfX dx)(∫yfY dy)=μXμYE[XY]=\big(\int x f_X\,\mathrm dx\big)\big(\int y f_Y\,\mathrm dy\big)=\mu_X\mu_Y, so Cov⁡=0\operatorname{Cov}=0. Why: factorisation separates the double integral, so the mixed moment collapses to the product of means — independence always kills covariance.

Step 6. The converse fails: let XX be symmetric about zero and Y=X2Y=X^2; then E[X]=E[X3]=0E[X]=E[X^3]=0, so Cov⁡(X,X2)=E[X3]−E[X]E[X2]=0\operatorname{Cov}(X,X^2)=E[X^3]-E[X]E[X^2]=0, yet YY is a deterministic function of XX. Why: the parabola has no linear trend even though the dependence is total — uncorrelated is strictly weaker than independent.

Go deeper · Derivation C · 1 minConditioning a bivariate Gaussian yields another Gaussian
Derivation CConditioning a bivariate Gaussian yields another Gaussian

The goal is to prove the single most-used fact about correlated Gaussians: if (X,Y)(X,Y) are jointly normal, the conditional law of XX given Y=yY=y is again normal, its mean moving linearly with yy and its variance reduced below the marginal by the correlation. We take the standardised bivariate normal with correlation ρ\rho, divide by the Gaussian marginal of YY, and complete the square in xx; out drops N(ρy, 1−ρ2)\mathcal{N}(\rho y,\,1-\rho^2) — the result behind linear regression, Kalman filtering, and the reason uncorrelated upgrades to independent for Gaussians.

Step 1. Start from fXY(x,y)∝exp⁡ ⁣[−12(1−ρ2)(x2−2ρxy+y2)]f_{XY}(x,y)\propto\exp\!\big[-\tfrac{1}{2(1-\rho^2)}(x^2-2\rho xy+y^2)\big] and the marginal fY(y)∝e−y2/2f_Y(y)\propto e^{-y^2/2}, and form fX∣Y(x∣y)=fXY/fYf_{X\mid Y}(x\mid y)=f_{XY}/f_Y. Why: conditioning is equation (4), so we need the exponent surviving after the yy-marginal is divided out.

Step 2. Combine the exponents. The marginal contributes +12y2+\tfrac12 y^2, which cancels the yy-only pieces of the joint, leaving in xx just −12(1−ρ2)(x2−2ρxy)-\tfrac{1}{2(1-\rho^2)}(x^2-2\rho xy) plus terms independent of xx. Why: any factor without xx is a constant for the conditional in xx and is swept into the normalisation.

Step 3. Complete the square: x2−2ρxy=(x−ρy)2−ρ2y2x^2-2\rho xy=(x-\rho y)^2-\rho^2 y^2, so fX∣Y(x∣y)∝exp⁡ ⁣[−12(1−ρ2)(x−ρy)2]f_{X\mid Y}(x\mid y)\propto\exp\!\big[-\tfrac{1}{2(1-\rho^2)}(x-\rho y)^2\big]. Why: the exponent is now a perfect square in xx; the leftover −ρ2y2-\rho^2y^2 has no xx and is absorbed by the normaliser.

Step 4. Read off the parameters: N(ρy, 1−ρ2)\mathcal{N}(\rho y,\,1-\rho^2), so E[X∣Y=y]=ρyE[X\mid Y=y]=\rho y and Var⁡(X∣Y=y)=1−ρ2\operatorname{Var}(X\mid Y=y)=1-\rho^2. Why: matching exp⁡[−(x−μ)2/2σ2]\exp[-(x-\mu)^2/2\sigma^2] identifies μ=ρy\mu=\rho y and σ2=1−ρ2\sigma^2=1-\rho^2 directly.

Step 5. Set ρ=0\rho=0: the conditional collapses to N(0,1)\mathcal{N}(0,1), exactly the marginal of XX — knowing YY tells you nothing. Why: for Gaussians zero correlation makes the conditional equal the marginal, i.e. independence — the "uncorrelated becomes independent" gate that fails for general distributions.

Limiting cases

Special structures of the joint distribution collapse the general machinery into one-line statements — each row a place where a full joint law degenerates into something simpler.

CaseResultMeaning
IndependencefXY(x,y)=fX(x) fY(y)f_{XY}(x,y)=f_X(x)\,f_Y(y)Every conditional equals its marginal; covariance and correlation vanish; the joint characteristic function factorises.
Perfect linear dependenceρ=±1  ⟺  Y=aX+b a.s.\rho=\pm 1 \iff Y=aX+b\ \text{a.s.}The Cauchy–Schwarz bound is saturated; the probability hill collapses onto a straight line in the plane.
Jointly Gaussian, uncorrelatedρ=0⇒X⊥Y\rho=0 \Rightarrow X\perp YFor the multivariate normal only, zero covariance upgrades to full independence; the density factorises.
Discrete joint∑i∑jpij=1, pi⋅=∑jpij\sum_i\sum_j p_{ij}=1,\ p_{i\cdot}=\sum_j p_{ij}Integrals become sums; each marginal mass is a row or column sum of the joint table.
Uncorrelated, non-GaussianCov⁡=0\operatorname{Cov}=0 but fXY≠fXfYf_{XY}\ne f_Xf_YNo linear trend, yet dependence survives in higher moments — e.g. Y=X2Y=X^2 with symmetric XX.

Worked examples

1 · A discrete joint table, worked end to end (confidence builder)

Two binary detector flags X,Y∈{0,1}X,Y\in\{0,1\} fire with joint probabilities P(0,0)=0.3P(0,0)=0.3, P(0,1)=0.1P(0,1)=0.1, P(1,0)=0.2P(1,0)=0.2, P(1,1)=0.4P(1,1)=0.4. Find the marginals, a conditional, the covariance and correlation, and decide whether the flags are independent.

Step 1. Marginals are row and column sums. Over yy: P(X=0)=0.4P(X=0)=0.4, P(X=1)=0.6P(X=1)=0.6. Over xx: P(Y=0)=0.5P(Y=0)=0.5, P(Y=1)=0.5P(Y=1)=0.5. The cells sum to 1.01.0, so it is a valid joint law, and μX=E[X]=0.6\mu_X=E[X]=\mathbf{0.6}, μY=E[Y]=0.5\mu_Y=E[Y]=\mathbf{0.5}.

Step 2. A renormalised conditional slice: P(X=1∣Y=1)=0.4/0.5=0.8P(X=1\mid Y=1)=0.4/0.5=\mathbf{0.8}, whereas P(X=1∣Y=0)=0.2/0.5=0.4P(X=1\mid Y=0)=0.2/0.5=\mathbf{0.4}. Because the law of XX changes when YY flips, the flags are already visibly dependent.

Step 3. Covariance from the mixed moment: only the (1,1)(1,1) cell contributes, so E[XY]=0.4E[XY]=0.4 and Cov⁡(X,Y)=0.4−0.6×0.5=0.1\operatorname{Cov}(X,Y)=0.4-0.6\times0.5=\mathbf{0.1} — positive, so the flags tend to fire together.

Step 4. Correlation. For a 0/10/1 variable E[X2]=E[X]E[X^2]=E[X], so Var⁡X=0.6−0.36=0.24\operatorname{Var}X=0.6-0.36=0.24, σX=0.4899\sigma_X=0.4899; Var⁡Y=0.25\operatorname{Var}Y=0.25, σY=0.5\sigma_Y=0.5. Hence ρ=0.1/(0.4899×0.5)=0.408\rho=0.1/(0.4899\times0.5)=\mathbf{0.408}, consistent with Step 2.

Step 5. Independence check: independence needs P(1,1)=0.6×0.5=0.30P(1,1)=0.6\times0.5=0.30, but the table has 0.400.40. The joint does not factorise, so XX and YY are dependent, agreeing with Cov⁡≠0\operatorname{Cov}\ne0. Marginals 0.4/0.6 and 0.5/0.5, Cov⁡=0.1\operatorname{Cov}=0.1, ρ=0.408\rho=0.408, dependent.

2 · A continuous joint density on the unit square (fully worked)

Two quantities have joint density fXY(x,y)=x+yf_{XY}(x,y)=x+y on the unit square 0≤x,y≤10\le x,y\le1, zero elsewhere. Find the marginal of XX, the conditional fX∣Yf_{X\mid Y}, the covariance, and the correlation.

Step 1. Normalise, then marginalise: ∬[0,1]2(x+y)=∫01(12+y) dy=1\iint_{[0,1]^2}(x+y)=\int_0^1(\tfrac12+y)\,\mathrm dy=1, a legitimate density. Integrating out yy gives fX(x)=∫01(x+y) dy=x+12f_X(x)=\int_0^1(x+y)\,\mathrm dy=x+\tfrac12, and by symmetry fY(y)=y+12f_Y(y)=y+\tfrac12. fX(x)=x+12f_X(x)=x+\tfrac12.

Step 2. Conditional by equation (4): fX∣Y(x∣y)=x+y y+12 f_{X\mid Y}(x\mid y)=\dfrac{x+y}{\,y+\tfrac12\,}. It depends on yy — at y=0y=0 it is 2x2x (rising), at y=1y=1 nearly flat — so the conditional is not the marginal and the variables are dependent. fX∣Y(x∣y)=(x+y)/(y+12)f_{X\mid Y}(x\mid y)=(x+y)/(y+\tfrac12).

Step 3. Moments: E[X]=∫01x(x+12) dx=712≈0.583E[X]=\int_0^1 x(x+\tfrac12)\,\mathrm dx=\tfrac{7}{12}\approx0.583, E[X2]=14+16=512E[X^2]=\tfrac14+\tfrac16=\tfrac{5}{12}, so Var⁡X=512−(712)2=11144≈0.0764=Var⁡Y\operatorname{Var}X=\tfrac{5}{12}-(\tfrac{7}{12})^2=\tfrac{11}{144}\approx0.0764=\operatorname{Var}Y.

Step 4. Covariance: E[XY]=∬xy(x+y)=16+16=13E[XY]=\iint xy(x+y)=\tfrac16+\tfrac16=\tfrac13, so Cov⁡(X,Y)=13−(712)2=48−49144=−1144≈−0.00694\operatorname{Cov}(X,Y)=\tfrac13-(\tfrac{7}{12})^2=\tfrac{48-49}{144}=\mathbf{-\tfrac{1}{144}}\approx-0.00694 — slightly negative, since under this density a large xx makes a large yy marginally less likely.

Step 5. Correlation: with σX=σY=11/144\sigma_X=\sigma_Y=\sqrt{11/144}, ρ=(−1/144)/(11/144)=−111≈−0.0909\rho=(-1/144)/(11/144)=\mathbf{-\tfrac{1}{11}}\approx-0.0909 — the small tilt the density carries. Cov⁡=−1/144\operatorname{Cov}=-1/144, ρ=−1/11≈−0.091\rho=-1/11\approx-0.091, dependent despite the tiny correlation.

3 · Correlated errors: why quadrature can lie

Two resistors in series, R=R1+R2R=R_1+R_2, are each measured with uncertainty σ1=σ2=2 Ω\sigma_1=\sigma_2=2\ \Omega. A shared calibration correlates the measurements at ρ\rho. Find the uncertainty in RR for ρ=0,+0.5,−0.5\rho=0,+0.5,-0.5.

Step 1. Apply equation (8) with a=b=1a=b=1: Var⁡(R)=σ12+σ22+2Cov⁡\operatorname{Var}(R)=\sigma_1^2+\sigma_2^2+2\operatorname{Cov}, with Cov⁡=ρσ1σ2=4ρ\operatorname{Cov}=\rho\sigma_1\sigma_2=4\rho, so Var⁡(R)=8+8ρ\operatorname{Var}(R)=8+8\rho.

Step 2. Uncorrelated (ρ=0\rho=0): Var⁡(R)=8\operatorname{Var}(R)=8, σR=8=2.83 Ω\sigma_R=\sqrt{8}=\mathbf{2.83\ \Omega} — the familiar "add in quadrature" answer.

Step 3. Positively correlated (ρ=+0.5\rho=+0.5): Var⁡(R)=12\operatorname{Var}(R)=12, σR=3.46 Ω\sigma_R=\mathbf{3.46\ \Omega} — the shared calibration inflates the error by 22%22\%. Anti-correlated (ρ=−0.5\rho=-0.5): Var⁡(R)=4\operatorname{Var}(R)=4, σR=2.00 Ω\sigma_R=\mathbf{2.00\ \Omega} — the errors partly cancel. Quadrature gives 2.83 Ω2.83\ \Omega regardless; the truth is 3.463.46 or 2.00 Ω2.00\ \Omega depending on the sign of ρ\rho.

Physics of the portrait

The idea that dependence between two measured quantities is itself a number — bounded, dimensionless, computable — arrived late, out of nineteenth-century attempts to quantify heredity, then flowed back to unify the theory of errors Gauss and Laplace had begun.

Origins · 1 mincorrelation coefficient and how this was discovered
CC
correlation coefficient
the dependence number ρ = Cov(X,Y) / σ_X σ_Y, bounded to minus one through plus one · multivariate probability and the theory of errors in the physical sciences

The correlation coefficient is younger than the objects it measures. Joint laws of errors were already in use when Gauss formulated the normal law of observational error in 1809 and Laplace, working on astronomical and geodetic errors, developed the multivariate normal and its characteristic functions — but neither wrote down a normalised measure of dependence. That step came from the study of heredity. Francis Galton, plotting parents' heights against their children's around 1885, noticed both "regression toward the mean" and a reproducible "co-relation", sketching the tilted elliptical scatter that is the bivariate normal seen from above. Karl Pearson made it exact: in 1896 he defined the product-moment coefficient ρ=Cov⁡(X,Y)/σXσY\rho=\operatorname{Cov}(X,Y)/\sigma_X\sigma_Y, proved it lay in [−1,1][-1,1], and tied it to the bivariate normal whose contours are Galton's ellipses. The measure-theoretic footing that made a "joint distribution" a precise object — one probability measure on a product space, with marginals and conditionals derived by projection and disintegration — came with Kolmogorov's axioms in 1933. The physicist inherits it all at once: a covariance matrix for detector noise, a correlation reporting how two channels move together, and a conditional Gaussian N(ρy,1−ρ2)\mathcal{N}(\rho y,1-\rho^2) at the heart of least-squares fitting, the Kalman filter, and correlated-error propagation.

History
1809
— Gauss formulates the normal law of observational errors
1811
— Laplace develops the multivariate error distribution and characteristic functions
1885
— Galton finds regression and co-relation in parent–child height data
1896
— Pearson defines the product-moment correlation coefficient ρ
1933
— Kolmogorov's axioms put joint distributions on a measure-theoretic basis

Going further

Texts. Stone and Goldbart, Mathematics for Physics, probability chapter · Arfken and Weber, Mathematical Methods for Physicists, probability chapter (multivariate distributions and conditioning) · Hassani, Mathematical Physics, probability and statistics · Byron and Fuller, Mathematics of Classical and Quantum Physics, probability sections · Riley, Hobson and Bence, Mathematical Methods for Physics and Engineering, ch. 30 · Feller, An Introduction to Probability Theory and Its Applications, vol. 1. The worked-example results are: the discrete table gives Cov⁡=0.1\operatorname{Cov}=0.1, ρ=0.408\rho=0.408; the density x+yx+y gives Cov⁡=−1/144\operatorname{Cov}=-1/144, ρ=−1/11\rho=-1/11; the correlated sum gives σR∈{2.83,3.46,2.00} Ω\sigma_R\in\{2.83,3.46,2.00\}\ \Omega for ρ∈{0,+0.5,−0.5}\rho\in\{0,+0.5,-0.5\}.

Prerequisites. Random Variables and Probability Distributions · Conditional Probability and Bayes' Theorem · Expectation, Variance and Moments · Axioms of Probability. Leads to. Multivariate Gaussian Distribution · Central Limit Theorem · Moment-Generating and Characteristic Functions · Laws of Large Numbers and Convergence of Random Variables.

Ask the tutor: Ask me to build a joint distribution of your own — a table or a density — and I will walk you through its marginals, a conditional, and its correlation, or show you exactly why uncorrelated need not mean independent.

What exactly is the difference between a joint, a marginal, and a conditional distribution?

They are three views of one object. The joint fXY(x,y)f_{XY}(x,y) is the master: it assigns probability to every combination of values and contains everything. A marginal such as fX(x)f_X(x) is what you get by forgetting the other variable — integrating it out, collapsing the hill onto one axis. A conditional such as fX∣Y(x∣y)f_{X\mid Y}(x\mid y) is what you get by learning the other variable's value — cutting the hill along Y=yY=y and rescaling to unit area. Marginalising discards information; conditioning uses it. Both come from the joint, and neither can recreate the joint alone unless the variables are independent.

Why do I divide by the marginal when I condition, but not when I marginalise?

Because the two operations have opposite jobs. Marginalising sums probability — you add the joint over every value of the discarded variable, and since the joint already integrated to one, the result does too; no rescaling is needed. Conditioning restricts attention to one slice Y=yY=y, and a raw slice encloses area fY(y)f_Y(y), generally less than one. Dividing by fY(y)f_Y(y) is the unique rescaling that restores unit probability. So the marginal appears as a divisor only in conditioning, precisely because only conditioning breaks normalisation.

Does zero correlation ever guarantee independence?

In exactly one situation: when the variables are jointly Gaussian. There the entire dependence structure sits in the covariance matrix, so zeroing the off-diagonal really does factorise the joint into marginals — uncorrelated becomes independent. Outside the Gaussian world this fails spectacularly: take XX symmetric about zero and Y=X2Y=X^2, and the covariance is zero for lack of a linear trend even though YY is completely determined by XX. Covariance is blind to everything except linear co-movement, so a zero value rules out linear association only, never dependence in general — unless you already know the variables are Gaussian.

How does Bayes' theorem fall out of these definitions?

It is pure bookkeeping on the joint density. The joint factors two ways — fXY=fX∣Y(x∣y)fY(y)f_{XY}=f_{X\mid Y}(x\mid y)f_Y(y) and equally fXY=fY∣X(y∣x)fX(x)f_{XY}=f_{Y\mid X}(y\mid x)f_X(x) — because either variable can be the one you condition on. Setting the two products equal and solving for fX∣Yf_{X\mid Y} gives fX∣Y(x∣y)=fY∣X(y∣x)fX(x)/fY(y)f_{X\mid Y}(x\mid y)=f_{Y\mid X}(y\mid x)f_X(x)/f_Y(y), Bayes' theorem. The pieces are named: fXf_X prior, fY∣Xf_{Y\mid X} likelihood, fYf_Y evidence, fX∣Yf_{X\mid Y} posterior. So Bayes' theorem is not an extra axiom but the statement that a joint density has two equivalent conditional factorisations.

Why does the covariance term matter so much in error propagation?

Because dropping it can make your quoted uncertainty flatly wrong, either way. The variance of a sum (or any function) of correlated inputs carries a cross-term 2abCov⁡(X,Y)2ab\operatorname{Cov}(X,Y), and the naive "add in quadrature" rule silently zeroes it — valid only for uncorrelated inputs. Real measurements are often correlated through a shared calibration or systematic. As Worked Example 3 shows, two 2 Ω2\ \Omega uncertainties combine to 2.83 Ω2.83\ \Omega if independent, but 3.46 Ω3.46\ \Omega if ρ=0.5\rho=0.5 or 2.00 Ω2.00\ \Omega if anti-correlated — nearly two to one. This is why modern experiments publish full covariance matrices, not lists of independent error bars.

What makes the covariance matrix positive semidefinite, and why should I care?

It is positive semidefinite because it is built from expectations of squares: for any weights a\mathbf a, a⊤Σ a=Var⁡(a⊤X)≥0\mathbf a^\top\boldsymbol\Sigma\,\mathbf a=\operatorname{Var}(\mathbf a^\top\mathbf X)\ge0, so Σ⪰0\boldsymbol\Sigma\succeq0 automatically. You care for three reasons. Every eigenvalue is non-negative, so diagonalising Σ\boldsymbol\Sigma yields real variances along uncorrelated principal directions — the basis of principal-component analysis. It is a consistency check: a matrix with a negative eigenvalue cannot be a genuine covariance and signals an error. And for a Gaussian it must be invertible to write the density at all, its inverse (the precision matrix) appearing in the exponent.

Before this

Where this leads