I am trying to use Monte Carlo Integration, which is nicely described in the answer here (Confusion about Monte Carlo integration).
I am using Monte Carlo Integration to evaluate $\int_0^1x^2\,dx$.
I set $w(x) = f(x)/g(x) = x^2/2x = x/2$
Then, I solved for $(1/n)\sum_i^nw(x_n) = (1/n)\sum_i^nx/2$
However, I do not know if this is a good solution. I would like to know of other ideas, and why they are better.
The reason I do not think this is a good solution is if I actually solve for:
$\int_0^1x^2\,dx$ = $x^3/3 = 1/3-0 = 1/3$
But when I look at my answer, the mean will be 1/4 (not 1/3). Had I used a different equation, such as $(1/n)\sum_i^nx/1.5$, then I will get a mean of 1/3, which is very close to what the true integration is. Thank you!
http://math.stackexchange.com/questions/1635250/
for more on Monte Carlo. – BruceET Feb 01 '16 at 17:40