Use Monte Carlo algorithm to approximately compute E(X).

integrationmonte carloprobability theory

enter image description here
I'm okay with (a), but I got stuck in trying to solve (b)

My idea was to change the integration $$ \int_0^1 \int_{0}^1 x g(x,y) \ dxdy $$ to be the expectation for a function of $X, Y$

Similarly, I want to do the same thing for $$ \int_0^1 \int_{0}^1 g(x,y) \ dxdy $$ also be a random variable relating to $X, Y$.

But I don't know how to do this. I don't know how to let the integration be the expectation of "something". To be more specific, for the one-variable integration $$ \int_{0}^\infty e^{-5x-14x^2} \ dx$$

I can manipulate this integration to be $$ \int_{0}^\infty \dfrac{1}{5}e^{-14x^2} \cdot 5e^{-5x} \ dx=\dfrac{1}{5}E(e^{-14X^2})$$ where $X\sim Exponential(5)$. Now the original integration is changed to be the expectation of a random variable $e^{-14X^2}=h(X)$ which is a function of random variable $X$ with the distribution of $X$ being Exponential(5).

I don't know how to do the same thing here(for this double integration), or maybe, this question doesn't need to use Monte Carlo for double integration.

Any help on this? Thanks.

Best Answer

You're showing some interesting ideas in your manipulations, but that's not what this particular question is asking for.

A "Monte Carlo algorithm" means you'll approximate some quantity by running a bunch of random trials. The point of this problem is that if you wanted to approximate $E(X)$ using random sampling but you didn't do part (a) then it wouldn't be so clear how to start: you can't evaluate $f$ because you don't know what $c$ is. But now that you've done part (a), you can just use random sampling (aka Monte Carlo) to approximate the integrals $\int_0^1 \int_0^1 x g(x,y)dxdy$ and $\int_0^1 \int_0^1 g(x,y)dxdy$. Then you could plug those approximate values into the formula from (a) to get a final approximation for $E(X)$.


I'm not sure if you see how to approximate those individual integrals using random sampling so I'll add a bit of extra explanation just in case. Here's a Wikipedia page too. The idea is:

  1. Pick a bunch of random points in the integration domain. In this case you'd pick random $(x,y)$ with $0 \le x, y \le 1$.
  2. Evaluate your integrand at each of those points.
  3. The approximate answer will be $(\text{2D area of the domain}) \cdot (\text{average value you computed across all your random points})$.

You could think of this method conceptually like: Volume of a 3D region equals the 2D area of the base times the average height.

You can use any number of random sampled points you want, but you'll get more accurate results if you use more points.