- #1
Artusartos
- 247
- 0
Homework Statement
Recall that [itex]log 2 = \int_0^1 1/(x+1) dx[/itex]. Hence, by using a uniform(0,1) generator, apprximate 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.
Homework Equations
The Attempt at a Solution
My answer:
[tex]\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))[/tex]
Where f(x)=1, 0<x<1
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.
My Question:
Is my answer correct? Can I use the calculator to approximate log 2? If I shouldn't be using it...the problem that I'm having is if I try to compute the expected value, I get log 2. So it doesn't help much. Can anybody give me a hint if my answer is wrong? By the way, I know I didn't compute the confidence interval yet...but I'm just asking if this portion of the problem is correct.
Thanks in advance
Last edited: