Can the Weak Law of Large Numbers Effectively Estimate Log 2?

Artusartos
Messages
236
Reaction score
0

Homework Statement


Recall that log 2 = \int_0^1 1/(x+1) dx. 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:

\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<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:
Physics news on Phys.org
I'm not certain I understand what you're being asked to do. What is "an error of estimation"? Should that be "an estimate of error"? Reading what you've actually done doesn't make it any clearer.
I think the question is asking you to:
1. Figure out how to generate random variable with an expected value of log2 from one that's uniform in (0,1). You've done that.
2. Obtain an approximate value for log2 by averaging many samples of this r.v. Did you do that? You mention "approximating" log 2 by using a calculator, which I would have thought was far more accurate than they intend.
3. Given the size of the sample, estimate the 95% confidence interval for the value approximated by sampling. I see no attempt to do that.
 
haruspex said:
I'm not certain I understand what you're being asked to do. What is "an error of estimation"? Should that be "an estimate of error"? Reading what you've actually done doesn't make it any clearer.
I think the question is asking you to:
1. Figure out how to generate random variable with an expected value of log2 from one that's uniform in (0,1). You've done that.
2. Obtain an approximate value for log2 by averaging many samples of this r.v. Did you do that? You mention "approximating" log 2 by using a calculator, which I would have thought was far more accurate than they intend.
3. Given the size of the sample, estimate the 95% confidence interval for the value approximated by sampling. I see no attempt to do that.

Yes, I didn't do 3 yet. I want to know if I did 2 correctly. I used R to see what the mean would be for a sample size of 10,000. I then compared that with what I got from the calculator. Do you think that's right?
 
Artusartos said:
Yes, I didn't do 3 yet. I want to know if I did 2 correctly. I used R to see what the mean would be for a sample size of 10,000. I then compared that with what I got from the calculator. Do you think that's right?

Not sure how you're numbering sections. You appear to have done the last part, "Obtain your estimate for 10,000 simulations and compare it to the true value", and that's fine. It's not clear to me what they want you to write down to demonstrate that you compared them.
 
haruspex said:
Not sure how you're numbering sections. You appear to have done the last part, "Obtain your estimate for 10,000 simulations and compare it to the true value", and that's fine. It's not clear to me what they want you to write down to demonstrate that you compared them.

I'm numbering them according to the numbering that you gave in your first post.
 
Artusartos said:
I'm numbering them according to the numbering that you gave in your first post.
Ah yes - sorry.
Then yes, what you have done for 1 and 2 looks fine, but none of that involved checking with a calculator. That's the last part of the OP, which I did not get as far as assigning a number to.
 
haruspex said:
Ah yes - sorry.
Then yes, what you have done for 1 and 2 looks fine, but none of that involved checking with a calculator. That's the last part of the OP, which I did not get as far as assigning a number to.

By the way, what does "OP" mean?
 
Artusartos said:
By the way, what does "OP" mean?
Original Post (i.e. the start of the thread)
 
haruspex said:
Original Post (i.e. the start of the thread)

Ok thanks :)
 
Back
Top