How does the Box-Muller transform work to generate standard normal random variates from uniform random numbers?

Quick Overview

Asks how the Box-Muller transform turns pairs of uniform random numbers into independent standard normal draws and why the construction is valid. Tests polar coordinates, change of variables, inverse transform sampling and practical issues in random number generation.

How does the Box-Muller transform work to generate standard normal random variates from uniform random numbers?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

How does the Box-Muller transform work to generate standard normal random variates from uniform random numbers? Explain why the construction is valid and what to watch for when you implement it. ```hint Think in two dimensions Write the joint density of two independent standard normals and switch to polar coordinates. Look at what distributions the radius and the angle turn out to have. ``` ```hint Sampling the radius Once you know the distribution of the squared radius, ask how a single uniform draw can produce it. ``` ### What a Strong Answer Covers - The transform itself: which uniform drives which quantity, and the formulas for the two outputs - A polar-coordinates argument for the radius and angle distributions and for why the two outputs are independent - Why the method is used instead of inverting the normal CDF directly - Practical concerns such as a zero uniform draw, the polar variant, and scaling to a normal with any mean and variance ### Follow-up Questions - How does Marsaglia's polar method avoid computing sine and cosine, and what fraction of its proposals is accepted? - With 32-bit uniforms, what is the largest value of $|Z|$ the transform can return, and when does that matter? - How would you turn these draws into a correlated bivariate normal, or a multivariate normal with covariance $\Sigma$? - Why can a poor uniform generator make Box-Muller output look structured?

Overview: Asks how the Box-Muller transform turns pairs of uniform random numbers into independent standard normal draws and why the construction is valid. Tests polar coordinates, change of variables, inverse transform sampling and practical issues in random number generation.

PracHub logo
General
Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

How does the Box-Muller transform work to generate standard normal random variates from uniform random numbers? Explain why the construction is valid and what to watch for when you implement it.

What a Strong Answer Covers Guidance

  • The transform itself: which uniform drives which quantity, and the formulas for the two outputs
  • A polar-coordinates argument for the radius and angle distributions and for why the two outputs are independent
  • Why the method is used instead of inverting the normal CDF directly
  • Practical concerns such as a zero uniform draw, the polar variant, and scaling to a normal with any mean and variance

Follow-up Questions Guidance

  • How does Marsaglia's polar method avoid computing sine and cosine, and what fraction of its proposals is accepted?
  • With 32-bit uniforms, what is the largest value of ∣Z∣|Z| the transform can return, and when does that matter?
  • How would you turn these draws into a correlated bivariate normal, or a multivariate normal with covariance Σ\Sigma ?
  • Why can a poor uniform generator make Box-Muller output look structured?