You are on page 1of 2

Box Muller Method

Takashi Shinzato(shinzato@sp.dis.titech.ac.jp)
January 27, 2007

1 Motivation Eq.(8) is Jaccobian. Hence, we show so


Z ∞ Z 2π Z ∞
x2 +y 2 r2
Box Muller method
dxdye− 2 = drre− 2

−∞ 0 0
Z ∞ µ ¶
0.4
Box Muller method

r2
p(x)

due−u
0.35
= 2π u=
0 2
0.3
£ −u ¤∞
0.25
= 2π −e 0
= 2π. (9)
p(x)

0.2
Namely, eq.(2) is true. Therefore, we give then
Z ∞
0.15

1 x2 +y 2
0.1
1 = dxdye− 2 , (10)
0.05
2π −∞
0
-4 -2 0 2 4 and in the case that x is distributed on probability mea-
x 2
−x
sure (or mass probability) p(x) = e√2π2 , stochastic vari-
Figure 1: Box Muller method; random variable x is able x is called gaussian random variable.
asymptotically distributed on N (0, 1).

2 Box Muller Method


In this informal note, we discuss normal gaussian ran-
dom variable x ∼ N (0, 1)1 using stochastic variables on In this section, we present and introduce Box Muller
uniform distribution in [0, 1]. At first step, we indicate method. Providing with the law of large numbers or cen-
then the following relation as ter limit theorem, gaussian random variable has played an
important role and one makes usefull for hypothesis and
Z ∞ √ test in Data science and so on. We define a new function
x2
dxe− 2 = 2π. (2) as
−∞
Z
1 x2 +y 2
In order to prove eq.(2), we present via U (R) : = dxdye− 2 . (11)
2π x2 +y2 ≤R2
µZ ∞ ¶2 Z ∞
(3) This integral interval is in x + y ≤ R . We calcurate
2 x2 +y 2 2 2 2
− x2
dxe = dxdye− 2 ,
−∞ −∞ then briefly
Z 2π Z R
and replace x and y to r and θ like2 1 r2
U (R) = dθ drre− 2
2π 0 0
x = r cos θ, (4) Z R22
R2
y = r sin θ. (5) = due−u = 1 − e− 2 (12)
0

Using eq.(4) and eq.(5), they are also held as U (R) is nondecreasing function satisfied as

x2 + y 2 = r2 (6) lim U (R) = 0 (13)


R→0
y
tan−1 = θ (7) lim U (R) = 1 (14)
¯ x¯ R→∞
¯ ∂(x, y) ¯
¯ ¯
¯ ∂(r, θ) ¯ = r (8) Moreover, by eq.(11), the integral interval is replaced using
0 ≤ r ≤ R and eq.(4) and eq.(5). We represent that using
1 Normal distribution is distributed on p ∈ [0, 1] and eq.(12), variable R of U (R) = p is decided
x2 as
e− 2
p(x) : = √ ⇐= N (0, 1) (1) p
2π U (R) = p =⇒ R = −2 log(1 − p). (15)
with the mean 0 and the variance 1.
2 r > 0 and 0 ≤ θ ≤ 2π In setting s := 1 − p ∈ [0, 1] and t ∈ [0, 1], it is given as

1
½ p
x = p−2 log(s) cos (2πt) (16)
−2 log(s) sin (2πt) .

That is to say, we give then the scheme that we gener-


ate gaussian random variable distributed on N (0, 1) us-
ing uniform distribution on [0, 1]; its scheme is called Box
Muller method. More being generalized, stochastic vari-
able z ∼ N (µ, σ 2 ), with the mean µ and the variance σ 2 ,
is given as
p
z = µ + σ −2 log(s) cos (2πt) , (17)

or
p
z = µ+σ −2 log(s) sin (2πt) . (18)

3 Conclusion
We introduce and discuss, in this informal note, the
scheme of normal distribution N (0, 1) using unique dis-
tribution on [0, 1], Box Muller method.

Box Muller method


0.5
Frequency on Box Muller method(106)
N(0,1)

0.4

0.3
p(x)

0.2

0.1

0
-4 -2 0 2 4
x

Figure 2: Frequency on Box Muller method is asymptoti-


cally distributed on N (0, 1).

You might also like