# Limit of log(random1+random2+…+randomn)/n

I have this "R" code (I don't know how to use R):

repeat {
s = s+log(random);
c = c+1;
print(s/c);
}


It should show a string of numbers. Where does it tends to?

I have tried to translate this into math, so I THINK, I should try to compute this limit:

$$\lim \limits_{n \to \infty} \frac{log(x_1\cdot x_2 \cdot ... \cdot x_n)}{n}$$ where $x_1, ...., x_n$ are the random variables.

Is this limit correct? How can I compute this limit?

Thank you very much!!!

• You need to define the object $s$. – Wuestenfux Jun 12 '17 at 7:10
• Do you know anything about the distribution of the random variable? – Matti P. Jun 12 '17 at 7:11
• I think if the random variable has a uniform distribution between 0 and 1 (like random number generators in computers usually do), then the logarithm of this is always negative. Therefore, you're just adding some negative numbers together, and the sum tends to minus infinity. And when divided by the number of random numbers, it appears to be $-1$. – Matti P. Jun 12 '17 at 7:16
• @MattiP. that's all I know. – MM PP Jun 12 '17 at 7:19
• @MattiP. Thank you very much! – MM PP Jun 12 '17 at 7:20