The given problem is as follows:
Recall that $\log 2 = \int_0^1 1/(x+1) dx$. Hence, by using a uniform $(0,1)$ generator, approximate $\log 2$. Obtain an error of estimation in terms of a large sample 95% confidence interval. If you have access to the statistical package R, write an R function for the estimate and the error of estimation. Obtain your estimate for 10,000 simulations and compare it to the true value.
$$\int_0^1 1/(x+1) dx = (1-0)\int_0^1 1/(x+1) dx/(1-0) = \int_0^1 1/(x+1) f(x) dx = E(1/(x+1))$$
Where f(x)=1, 0
And then I calculated log 2 from the calculator and got 0.6931471806
From R, I got 0.6920717
So, from the weak law of large numbers, we can see that the sample mean is approaching the actual mean as n gets larger.
Is my answer correct? Can I use the calculator to approximate log 2?
Thanks in advance