Simulation methods and generating random variables

480 Views Asked by At

Twenty aircraft are sent to bomb a target that is rectangular in shape. enter image description here

It has dimensions 150m by 50m.

Each aircraft makes a bombing run along the horizontal x axis and drops one bomb. The point of impact has coordinates (x,y) where x and y are two independent random variables, where $x$ is negative exponentially distributed with mean 75 and $y$ is uniformly distributed in the range $\left(-5, 50\right)$, units being metres.

I am trying to use simulation methods to estimate the expected number of bombs hit by the twenty aircraft, given 20 pairs of random numbers from $\left[0,1\right]$.

The only simulation method I am aware of is Monte-Carlo whereby you count the number of hits that fall under the curve, i.e. where $y<f\left(x_{RN}\right)$

I have previously shown that random variables from the Negative Exponential distribution can be generated using $x=\dfrac{-1}{\lambda}\log\left(u\right)$ so I assume it involves using this. Can anyone give me an idea of the method I need to use?

2

There are 2 best solutions below

0
On

I am trying to use simulation methods to estimate the expected number of bombs hit by the twenty aircraft, given 20 pairs of random numbers from [0,1].

Details will depend on the programming language, but the idea is to have a procedure that simulates twenty random points $(x,y)$ and determines how many of those twenty points, say $N_{20}$, fall in the given target region. That procedure is then performed a sufficiently large number of times, say $n$ times, giving a simulated random sample of instances of $N_{20}$, say $$sample = [N_{20}^{(1)}, N_{20}^{(2)}, ..., N_{20}^{(n)}].$$ The arithmetic average of these then estimates the expected value: $$\overline{N_{20}} = \mathrm{mean}(sample) = \frac{1}{n} \sum_{i=1}^n N_{20}^{(i)} $$ and the standard error of this estimate is given by $$\frac{\text{standard deviation}(sample)}{\sqrt{n}} $$

The number of samples should be large enough to make the standard error acceptably small.


Here's an example simulation using Sage:

def bomb20():
    count = 0
    for i in range(20):
        x = -75*log(random())
        y = -5 + 55*random()
        if ( (0 <= x <= 150) and (-25 <= y <= 25) ): count += 1
    return count

n = 10^4
sample = [bomb20() for i in range(n)]
print mean(sample).n()
print (std(sample)/sqrt(n)).n()

> 9.43235000000000
> 0.00704477595553490

where it is assumed that the $x$-axis runs down the middle of the target. (If the target has a different location, the condition in the if statement must be changed accordingly.)


For comparison, the problem is simple to solve exactly, since the random variable $N_{20}$ has a binomial distribution; viz., the exact expectation can be found as follows:

$$\begin{align} \mathbb{E}\ N_{20} &= 20\ P(\text{success})\\ &= 20\ P(\ (0\le X \le 150)\ \text{ AND }\ (-25\le Y\le 25)\ )\\ &= 20\ P(0\le X \le 150)\ P(-25\le Y\le 25)\\ &= 20\ (1-e^{-150/75})\ P(-5\le Y \le 25)\\ &= 20\ (1-e^{-2})\ \frac{25-(-5)}{50-(-5)}\\ &= 20\ (1-e^{-2})\ \frac{30}{55}\\ &= 9.432706... \end{align}$$

0
On

This can be determined analytically.
P(Bomb hits the target)=P(correct X) P(correct Y) P(correct Y)=30/55 easily, since Y follows a uniform distribution P(correct X) is a difference of the cumulative distribution, given by

$$P_x=1-e^{150/75}=1-e^2$$ So the expected number of bombs hitting the target is given by $$E=20 \cdot 30/55 \cdot (1-e^2)$$