You can draw samples from Uniform(0,1), and you have Φ−1, the inverse CDF of the standard normal N(0,1). How do you generate samples from a 2D normal distribution N(μ,Σ), and how do you show that they have the right mean and covariance?

Probability and statistics, Sampling
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can chain inverse-transform sampling with a matrix square root of the covariance, and check the result.

Key idea

Inverse-transform sampling turns u∼U(0,1) into z=Φ−1(u)∼N(0,1). Put two independent draws into a vector z∼N(0,I2). Factor Σ=LL⊤ and set x=μ+Lz. Then E[x]=μ and Cov⁡(x)=LIL⊤=Σ.

Steps

  1. Justify inverse-transform sampling. If U∼U(0,1) and F is a continuous, strictly increasing CDF, then P(F−1(U)≤x)=P(U≤F(x))=F(x), so F−1(U) has CDF F. Hence zj=Φ−1(uj) is standard normal.
  2. Draw two independent uniforms u1,u2 and set z=(Φ−1(u1),Φ−1(u2))⊤. Independent standard normals together form z∼N(0,I2): mean zero, identity covariance.
  3. Find a “square root” L of Σ, meaning LL⊤=Σ. The Cholesky factorisation gives a lower-triangular one. For Σ=(σ12ρσ1σ2ρσ1σ2σ22), with ρ the correlation, L=(σ10ρσ2σ21−ρ2). Multiply out LL⊤ to check. Another choice is the eigendecomposition Σ=QΛQ⊤ with L=QΛ1/2.
  4. Set x=μ+Lz. Written out: x1=μ1+σ1z1 and x2=μ2+σ2(ρz1+1−ρ2 z2).
  5. Verify. A linear map of a Gaussian vector plus a constant is Gaussian. E[x]=μ+L E[z]=μ, and Cov⁡(x)=LCov⁡(z)L⊤=LL⊤=Σ.

Common mistakes

How long your answer should be

Half a page; 4–5 minutes, with the inverse-transform proof in one line.

Last checked on 4 December 2026.

Read this

Previous in Probability and statistics: Why is 1n∑i(xi−xˉ)2 a biased estimator of σ2, and why does dividing by n−1 instead remove the bias?
Next in Probability and statistics: Two classifiers A and B are evaluated on the same 1,000 test examples. A is right and B wrong on 30 examples; B is right and A wrong on 15. Is A significantly better at the 5% level, and what does the p-value mean here?