Overview
The Box-Muller Transform converts two independent uniform samples into two independent standard normal samples.
Generates normally distributed random values from uniform random values.
Compact metadata for implementation and discovery.
The Box-Muller Transform converts two independent uniform samples into two independent standard normal samples.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(1)
Worst
O(1)
Space
O(1)
z0 = sqrt(-2 * ln(u1)) * cos(2*pi*u2)Transforms two uniform random values into a standard normal sample.
Show uniform points mapped into a bell-shaped distribution.
Box-Muller Transform operates in O(1) time and O(1) space within the Random Variate Generation family. Key governing relation: z0 = sqrt(-2 * ln(u1)) * cos(2*pi*u2). Often compared with Linear Congruential Generator and Monte Carlo Simulation.
What each reference supports for this entry.
Original reference for generating normal variates from uniform random variables.
Open sourceRandom variate generation reference for Box-Muller Transform's distribution-sampling mechanism and acceptance or transform rules.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Randomness & Sampling · Core
Marsaglia's polar method is a rejection-based Box-Muller variant that avoids explicit trigonometric functions.
Compare with thisRandomness & Sampling · Core
The ziggurat method and Box-Muller transform both generate nonuniform variates, especially normal variates, with different rejection/transform tradeoffs.
Compare with thisBox-Muller transforms uniform random values into Gaussian samples.
Box-Muller needs a source of uniform random values.