Para demostrar la validez de este algoritmo veamos que
∀
x
∈
R
X
{\displaystyle \forall \;x\in R_{X}}
se verifica
P
[
X
≤
x
]
=
∫
−
∞
x
f
(
y
)
d
y
{\displaystyle \operatorname {P} [X\leq x]=\int _{-\infty }^{x}f(y)dy}
Notemos que
P
[
X
≤
x
]
=
P
[
Y
≤
x
|
U
≤
f
(
Y
)
g
(
Y
)
]
=
P
[
Y
≤
x
,
U
≤
f
(
Y
)
g
(
Y
)
]
P
[
U
≤
f
(
Y
)
g
(
Y
)
]
{\displaystyle {\begin{aligned}\operatorname {P} [X\leq x]&=\operatorname {P} \left[Y\leq x\;{\bigg |}\;U\leq {\frac {f(Y)}{g(Y)}}\right]\\&={\frac {\displaystyle \operatorname {P} \left[Y\leq x\;,\;U\leq {\frac {f(Y)}{g(Y)}}\right]}{\displaystyle \operatorname {P} \left[U\leq {\frac {f(Y)}{g(Y)}}\right]}}\end{aligned}}}
pero
P
[
Y
≤
x
,
U
≤
f
(
Y
)
g
(
Y
)
]
=
∫
−
∞
x
P
[
Y
≤
x
,
U
≤
f
(
Y
)
g
(
Y
)
|
Y
=
y
]
d
(
y
)
d
y
=
∫
−
∞
x
P
[
U
≤
f
(
Y
)
g
(
Y
)
|
Y
=
y
]
g
(
y
)
M
d
y
=
∫
−
∞
x
P
[
U
≤
f
(
y
)
g
(
y
)
]
g
(
y
)
M
d
y
=
∫
−
∞
x
f
(
y
)
g
(
y
)
g
(
y
)
M
d
y
=
1
M
∫
−
∞
x
f
(
y
)
d
y
{\displaystyle {\begin{aligned}\operatorname {P} \left[Y\leq x\;,\;U\leq {\frac {f(Y)}{g(Y)}}\right]&=\int _{-\infty }^{x}\operatorname {P} \left[Y\leq x\;,\;U\leq {\frac {f(Y)}{g(Y)}}\;{\bigg |}\;Y=y\right]d(y)dy\\&=\int _{-\infty }^{x}\operatorname {P} \left[U\leq {\frac {f(Y)}{g(Y)}}\;{\bigg |}\;Y=y\right]{\frac {g(y)}{M}}\;dy\\&=\int _{-\infty }^{x}\operatorname {P} \left[U\leq {\frac {f(y)}{g(y)}}\right]{\frac {g(y)}{M}}\;dy\\&=\int _{-\infty }^{x}{\frac {f(y)}{g(y)}}{\frac {g(y)}{M}}\;dy\\&={\frac {1}{M}}\int _{-\infty }^{x}f(y)dy\end{aligned}}}
y
P
[
U
≤
f
(
Y
)
g
(
Y
)
]
=
∫
R
Y
P
[
U
≤
f
(
Y
)
g
(
Y
)
|
Y
=
y
]
d
(
y
)
d
y
=
∫
R
Y
P
[
U
≤
f
(
y
)
g
(
y
)
]
g
(
y
)
M
d
y
=
∫
R
Y
f
(
y
)
g
(
y
)
g
(
y
)
M
d
y
=
1
M
∫
R
Y
f
(
y
)
d
y
=
1
M
{\displaystyle {\begin{aligned}\operatorname {P} \left[U\leq {\frac {f(Y)}{g(Y)}}\right]&=\int _{R_{Y}}\operatorname {P} \left[U\leq {\frac {f(Y)}{g(Y)}}\;{\bigg |}\;Y=y\right]d(y)dy\\&=\int _{R_{Y}}\operatorname {P} \left[U\leq {\frac {f(y)}{g(y)}}\right]{\frac {g(y)}{M}}\;dy\\&=\int _{R_{Y}}{\frac {f(y)}{g(y)}}{\frac {g(y)}{M}}\;dy\\&={\frac {1}{M}}\int _{R_{Y}}f(y)dy\\&={\frac {1}{M}}\end{aligned}}}
Por lo tanto
P
[
X
≤
x
]
=
P
[
Y
≤
x
,
U
≤
f
(
Y
)
g
(
Y
)
]
P
[
U
≤
f
(
Y
)
g
(
Y
)
]
=
1
M
∫
−
∞
x
f
(
y
)
d
y
1
M
=
∫
−
∞
x
f
(
y
)
d
y
{\displaystyle {\begin{aligned}\operatorname {P} [X\leq x]&={\frac {\operatorname {P} \left[Y\leq x\;,\;U\leq {\frac {f(Y)}{g(Y)}}\right]}{\operatorname {P} \left[U\leq {\frac {f(Y)}{g(Y)}}\right]}}\\&={\frac {\displaystyle {\frac {1}{M}}\int _{-\infty }^{x}f(y)dy}{\displaystyle {\frac {1}{M}}}}\\&=\int _{-\infty }^{x}f(y)dy\end{aligned}}}
Ross, S.M. (2013). Simulation . Academic Press.
Law, A.M. (2014) Simulation Modeling and Analysis . McGrawHill.