You can draw samples from Uniform, and you have , the inverse CDF of the standard normal . How do you generate samples from a 2D normal distribution , 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 into . Put two independent draws into a vector . Factor and set . Then and .
Steps
- Justify inverse-transform sampling. If and is a continuous, strictly increasing CDF, then , so has CDF . Hence is standard normal.
- Draw two independent uniforms and set . Independent standard normals together form : mean zero, identity covariance.
- Find a “square root” of , meaning . The Cholesky factorisation gives a lower-triangular one. For , with the correlation, . Multiply out to check. Another choice is the eigendecomposition with .
- Set . Written out: and .
- Verify. A linear map of a Gaussian vector plus a constant is Gaussian. , and .
Common mistakes
- Using , which gives covariance . You need a square root of .
- Using the same uniform for both coordinates. Then , and the components are not independent.
- Writing . The correct order is .
- Forgetting that Cholesky needs to be positive definite. If it is only semidefinite, use the eigendecomposition with .
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 a biased estimator of , and why does dividing by 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?