Mean of the result of iterations...

Table[r = Print[100*Log[(-1)/(RandomReal - 1)]], {i, 100}]

OR

Do[r = Print[100*Log[(-1)/(RandomReal[] - 1)]], {i, 100}]

I get 100 iterations of this expression. I need to find the mean/average of these iterations. How can I do this?

So whenever I do Table[r = Print[100*Log[(-1)/(RandomReal[] - 1)]];, {i, 100}] I get the result of each iteration one by one, but then at the end I get the list with {Null, Null, Null, Null, etc…}. Why is this?

Picture of what’s going on…

If the “100” of “100 iterations” is the same as the “100” in {i,100}, then the following will get you the mean:

Mean[100 Log[-1/(RandomReal[1, 100] - 1)]]

Or are there 100 iterations of the 100 random draws?

Jim, thanks for your response. The RandomReal[] should be a random number between 0 and 1, not 1 and 100.

My idea is this:

I have an expression 100*Log[(-1)/(RandomReal[] - 1)]

I want to solve this 100 times, using a random real number between 0 and 1 each time.

Then I will get 100 values of r = 100*Log[(-1)/(RandomReal[] - 1)], and then I have to calculate the mean of all of these values.

But

RandomReal[1, 100]

returns 100 random numbers between 0 and 1.

RandomReal[{1, 100}]

returns a single random number between 1 and 100.

Beautiful! Thank you.