物理学计划 Physics Project PX319

0

这是一份warwick华威大学PX264的成功案例

物理学计划 Physics Project PX319


$$
u=-\ln \left(1-x^{\prime}\right)
$$
where $x^{\prime}$ is a random number generated for $x^{\prime} \in[0,1]$. With
$$
x=r \cos (\theta)=\sqrt{2 u} \cos (\theta),
$$
and
$$
y=r \sin (\theta)=\sqrt{2 u} \sin (\theta)
$$
We can obtain new random numbers $x, y$ through
$$
x=\sqrt{-2 \ln \left(1-x^{\prime}\right)} \cos (\theta),
$$
and
$$
y=\sqrt{-2 \ln \left(1-x^{\prime}\right)} \sin (\theta),
$$
with $x^{\prime} \in[0,1]$ and $\theta \in 2 \pi[0,1]$.

英国论文代写Viking Essay为您提供作业代写代考服务

PX264 COURSE NOTES :

Evaluate thereafter
$$
I=\int_{a}^{b} F(x) d x=\int_{a}^{b} p(x) \frac{F(x)}{p(x)} d x
$$
by rewriting
$$
\int_{a}^{b} p(x) \frac{F(x)}{p(x)} d x=\int_{a}^{b} \frac{F(x(y))}{p(x(y))} d y
$$
since
$$
\frac{d y}{d x}=p(x) .
$$
Perform then a Monte Carlo sampling for
$$
\int_{a}^{b} \frac{F(x(y))}{p(x(y))} d y, \approx \frac{1}{N} \sum_{i=1}^{N} \frac{F\left(x\left(y_{i}\right)\right)}{p\left(x\left(y_{i}\right)\right)}
$$
with $y_{i} \in[0,1]$,