- #1
Sonden
- 7
- 0
Homework Statement
I am supposed to calculate/estimate pi using a Monte Carlo method. This is of course trivial: create N uniformly distributed random pairs (x,y) in [0,1]^2 and check how many, M, that have x^2+y^2<1. Then M/N=pi/4.
Now, the strange thing is that I am not supposed to do it that way. Instead I'm supposed to use a double integral (Monte Carlo integration): "At a first glance, this may not seem like a integration problem, but it can be formulated as such. Write down the (double) integral (and thus the expected value) that correspond to this procedure, i.e. the integral I = 4E[g(X)] = pi", where E[g(X)] is the expected value for a function g and X a random variable. I've glanced at it for several hours now, I still haven't got a clue how to do it. Of course,
[tex]\int_0^1 \int_0^{2 \pi}rdrd\theta=\pi[/tex]
but is this useful here?