Law of Large Numbers Suppose X is uniform discrete distribution from a set of (1,2,3,...,m). How do i investigate the law of large numbers for this? I thought of doing this by maybe setting m as 10 and having sample of distributions from 1 to 10 using R. By running the program multiple times I would have multiple distributions for X being (1:10). Suppose I run the program for 20 times, i would have 20 sample distributions from (1 to 10). I can calculate the mean of each distribution. Then i would gather up the means and find the average of the means. For example, for the first 5 distributions, i would have 5 means and i sum those up divide it by 5. I do the same for 10, 15 and 20. As I increase the number of times i do it i would approach the population mean of (1+10)/2 = 5.5 Is my approach correct or is there a better way to do this?
 A: The Law of Large Numbers concerns the sample average, whereby as the sample size increases, the sample average converges towards the expected value.
So in your case you would sample from the distribution and take the mean. Then as you repeat the sampling, each time increasing the sample size, the mean of the samples will approach the expected value.
I have often explained this to students with a simple example of rolling a fair 6-sided dice. The expected value is 3.5 obviously. First, note that we can never obtain 3.5 in a single roll. With 1 roll we would obtain any of the 6 possibilities with probability 1/6. As we increase the sample size, the sample mean will approach 3.5.
We can show this in R as follows:
We will sample from a uniform discrete distribution on the integers 1 to 6, starting with a sample size of 1 and increaseing the sample size to 1000. Each time we will compute the sample mean, and finally we will plot the means vs the sample size:
set.seed(15)
N <- 1000
m <- 6
vec.mean <- numeric(N)

for (i in 1:N) {
  vec.mean[i] <- mean(sample(1:m, i, replace = TRUE))
}
plot(vec.mean)


A: Assuming that by "sample of distributions" you mean drawing m samples from the same uniform distribution between 1 and 10, then yes your approach is correct. As m increases, the sample mean will 'jump' less and less around the true (population) mean 5.5 (convergence in probability = LLN).
However, you will hardly notice the difference with m = 20. I'd suggest progressively taking m from 1 to 1000 and plotting the means like so:
# Sim LLN
m     = 500 #no of iterations
means = 0   #vector to store means
for(i in 1:m){
  means[i] = mean(runif(i,1,10)) #drawing i samples from ~unif(1,10)
}
plot(means,type='l')    #plot sample means
abline(h=5.5,col='red') #plot population mean

Note that for the (weak) LLN to work, all random variables need to be identically distributed and independent (which in this case they are).
A: Stated precisely, the Central Limit Theorem (often referred to as "the Law of Large Numbers") says that given an underlying distribution with a finite standard deviation (which the uniform distribution does), for any range around the distribution's mean and target probability less than 1, there is some sample size for which the probability that the same mean is within the range is greater than the target probability.
So, for instance, if you want there to be a more than 99% probability that the sample mean is within 0.1 of the distribution mean, there is some sample size that satisfies that.
The CLT is a theorem about probability, so we can't say for certain what the sample means will do. It's not quite true that the sample means will get closer and closer to the distribution mean. The sample means will jump around, but they will probably jump around less and less.

For example, for the first 5 distributions, i would have 5 means and i sum those up divide it by 5.

That's a bit more complicated than it has to be. The expected value of a mean of means is just the mean of the underlying distribution. If you have twenty samples of ten observations each, the mean of the means will be the same as the mean what would get from just taking the mean of those 200 observations together.
